Search completed in 1.00 seconds.
1404 results for "connect":
Your results are loading. Please wait...
RTCPeerConnection: iceconnectionstatechange event - Web APIs
an iceconnectionstatechange event is sent to an rtcpeerconnection object each time the ice connection state changes during the negotiation process. the new ice connection state is available in the object's iceconnectionstate} property. bubbles no cancelable no interface event event handler property oniceconnectionstatechange one common task performed by the iceconnectionstatechange event listener: to trigger ice restart when the state changes to failed. see ice restart in lifetime of a webrtc session for further information. usage notes a successful connection attempt will typically involve the state starting at new, then transitioning through checking, then connected, and finally completed. however, under certain circumstances, the conne...
...ent listener: to trigger ice restart when the state changes to failed. see ice restart in lifetime of a webrtc session for further information. usage notes a successful connection attempt will typically involve the state starting at new, then transitioning through checking, then connected, and finally completed. however, under certain circumstances, the connected state can be skipped, causing a connection to transition directly from the checking state to completed. ...
...ioning through checking, then connected, and finally completed. however, under certain circumstances, the connected state can be skipped, causing a connection to transition directly from the checking state to completed. this can happen when only the last checked candidate is successful, and the gathering and end-of-candidates signals both occur before the successful negotiation is completed. ice connection state during ice restarts when an ice restart is processed, the gathering and connectivity checking process is started over from the beginning, which will cause the iceconnectionstate to transition to connected if the ice restart was triggered while in the completed state. ...
...And 7 more matches
RTCPeerConnection.onconnectionstatechange - Web APIs
the rtcpeerconnection.onconnectionstatechange property specifies an eventhandler which is called to handle the connectionstatechange event when it occurs on an instance of rtcpeerconnection. this happens whenever the aggregate state of the connection changes. the aggregate state is a combination of the states of all of the individual network transports being used by the connection. syntax rtcpeerconnection.onconnectionstatechange = eventhandler; value a function which is called by the browser when the connectionstatechange event occurs on the rtcpeerconnection. the function receives as input a single parameter, which is an object of type event. ...
... being used by the connection. syntax rtcpeerconnection.onconnectionstatechange = eventhandler; value a function which is called by the browser when the connectionstatechange event occurs on the rtcpeerconnection. the function receives as input a single parameter, which is an object of type event. the event object contains no special information of note; you can look at the value of the peer connection's connectionstate property to determine what the new state is. ...
...handler; value a function which is called by the browser when the connectionstatechange event occurs on the rtcpeerconnection. the function receives as input a single parameter, which is an object of type event. the event object contains no special information of note; you can look at the value of the peer connection's connectionstate property to determine what the new state is. ...
...And 7 more matches
RTCPeerConnection: connectionstatechange event - Web APIs
the connectionstatechange event is sent to the ontrack event handler on an rtcpeerconnection object after a new track has been added to an rtcrtpreceiver which is part of the connection. the new connection state can be found in connectionstate, and is one of the strings in the rtcpeerconnectionstate enumerated type. bubbles no cancelable no interface event event handler onconnectionstatechange examples for an rtcpeerconnection, pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the webrtc session. it simply calls an app-defined function called setonlinestatus() to update a status display. ...
... bubbles no cancelable no interface event event handler onconnectionstatechange examples for an rtcpeerconnection, pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the webrtc session. it simply calls an app-defined function called setonlinestatus() to update a status display. ...
... no interface event event handler onconnectionstatechange examples for an rtcpeerconnection, pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the webrtc session. it simply calls an app-defined function called setonlinestatus() to update a status display. ...
...And 5 more matches
RTCPeerConnection.connectionState - Web APIs
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. when this property's value changes, a connectionstatechange event is sent to the rtcpeerconnection instance. syntax var connectionstate = rtcpeerconnection.connectionstate; value the current state of the connection, as a value from the enum rtcpeerconnectionstate. 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 rtcdtl...
...alue from the enum rtcpeerconnectionstate. 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. ...
... 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 establishing a connection; that is, their rtciceconnectionstate is either "checking" or "connected", and no transports are in the "failed" state. ...
...And 3 more matches
RTCPeerConnection.iceConnectionState - Web APIs
the read-only property rtcpeerconnection.iceconnectionstate returns an enum of type rtciceconnectionstate which state of the ice agent associated with the rtcpeerconnection. you can detect when this value has changed by watching for the iceconnectionstatechange event. syntax var state = rtcpeerconnection.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 candid...
...iceconnectionstate 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 allow the peer connection to be made. it's possible that gathering of candidates is also still underway. ...
...alls 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 allow the peer connection to be made. it's possible that gathering of candidates is also still underway. "connected" a usable pairing of local and remote candidates has been found for all components of the connection, and the connection has been established. it's possible that gathering is still underway, and it's also possible that the ice agent is still checking candidates against one another looking for a better connection to use. "completed" the ice agent has finished gathering candidates,...
...And 3 more matches
RTCPeerConnection.oniceconnectionstatechange - Web APIs
the rtcpeerconnection.oniceconnectionstatechange property is an event handler which specifies a function to be called when the iceconnectionstatechange event is fired on an rtcpeerconnection instance. this happens when the state of the connection's ice agent, as represented by the iceconnectionstate property, changes. syntax rtcpeerconnection.oniceconnectionstatechange = eventhandler; value this event handler can be set to function which is passed a single input parameter: an event object describing the iceconnectionstatechange event which occurred. your code can look at the value of rtcpeerconnection.iceconnectionstate to determine what the new state is. example the example below watches the state of the ice agent for a failure or unexpected closure and takes appropriate action, such a...
...an event object describing the iceconnectionstatechange event which occurred. your code can look at the value of rtcpeerconnection.iceconnectionstate to determine what the new state is. example the example below watches the state of the ice agent for a failure or unexpected closure and takes appropriate action, such as presenting an error message or attempting to restart the ice agent. pc.oniceconnectionstatechange = function(event) { if (pc.iceconnectionstate === "failed" || pc.iceconnectionstate === "disconnected" || pc.iceconnectionstate === "closed") { // handle the failure } }; of course, "disconnected" and "closed" don't necessarily indicate errors; these can be the result of normal ice negotiation, so be sure to handle these properly (if at all). specifications ...
... candidate recommendation initial specification. ...
...nstate === "closed") { // handle the failure } }; of course, "disconnected" and "closed" don't necessarily indicate errors; these can be the result of normal ice negotiation, so be sure to handle these properly (if at all). specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.oniceconnectionstatechange' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection - Web APIs
the rtcpeerconnection interface represents a webrtc connection between the local computer and a remote peer. it provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53...
...fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/rtcpeerconnection" target="_top"><rect x="151" y="1" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="236" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">rtcpeerconnection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructorrtcpeerconnecti...
..."><rect x="151" y="1" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="236" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">rtcpeerconnection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructorrtcpeerconnection() the rtcpeerconnection() constructor returns a newly-created rtcpeerconnection, which represents a connection between the local device and a remote peer.propertiesalso inherits properties from: eventtargetcantrickleicecandidatesthe read-only rtcpeerconnection property cantrickleicecandidates returns a boolean which indicates whether or not the remote peer can accept trickled ice candidates.connectionstate the read-...
...And 80 more matches
nsIXPConnect
js/src/xpconnect/idl/nsixpconnect.idlnot scriptable provides the xpconnect service. ...
... js/src/xpconnect/idl/nsixpconnect.idlnot scriptable provides the xpconnect service. ...
... js/src/xpconnect/idl/nsixpconnect.idlnot scriptable provides the xpconnect service. ...
...And 32 more matches
WebRTC connectivity - Web APIs
this article describes how the various webrtc-related protocols interact with one another in order to create a connection and transfer data and/or media among peers. note: this page needs heavy rewriting for structural integrity and content completeness. lots of info here is good but the organization is a mess since this is sort of a dumping ground right now. signaling unfortunately, webrtc can’t create connections without some sort of server in the middle. we call this the signal channel or signaling service. it’s any sort of channel of communication to exchange information before setting up a connection, whether by email, post card or a carrier pigeon... it’s up to you. the information we need to exchange is the offer and answer which just contains the sdp mentioned below...
...sort of server in the middle. we call this the signal channel or signaling service. it’s any sort of channel of communication to exchange information before setting up a connection, whether by email, post card or a carrier pigeon... it’s up to you. the information 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. session descriptions the configuration of an endpoint on a webrtc connection is called a session description. the description includes information about th...
... 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 (ice, a protocol which lets two devices use an intermediary to exchange offers and answers even if the two devices are separated by network address translation (nat). each peer, then, keeps two descriptions on hand: the local description, describing itself, and the remote description, describing the other end of the call. the offer/answer process is performed both when a call...
...And 20 more matches
Connection management in HTTP/1.x - HTTP
several messages must be exchanged between the client and the server. ...
...several messages must be exchanged between the client and the server. ...
...several messages must be exchanged between the client and the server. ...
...And 20 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
because webrtc doesn't mandate a specific transport mechanism for signaling during the negotiation of a new peer connection, it's highly flexible. however, despite that flexibility in transport and communication of signaling messages, there's still a recommended design pattern you should follow when possible, known as perfect negotiation. this article introduces webrtc perfect negotiation, describing how it works and why it's the recommended way to negotiate a webrtc connection between peers, and provides sample code to demonstrate the technique. after the first deployments of webrtc-capable browsers, it was realized that parts of the negotiation process were more complicated than they needed to be for typical use cases. this was due to a small number of issues with the api and some potential r...
... separate the negotiation process from the rest of your application's logic. negotiation is an inherently asymmetric operation: one side needs to serve as the "caller" while the other peer is the "callee." the perfect negotiation pattern smooths this difference away by separating that difference out into independent negotiation logic, so that your application doesn't need to care which end of the connection it is. as far as your application is concerned, it makes no difference whether you're calling out or receiving a call. the best thing about perfect negotiation is that the same code is used for both the caller and the callee, so there's no repetition or otherwise added levels of negotiation code to write. perfect negotiation works by assigning each of the two peers a role to play in the nego...
...kes no difference whether you're calling out or receiving a call. the best thing about perfect negotiation is that the same code is used for both the caller and the callee, so there's no repetition or otherwise added levels of negotiation code to write. perfect negotiation works by assigning each of the two peers a role to play in the negotiation process that's entirely separate from the webrtc connection state: a polite peer, which uses ice rollback to prevent collisions with incoming offers. a polite peer, essentially, is one which may send out offers, but then responds if an offer arrives from the other peer with "okay, never mind, drop my offer and i'll consider yours instead." an impolite peer, which always ignores incoming offers that collide with its own offers. it never apologizes o...
...And 18 more matches
mozIStorageConnection
it is the primary interface for interacting with a database, including creating prepared statements, executing sql, and examining database errors. 1.0 68 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) for a general overview on how to use this interface, see storage. ...
...read only. lasterror long the last sqlite error code that occurred. read only. note: th...
...ktransaction(); void setgrowthincrement(in print32 aincrement, in autf8string adatabasename); mozistorageprogresshandler setprogresshandler(in print32 agranularity, in mozistorageprogresshandler ahandler); boolean tableexists(in autf8string atablename); attributes attribute type description connectionready boolean indicates if the connection is open and ready to use. 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 only. note: this is not reliable if you are using asynchronou...
...And 16 more matches
RTCPeerConnection.setRemoteDescription() - Web APIs
the rtcpeerconnection method setremotedescription() 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 setremotedescription() 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 b...
...signaling server. keep in mind that if setremotedescription() 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 setremotedescription() 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.setremotedescription(sessiondescription); parameters sessiondescription an rtcsessiondescriptioninit or rtcsessiondescription which specifies the remote peer's current offer or answer. this value is an offer or answer received from ...
...er or answer. this value is an offer or answer received from the remote peer through your implementation of the sessiondescription parameter is technically of type rtcsessiondescriptioninit, but because rtcsessiondescription serializes to be indistinguishable from rtcsessiondescriptioninit, you can also pass in an rtcsessiondescription. ...
...And 15 more matches
LiveConnect Overview - Archive of obsolete content
the chapter assumes you are familiar with java programming. working with wrappers in javascript, a wrapper is an object of the target language data type that encloses an object of the source language. when programming in javascript, you can use a wrapper object to access methods and fields of the java object; calling a method or accessing a property on the wrapper results in a call on the java object. on the java side, javascript objects are wrapped in an instance of the class netscape.javascript.jsobject and passed to 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 an interface 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...
...avascript 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 runtime engine converts argument values into the appropriate data types for the other language when you use liveconnect. see data type conversion for complete information. in some ways, the existence of the liveconnect objects is transparent, because you interact with java in a fairly intuitive way. for example, you can create a java string object and assign it to the javascript variable mystring by using the new operator with the java constructor, as follows: var mystring = new java.lang.string("hello world"); i...
...And 9 more matches
LiveConnect - Archive of obsolete content
liveconnect provides javascript with the ability to call methods of java classes and vice-versa using the existing java infrastructure. older versions of gecko included special support for the java<->javascript bridge (such as the java and packages global objects), but as of mozilla 16 (firefox 16 / thunderbird 16 / seamonkey 2.13) liveconnect functionality is provided solely by the oracle's java plugin. documentation java plugin - liveconnect documentation this is likely the most up-to-date documentation of liveconnect. removal of java and packages global objects in mozilla 16 see bug 748343 for the rationale and workarounds. you can still embed java applets and access their api from javascript. ...
... java in firefox extensions community view mozilla.dev.tech.java forums... ...
... java in firefox extensions community view mozilla.dev.tech.java forums... ...
...And 9 more matches
RTCPeerConnection.addTrack() - Web APIs
the rtcpeerconnection method addtrack() adds a new media track to the set of tracks which will be transmitted to the other peer. note: adding a track to a connection triggers renegotiation by firing a negotiationneeded event. see starting negotiation in signaling and video calling for details. syntax rtpsender = rtcpeerconnection.addtrack(track, stream...); parameters track a mediastreamtrack object representing the media track to add to the peer connection. stream... optional one or more local mediastream objects to which the track should be added. the specified track doesn't necessarily have to already be part of any of the specified streams. instead, the streams are simply a way to group tracks together on the receiving end of the connection, making sure they are synchronized. a...
...stream... optional one or more local mediastream objects to which the track should be added. the specified track doesn't necessarily have to already be part of any of the specified streams. instead, the streams are simply a way to group tracks together on the receiving end of the connection, making sure they are synchronized. any tracks that are added to the same stream on the local end of the connection will be on the same stream on the remote end. return value the rtcrtpsender object which will be used to transmit the media data. note: every rtcrtpsender is paired with an rtcrtpreceiver to make up an rtcrtptransceiver. the associated receiver is muted (indicating that it is not able to deliver packets) until and unless one or more streams are added to the receiver by the remote peer. e...
...t the media data. note: every rtcrtpsender is paired with an rtcrtpreceiver to make up an rtcrtptransceiver. the associated receiver is muted (indicating that it is not able to deliver packets) until and unless one or more streams are added to the receiver by the remote peer. exceptions invalidaccesserror the specified track (or all of its underlying streams) is already part of the rtcpeerconnection. invalidstateerror the rtcpeerconnection is closed. usage notes adding tracks to multiple streams after the track parameter, you can optionally specify one or more mediastream objects to add the track to. only tracks are sent from one peer to another, not streams. since streams are specific to each peer, specifying one or more streams means the other peer will create a corresponding stre...
...And 9 more matches
AudioNode.connect() - Web APIs
Web › API › AudioNode › connect
the connect() method of the audionode interface lets you connect one of the node's outputs to a target, which may be either another audionode (thereby directing the sound data to the specified node) or an audioparam, so that the node's output data is automatically used to change the value of that parameter over time. syntax var destinationnode = audionode.connect(destination, outputindex, inputindex); audionode.connect(destination, outputindex); parameters destination the audionode or audioparam to which to connect. outputindex optional an index specifying which output of the current audionode to connect to the destination. the index numbers are defined according to the number of output channels (see audio channels). ...
...de.connect(destination, outputindex, inputindex); audionode.connect(destination, outputindex); parameters destination the audionode or audioparam to which to connect. outputindex optional an index specifying which output of the current audionode to connect to the destination. the index numbers are defined according to the number of output channels (see audio channels). while you can only connect a given output to a given input once (repeated attempts are ignored), you can connect an output to multiple inputs by calling connect() repeatedly. this makes fan-out possible. the default value is 0. inputindex optional an index describing which input of the destination you want to connect the current audionode to; the default is 0. the index numbers are defined according to the number of inpu...
...empts are ignored), you can connect an output to multiple inputs by calling connect() repeatedly. this makes fan-out possible. the default value is 0. inputindex optional an index describing which input of the destination you want to connect the current audionode to; the default is 0. the index numbers are defined according to the number of input channels (see audio channels). it is possible to connect an audionode to another audionode, which in turn connects back to the first audionode, creating a cycle. this is allowed only if there is at least one delaynode in the cycle. otherwise, a notsupportederror exception is thrown. this parameter is not allowed if the destination is an audioparam. ...
...And 8 more matches
PerformanceResourceTiming.secureConnectionStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...And 8 more matches
RTCPeerConnection.setLocalDescription() - Web APIs
the rtcpeerconnection method setlocaldescription() 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 setlocaldescription() 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 setlocaldescription() does not immediately take effect. ...
...ion has been changed, asynchronously. if setlocaldescription() 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 setlocaldescription() 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. ...
... to adapt to changing network conditions). because descriptions will be exchanged until the two peers agree on a configuration, the description submitted by calling setlocaldescription() 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.setlocaldescription(sessiondescription); pc.setlocaldescription(sessiondescription, successcallback, errorcallback); parameters sessiondescription optional an rtcsessiondescriptioninit or rtcsessiondescription 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. ...
...And 8 more matches
RTCPeerConnection.signalingState - Web APIs
see signaling in lifetime of a webrtc session for more details about the signaling process. because the signaling process is a state machine, being able to verify that your code is in the expected state when messages arrive can help avoid unexpected and avoidable failures. ...
... is a state machine, being able to verify that your code is in the expected state when messages arrive can help avoid unexpected and avoidable failures. ...
...nswers after creating an offer but before an answer has been received and passed into rtcpeerconnection.setlocaldescription(). 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 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. constant ...
...And 7 more matches
Creating Sandboxed HTTP Connections
nsiuri is an xpcom representation of an uri, with useful methods to query and manipulate the uri. ...
...nsiuri is an xpcom representation of an uri, with useful methods to query and manipulate the uri. ...
...nsiuri is an xpcom representation of an uri, with useful methods to query and manipulate the uri. ...
...And 6 more matches
RTCPeerConnection.createOffer() - Web APIs
the createoffer() method of the rtcpeerconnection interface initiates the creation of an sdp offer for the purpose of starting a new webrtc connection to a remote peer. the sdp offer includes information about any mediastreamtracks 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 rtcsessiondescription object containing the newly-created offer. ...
...wser, 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 rtcsessiondescription 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. ...
...this will cause the returned offer to have different credentials than those already in place. if you then apply the returned offer, ice will restart. specify false to keep the same credentials and therefore not restart ice. the default is false. ...
...And 6 more matches
Effective connection type - MDN Web Docs Glossary: Definitions of Web-related terms
2g 1400ms 70 kbps the network is suited for transfers of small images. ...
... 2g 1400ms 70 kbps the network is suited for transfers of small images. ...
... 2g 1400ms 70 kbps the network is suited for transfers of small images. ...
...And 5 more matches
PerformanceResourceTiming.connectEnd - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...And 5 more matches
RTCPeerConnection: icecandidate event - Web APIs
sharing a new candidate the majority of icecandidate events are fired to indicate that a new candidate has been gathered. ...
... sharing a new candidate the majority of icecandidate events are fired to indicate that a new candidate has been gathered. ...
... sharing a new candidate the majority of icecandidate events are fired to indicate that a new candidate has been gathered. ...
...And 5 more matches
RTCPeerConnection: negotiationneeded event - Web APIs
this starts the process of ice negotiation by instructing your code to begin exchanging ice candidates through the signaling server. ...
...this starts the process of ice negotiation by instructing your code to begin exchanging ice candidates through the signaling server. ...
...this starts the process of ice negotiation by instructing your code to begin exchanging ice candidates through the signaling server. ...
...And 5 more matches
RTCPeerConnection.pendingLocalDescription - Web APIs
otherwise, this returns null. ...
...otherwise, this returns null. ...
...otherwise, this returns null. ...
...And 5 more matches
RTCPeerConnection.pendingRemoteDescription - Web APIs
otherwise, this returns null. ...
...otherwise, this returns null. ...
...otherwise, this returns null. ...
...And 5 more matches
PerformanceResourceTiming.connectStart - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...And 4 more matches
RTCPeerConnection() - Web APIs
the rtcpeerconnection() constructor returns a newly-created rtcpeerconnection, which represents a connection between the local device and a remote peer. syntax pc = new rtcpeerconnection([configuration]); parameters configuration optional an rtcconfiguration dictionary providing options to configure the new connection. rtcconfiguration dictionary bundlepolicy optional specifies how to handle negotiation of candidates when the remote peer is not compatible with the sdp bundle standard. this must be one of the values from the enum rtcbundlepolicy. if this value isn't included in the dictionary, "balanced" is assumed. certificates optional an array of objects of type rtccertificate which are used by the connection for authentication. if this property isn't specified, a set of certifi...
...is not compatible with the sdp bundle standard. this must be one of the values from the enum rtcbundlepolicy. if this value isn't included in the dictionary, "balanced" is assumed. certificates optional an array of objects of type rtccertificate which are used by the connection for authentication. if this property isn't specified, a set of certificates is generated automatically for each rtcpeerconnection instance. although only one certificate is used by a given connection, providing certificates for multiple algorithms may improve the odds of successfully connecting in some circumstances. see using certificates below for additional information. this configuration option cannot be changed after it is first specified; once the certificates have been set, this property is ignored in future call...
.... although only one certificate is used by a given connection, providing certificates for multiple algorithms may improve the odds of successfully connecting in some circumstances. see using certificates below for additional information. this configuration option cannot be changed after it is first specified; once the certificates have been set, this property is ignored in future calls to rtcpeerconnection.setconfiguration(). icecandidatepoolsize optional an unsigned 16-bit integer value which specifies the size of the prefetched ice candidate pool. the default value is 0 (meaning no candidate prefetching will occur). ...
...And 4 more matches
RTCPeerConnection.addStream() - Web APIs
the obsolete rtcpeerconnection method addstream() adds a mediastream as a local source of audio or video. instead of using this obsolete method, you should instead use addtrack() once for each track you wish to send to the remote peer. if the signalingstate is set to closed, an invalidstateerror is raised. if the signalingstate is set to stable, the event negotiationneeded is sent on the rtcpeerconnection to indicate that ice negotiation must be repeated to consider the new stream. syntax rtcpeerconnection.addstream(mediastream); parameters mediastream a mediastream object indicating the stream to add to the webrtc peer connection. return value none. example this simple example adds the audio and video stream coming from the user's camera to the connection. navigator.mediadevices...
...m. syntax rtcpeerconnection.addstream(mediastream); parameters mediastream a mediastream object indicating the stream to add to the webrtc peer connection. return value none. example this simple example adds the audio and video stream coming from the user's camera to the connection. ...
...ming from the user's camera to the connection. navigator.mediadevices.getusermedia({video:true, audio:true}, function(stream) { var pc = new rtcpeerconnection(); pc.addstream(stream); }); migrating to addtrack() compatibility allowing, you should update your code to instead use the addtrack() method: navigator.getusermedia({video:true, audio:true}, function(stream) { var pc = new rtcpeerconnection(); stream.gettracks().foreach(function(track) { pc.addtrack(track, stream); }); }); the newer addtrack() api avoids confusion over whether later changes to the track-makeup of a stream affects a peer connection (they do not). ...
...And 4 more matches
RTCPeerConnection.createDataChannel() - Web APIs
this string may not be longer than 65,535 bytes. ...
...this string may not be longer than 65,535 bytes. ...
...ection interface creates a new channel linked with the remote peer, over which any kind of data may be transmitted. this can be useful for back-channel content such as images, file transfer, text chat, game update packets, and so forth. if the new data channel is the first one added to the connection, renegotiation is started by delivering a negotiationneeded event. syntax datachannel = rtcpeerconnection.createdatachannel(label[, options]); parameters label a human-readable name for the channel. this string may not be longer than 65,535 bytes. options optional an rtcdatachannelinit dictionary providing configuration options for the data channel rtcdatachannelinit dictionary the rtcdatachannelinit dictionary provides the following fields, any of which may be included in the object pas...
...And 4 more matches
RTCPeerConnection: icecandidateerror event - Web APIs
there is one additional, webrtc-specific, error which lies outside the valid stun error code range: 701. ...
...there is one additional, webrtc-specific, error which lies outside the valid stun error code range: 701. ...
...there is one additional, webrtc-specific, error which lies outside the valid stun error code range: 701. ...
...And 4 more matches
AudioNode.disconnect() - Web APIs
the disconnect() method of the audionode interface lets you disconnect one or more nodes from the node on which the method is called. syntax audionode.disconnect(); audionode.disconnect(output); audionode.disconnect(destination); audionode.disconnect(destination, output); audionode.disconnect(destination, output, input); return value undefined parameters there are several versions of the disconnect() method, which accept different combinations of parameters to control which nodes to disconnect from. if no parameters are provided, all outgoing connections are disconnected. destination optional an audionode or audioparam specifying the node or nodes to disconnect from. ...
...e undefined parameters there are several versions of the disconnect() method, which accept different combinations of parameters to control which nodes to disconnect from. if no parameters are provided, all outgoing connections are disconnected. destination optional an audionode or audioparam specifying the node or nodes to disconnect from. if this value is an audionode, a single node is disconnected from, with any other, optional, parameters (output and/or input) further limiting which inputs and/or outputs should be disconnected. if this value is an audioparam, then the connection to that audioparam is terminated, and the node's contributions to that computed parameter become 0 going forward once the change takes effect. ...
...the index numbers are defined according to the number of output channels (see audio channels). if this parameter is out-of-bound, an indexsizeerror exception is thrown. ...
...And 3 more matches
Node.isConnected - Web APIs
Web › API › Node › isConnected
the isconnected read-only property of the node interface returns a boolean indicating whether the node is connected (directly or indirectly) to the context object, for example the document object in the case of the normal dom, or the shadowroot in the case of a shadow dom. syntax var isitconnected = nodeobjectinstance.isconnected return value a boolean that is true if the node is connected to its relevant context object, and false if not. ...
...object, for example the document object in the case of the normal dom, or the shadowroot in the case of a shadow dom. syntax var isitconnected = nodeobjectinstance.isconnected return value a boolean that is true if the node is connected to its relevant context object, and false if not. ...
...dowroot in the case of a shadow dom. syntax var isitconnected = nodeobjectinstance.isconnected return value a boolean that is true if the node is connected to its relevant context object, and false if not. ...
...And 3 more matches
RTCPeerConnection.getConfiguration() - Web APIs
the rtcpeerconnection.getconfiguration() method returns an rtcconfiguration object which indicates the current configuration of the rtcpeerconnection on which the method is called. the returned configuration is the last configuration applied via setconfiguration(), or if setconfiguration() hasn't been called, the configuration the rtcpeerconnection was constructed with. the configuration includes a list of the ice servers used by the connection, information about transport policies, and identity information. syntax var configuration = rtcpeerconnection.getconfiguration(); parameters this method takes no input parameters. return value an rtcconfiguration object describing the rtcpeerconnection's current configuration. ...
...ncludes a list of the ice servers used by the connection, information about transport policies, and identity information. syntax var configuration = rtcpeerconnection.getconfiguration(); parameters this method takes no input parameters. return value an rtcconfiguration object describing the rtcpeerconnection's current configuration. example this example adds a new certificate to an active connection if it doesn't already have one in use. ...
...ransport policies, and identity information. syntax var configuration = rtcpeerconnection.getconfiguration(); parameters this method takes no input parameters. return value an rtcconfiguration object describing the rtcpeerconnection's current configuration. example this example adds a new certificate to an active connection if it doesn't already have one in use. ...
...And 3 more matches
RTCPeerConnection.restartIce() - Web APIs
the webrtc api's rtcpeerconnection interface offers the restartice() method to allow a web application to easily request that ice candidate gathering be redone on both ends of the connection. this simplifies the process by allowing 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. ...
.... 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. ...
... 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 connection's signalingstate changes to stable, the connection will fire the negotiationneeded event. this process continues until an ice restart has been successfully completed. syntax rtcpeerconnection.restartice(); parameters none. return value undefined. usage notes after calling restartice(), the next offer created usi...
...And 3 more matches
RTCPeerConnection.setConfiguration() - Web APIs
the rtcpeerconnection.setconfiguration() method sets the current configuration of the rtcpeerconnection based on the values included in the specified rtcconfiguration object. this lets you change the ice servers used by the connection and which transport policies to use. the most common use case for this method (and even then, probably not a very common use case) is to replace the set of ice servers to be used. two potential scenarios in which this might be done: the rtcpeerconnection was instantiated without specifying any ice servers. if, for example, the rtcpeerconnection() constructor was called with no parameters, you would have to then call setconfiguration() to add ice servers before ice negotiation could begin. ...
...n use case) is to replace the set of ice servers to be used. two potential scenarios in which this might be done: the rtcpeerconnection was instantiated without specifying any ice servers. if, for example, the rtcpeerconnection() constructor was called with no parameters, you would have to then call setconfiguration() to add ice servers before ice negotiation could begin. renegotiation of the connection is needed, and a different set of ice servers needs to be used for some reason. perhaps the user has moved into a new region, so using new regional ice servers is necessary, for example. ...
...the changes are not additive; instead, the new values completely replace the existing ones. ...
...And 3 more matches
RTCPeerConnection.addIceCandidate() - Web APIs
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. ...
... 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. ...
...idate 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 with an a-line value of end-of-candidates. during negotiation, your app will likely receive many candidates which you'll deliver to the ice agent in this way, allowing it to build up a list of potential connection methods. this is covered in more detail in the articles webrtc connectivity and signaling and video calling. syntax apromise = pc.addicecandidate(candidate); addicecandidate(candidate, successcallback, failurecallback); parameters candidate optional an object conforming to the rtcicecandidateinit dictionary, or an rtcicecandidate object; the contents of the object should be constr...
...And 2 more matches
RTCPeerConnection.canTrickleIceCandidates - Web APIs
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. ...
... 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. ...
...n'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, the offer contains all of the candidates. ...
...And 2 more matches
RTCPeerConnection.close() - Web APIs
the rtcpeerconnection.close() method closes the current peer connection. syntax peerconnection.close(); this method has no parameters, and returns nothing. calling this method terminates the rtcpeerconnection's ice agent, ending any ongoing ice processing and any active streams. this also releases any resources in use by the ice agent, including turn permissions. all rtcrtpsender objects are considered to be stopped once this returns (they may still be in the process of stopping, but for all intents and purposes, they're stopped). once this method returns, the signaling state as returned by rtcpeerconnection.signalingstate is closed. ...
...rces in use by the ice agent, including turn permissions. all rtcrtpsender objects are considered to be stopped once this returns (they may still be in the process of stopping, but for all intents and purposes, they're stopped). once this method returns, the signaling state as returned by rtcpeerconnection.signalingstate is closed. ...
...ns. all rtcrtpsender objects are considered to be stopped once this returns (they may still be in the process of stopping, but for all intents and purposes, they're stopped). once this method returns, the signaling state as returned by rtcpeerconnection.signalingstate is closed. make sure that you delete all references to the previous rtcpeerconnection before attempting to create a new one that connects to the same remote peer, as not doing so might result in some errors depending on the browser. ...
...And 2 more matches
RTCPeerConnection.currentLocalDescription - Web APIs
the read-only property rtcpeerconnection.currentlocaldescription returns an rtcsessiondescription 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 currentlocaldescription, call rtcpeerconnection.setlocaldescription(), which triggers a series of events which leads to this value being set. ...
...generated by the ice agent since the offer or answer represented by the description was first instantiated. to change the currentlocaldescription, call rtcpeerconnection.setlocaldescription(), 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. ...
...ce the offer or answer represented by the description was first instantiated. to change the currentlocaldescription, call rtcpeerconnection.setlocaldescription(), 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.localdescription, this value represents the actual current state of the local end of the connection; localdescription may specify a description which the connection is currently in the process of switching over to. syntax sessiondescription = rtcpeerconnection.currentlocaldescription; return value the current description of the local end of the connection, if one has been set. if none has...
...And 2 more matches
RTCPeerConnection.currentRemoteDescription - Web APIs
the read-only property rtcpeerconnection.currentremotedescription returns an rtcsessiondescription 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 currentremotedescription, call rtcpeerconnection.setremotedescription(), which triggers a series of events which leads to this value being set. ...
...nerated by the ice agent since the offer or answer represented by the description was first instantiated. to change the currentremotedescription, call rtcpeerconnection.setremotedescription(), 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. ...
... the offer or answer represented by the description was first instantiated. to change the currentremotedescription, call rtcpeerconnection.setremotedescription(), 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.remotedescription, this value represents the actual current state of the local end of the connection; remotedescription may specify a description which the connection is currently in the process of switching over to. syntax sessiondescription = rtcpeerconnection.currentremotedescription; return value the current description of the remote end of the connection, if one has been set. if none...
...And 2 more matches
RTCPeerConnection.getStats() - Web APIs
the rtcpeerconnection method getstats() returns a promise which resolves with data providing statistics about either the overall connection or about the specified mediastreamtrack. syntax promise = rtcpeerconnection.getstats(selector) parameters selector optional a mediastreamtrack for which to gather statistics. if this is null (the default value), statistics will be gathered for the entire rtcpeerconnection. return value a promise which resolves with an rtcstatsreport object providing connection statistics. the contents of the report depend on the selector as well as other details of the connection. exceptions this method does not throw exceptions; instead, it rejects the returned promise with one of the following errors: invalidaccesserror there is no rtcrtpsender or rtcrt...
...e; in addition, the data it returns is entirely different from the current specification, and the form of that data was never documented. this form of getstats() has been or will soon be removed from most browsers; you should not use it, and should update existing code to use the new promise-based version. check the browser compatibility table to verify the state of this method. promise = rtcpeerconnection.getstats(selector, successcallback, failurecallback) parameters selector optional a mediastreamtrack for which to gather statistics. if this is null (the default value), statistics will be gathered for the entire rtcpeerconnection. successcallback a callback function to call when the stats have been retrieved. the function receives as input a single parameter: an rtcstatsreport with t...
... output is expected from the function. failurecallback a function to call when an error occurs while attempting to collect statistics. the callback receives as input the exception (a domexception object describing the error which occurred. no return value is expected from the callback. ...
...And 2 more matches
RTCPeerConnection.removeStream() - Web APIs
return value undefined. ...
... the negotiation already happened, a new one will be needed for the remote peer to be able to use it. because this method has been deprecated, you should instead use removetrack() if your target browser versions have implemented it. if the signalingstate is set to "closed", an invalidstateerror is raised. ...
...pened, a new one will be needed for the remote peer to be able to use it. because this method has been deprecated, you should instead use removetrack() if your target browser versions have implemented it. if the signalingstate is set to "closed", an invalidstateerror is raised. if the signalingstate is set to "stable", the event negotiationneeded is sent on the rtcpeerconnection. ...
...And 2 more matches
CSP: connect-src - HTTP
the http content-security-policy (csp) connect-src directive restricts the urls which can be loaded using script interfaces. the apis that are restricted are: <a> ping, fetch, xmlhttprequest, websocket, eventsource, and navigator.sendbeacon(). note: connect-src 'self' does not resolve to websocket schemas in all browsers, more info: https://github.com/w3c/webappsec-csp/issues/7 csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. ...
...acon(). note: connect-src 'self' does not resolve to websocket schemas in all browsers, more info: https://github.com/w3c/webappsec-csp/issues/7 csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. syntax one or more sources can be allowed for the connect-src policy: content-security-policy: connect-src <source>; content-security-policy: connect-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again...
...e. when generating the hash, don't include the <script> or <style> tags and note that capitalization and whitespace matter, including leading or trailing whitespace. see unsafe inline script for an example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. examples violation cases given this csp header: content-security-policy: connect-src https://example.com/ the following connections are blocked and won't load: <a ping="https://not-example.com"> <script> var xhr = new xmlhttprequest(); xhr.open('get', 'https://not-example.com/'); xhr.send(); var ws = new websocket("https://not-example.com/"); var es = new eventsource("https://not-example.com/"); navigator.sendbeacon("https://not-example.com/", { ... }); </sc...
...And 2 more matches
PR_Connect
initiates a connection on a specified socket. syntax #include <prio.h> prstatus pr_connect( prfiledesc *fd, const prnetaddr *addr, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket. addr a 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 case...
...ct 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. ...
...t, 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 the lesser of the provided timeout and the os's connect timeout. in particular, if you specify pr_interval_no_timeout as the timeout, the os's connection time limit will be used. if the socket is a udp socket, there is no connection setup to speak of, since udp is connectionless. ...
...pr_connect blocks until either the connection is successfully established or an error occurs. the function uses the lesser of the provided timeout and the os's connect timeout. in particular, if you specify pr_interval_no_timeout as the timeout, the os's connection time limit will be used. if the socket is a udp socket, there is no connection setup to speak of, since udp is connectionless. if pr_connect is invoked on a udp socket, it has an overloaded meaning: pr_connect merely saves the specified address as the default peer address for the socket, so that subsequently one can send and receive datagrams from the socket using pr_send and pr_recv instead of the usual pr_sendto and pr_recvfrom. ...
XPConnect wrappers
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. 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]]". because these are wrapped, you won't be able to peek down inside them from the console. ...
...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]]". because these are wrapped, you won't be able to peek down inside them from the console. basic xpconnect objects xpcwrappednative these objects are created when any natively implemented xpcom object (that is, any object implemented in c++) needs to be reflected into javascript. this includes all dom objects (including window) and chrome elements that are reflected into javascript. this wrapper is responsible for mapping calls from javascript into c++. this means that when you say window.focus(), ...
...ed xpcom object (that is, any object implemented in c++) needs to be reflected into javascript. this includes all dom objects (including window) and chrome elements that are reflected into javascript. this wrapper is responsible for mapping calls from javascript into c++. this means that when you say window.focus(), you're calling into xpcwrappednative code. if you call 'tostring()' and get "[xpconnect wrapped nsifoo]" then the reference is to a xpcwrappednative object with interface nsifoo. they are implicitly created by xpconnect and you should not have to worry about how that happens. there are several types of wrapped natives, but i won't cover those here. xpcwrappedjs these objects are the exact opposite of xpcwrappednative. they exist to reflect an object from javascript into c++. this...
... you pass your javascript object into a c++ function, we create one of these wrappers. for example, if you've implemented some component with an interface nsifoo and you pass your javascript object into a c++ function taking an nsifoo, an xpcwrappedjs is created around your object. c++ calls are routed through xpcwrappedjs code into your javascript implementation. these wrappers are created by xpconnect, so you should not have to worry about how to construct them or whether to construct them. double wrapping. there is one case where an xpcwrappednative wraps another wrapper object. this case is where a js object was passed in via some idl-declared interface, creating an xpcwrappedjs, and is now being returned to javascript via some other interface. in order to preserve api compatibility, an xpc...
RTCPeerConnection.addTransceiver() - Web APIs
init optional an object that conforms to the rtcrtptransceiverinit dictionary which provides any options that you may wish to specify when creating the new transceiver. ...
... init optional an object that conforms to the rtcrtptransceiverinit dictionary which provides any options that you may wish to specify when creating the new transceiver. ...
...eferred directionality. this value is used to initialize the new rtcrtptransceiver object's rtcrtptransceiver.direction property. sendencodings optional a list of encodings to allow when sending rtp media from the rtcrtpsender. each entry is of type rtcrtpencodingparameters. ...
...he remote peer's rtcpeerconnection's track event occurs, these are the streams that will be specified by that event. exceptions typeerror a string was specified as trackorkind which is not valid. the string must be either "audio" or "video". specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.addtransceiver()' in that specification. candidate recommendation ...
RTCPeerConnection.createAnswer() - Web APIs
the createanswer() method on the rtcpeerconnection interface creates an sdp answer to an offer received from a remote peer during the offer/answer negotiation of a webrtc connection. the answer contains information about any media already attached to the session, codecs and options supported by the browser, and any ice candidates already gathered. the answer is delivered to the returned promise, and should then be sent to the source of the offer to continue the negotiation process. syntax apromise = rtcpeerconnection.createanswer([options]); rtcpeerconnection.createanswer(successcallback, failurecallback[, options]); parameters options optional an object which contains options which customize the answer; this is based on the rtcansweroptions dictionary. deprecated parameters in olde...
...rongly 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 rtcsessiondescriptioncallback which will be passed a single rtcsessiondescription 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 identity provider wasn't able to provide an identity assertion. operationerror generation of the sdp failed for some reason; this is a gener...
... 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 is an implementation detail that's entirely up to you. in this case, a websocket connection 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.setlocald...
.... 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.setlocaldescription(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 setlocaldescription(). once that succeeds, the answer is sent to the signaling server using whatever protocol you see fit. promise.catch() is used to trap and handle errors. see handling the invitation in signaling and video calling to see th...
RTCPeerConnection: icegatheringstatechange event - Web APIs
the icegatheringstatechange event is sent to the onicegatheringstatechange event handler on an rtcpeerconnection when the state of the ice candidate gathering process changes. this signifies that the value of the connection's icegatheringstate property has changed. when ice firststarts to gather connection candidates, the value changes from new to gathering to indicate that the process of collecting candidate configurations for the connection has begun. when the value changes to complete, all of the transports that make up the rtcpeerconnection have finished gathering ice candidates. bubbles no cancelable no interface event event handler onicegatheringstatechange note: while you can determine that ice candidate gathering is complete by wa...
... icegatheringstatechange events and checking for the value of icegatheringstate to become complete, you can also simply have your handler for the icecandidate event look to see if its candidate property is null. this also indicates that collection of candidates is finished. examples this example creates a handler for icegatheringstatechange events. ...
...d checking for the value of icegatheringstate to become complete, you can also simply have your handler for the icecandidate event look to see if its candidate property is null. this also indicates that collection of candidates is finished. examples this example creates a handler for icegatheringstatechange events. ...
...let connection = ev.target; switch(connection.icegatheringstate) { case "gathering": /* collection of candidates has begun */ break; case "complete": /* collection of candidates is finished */ break; } } likewise, you can use addeventlistener() to add a listener for icegatheringstatechange events: pc.addeventlistener("icegatheringstatechange", ev => { let connection = ev.target; switch(connection.icegatheringstate) { case "gathering": /* collection of candidates has begun */ break; case "complete": /* collection of candidates is finished */ break; } }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'icecandidatestat...
RTCPeerConnection.onicecandidateerror - Web APIs
the event offers properties describing the error to help you handle it appropriately. example pc.onicecandidateerror = function(event) { if (event.errorcode >= 300 && event.errorcode <= 699) { // stun errors are in the range 300-699. ...
...the event offers properties describing the error to help you handle it appropriately. example pc.onicecandidateerror = function(event) { if (event.errorcode >= 300 && event.errorcode <= 699) { // stun errors are in the range 300-699. ...
...the event offers properties describing the error to help you handle it appropriately. ...
...w more error codes; see // rfc 5766, section 15 for details. } else if (event.errorcode >= 700 && event.errorcode <= 799) { // server could not be reached; a specific error number is // provided but these are not yet specified. } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onicecandidateerror' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.onnegotiationneeded - Web APIs
the rtcpeerconnection interface's onnegotiationneeded property is an eventlistener which specifies a function which is called to handle the negotiationneeded event when it occurs on an rtcpeerconnection instance. this event is fired when a change has occurred which requires session negotiation. this negotiation should be carried out as the offerer, because some session changes cannot be negotiated as the answerer. most commonly, the negotiationneeded event is fired after a send track is added to the rtcpeerconnection. if the session is modified in a manner that requires negotiation while a negotiation is already in progress, no negotiationneeded event will fire until negotiation completes, and only then if negotiation is still needed. ...
...e session changes cannot be negotiated as the answerer. most commonly, the negotiationneeded event is fired after a send track is added to the rtcpeerconnection. if the session is modified in a manner that requires negotiation while a negotiation is already in progress, no negotiationneeded event will fire until negotiation completes, and only then if negotiation is still needed. syntax rtcpeerconnection.onnegotiationneeded = eventhandler; value this should be set to a function you provide which is passed a single parameter: an event object containing the negotiationneeded event. there's no additional information provided in the event; anything you need, you can get by examining the properties of the rtcpeerconnection. example this example, derived from the example in signaling and video ...
...ameter: an event object containing the negotiationneeded event. there's no additional information provided in the event; anything you need, you can get by examining 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.setlocaldescription(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...
...eeded = function() { pc.createoffer().then(function(offer) { return pc.setlocaldescription(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 setlocaldescription() to set the local description for the connection. once that's succeeded in turn, the offer can be sent to the signaling server for delivery to the remote peer. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onnegotiationneeded' in that specification. candidate recommendation initial specification. ...
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 setlocaldescription() or to setremotedescription(). 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 u...
...er; 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. ...
...t. 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 handler for the signalingstatechange event using addeventlistener(): myrtcpeerconnection.addeventlistener("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.signaling...
...ceived and a local description of type "pranswer" has been applied in response. pc.onsignalingstatechange = function(event) { if (pc.signalingstate === "have-local-pranswer") { // setlocaldescription() has been called with an answer } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onsignalingstatechange' in that specification. candidate recommendation initial specification. ...
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 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 an error occcurs while attempting to validate an incoming identity assertion (that is, the information describing a peer's identity), the promise is rejected. ...
...tedescription() doesn't need to wait for validation to occur before it resolves. example in this example, a function, getidentityassertion(), is created which asynchronously waits for the peer's identity to be verified, then returns the identity to the caller. if an error occurs and the promise is rejected, this logs the error to the console and returns null to the caller. let pc = new rtcpeerconnection(); /* ... */ async function getidentityassertion(pc) { try { const identity = await pc.peeridentity; return identity; } catch(err) { console.log("error identifying remote peer: ", err); return null; } } specifications specification status comment identity for webrtc candidate recommendation initial specification. ...
RTCPeerConnection: peeridentity event - Web APIs
once resolved, its value is the new identity. ...
...once resolved, its value is the new identity. ...
...once resolved, its value is the new identity. ...
...nnection.onpeeridentity property. bubbles no cancelable no interface event event handler property onpeeridentity important: this event and its event handler have been removed from the specification and are no longer available. instead of using this event to detect when an identity is available, simply wait for the promise returned by rtcpeerconnection.peeridentity to be resolved. once resolved, its value is the new identity. examples for the correct way to detect a new peer identity, see rtcpeerconnection.peeridentity. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'peeridentity' in that specification. candidate recommendation ...
RTCPeerConnection.remoteDescription - Web APIs
the read-only property rtcpeerconnection.remotedescription returns a rtcsessiondescription 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.setremotedescription() in response. syntax var sessiondescription = peerconnection.remotedescription; on a more fundamental level, the returned value is the value of rtcpeerconnection.pendingremotedescription if that property isn't null; otherwise, the value of rtcpeerconnection.currentremotedescription is returned. see pending and current de...
...code calling rtcpeerconnection.setremotedescription() in response. syntax var sessiondescription = peerconnection.remotedescription; on a more fundamental level, the returned value is the value of rtcpeerconnection.pendingremotedescription if that property isn't null; otherwise, the value of rtcpeerconnection.currentremotedescription 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 remotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. ...
...remotedescription if that property isn't null; otherwise, the value of rtcpeerconnection.currentremotedescription 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 remotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. ...
...ype and sdp fields. var pc = new rtcpeerconnection(); … var sd = pc.remotedescription; 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.remotedescription' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.removeTrack() - Web APIs
the rtcpeerconnection.removetrack() method tells the local end of the connection to stop sending media from the specified track, without actually removing the corresponding rtcrtpsender from the list of senders as reported by rtcpeerconnection.getsenders(). if the track is already stopped, or is not in the connection's senders list, this method has no effect. if the connection has already been negotiated (signalingstate is set to "stable"), it is marked as needing to be negotiated again; the remote peer won't experience the change until this negotiation occurs. a negotiationneeded event is sent to the rtcpeerconnection to let the local end know this negotiation must occur. syntax pc.removetrack(sender); parameters mediatrack a rtcrtpsender specifying the sender to remove from the connec...
...egotiated again; the remote peer won't experience the change until this negotiation occurs. a negotiationneeded event is sent to the rtcpeerconnection to let the local end know this negotiation must occur. syntax pc.removetrack(sender); parameters mediatrack a rtcrtpsender specifying the sender to remove from the connection. return value undefined. exceptions invalidstateerror the connection is not open. example this example adds a video track to a connection and sets up a listener on a close button which removes the track when the user clicks the button. ...
...tpsender specifying the sender to remove from the connection. return value undefined. exceptions invalidstateerror the connection is not open. example this example adds a video track to a connection and sets up a listener on a close button which removes the track when the user clicks the button. ...
... = new rtcpeerconnection(); var track = stream.getvideotracks()[0]; sender = pc.addtrack(track, stream); }); document.getelementbyid("closebutton").addeventlistener("click", function(event) { pc.removetrack(sender); pc.close(); }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.removetrack()' in that specification. candidate recommendation initial specification. ...
RTCPeerConnectionIceErrorEvent.address - Web APIs
the rtcpeerconnectioniceerrorevent property address is a string which indicates the local ip address being used to communicate with the stun or turn server during negotiations. the error which occurred involved this address. syntax let address = rtcpeerconnectioniceerrorevent.address; value a domstring which specifies the local ip address of the network connection to the ice server with which negotiations were occurring when the error occurred. this address identifies the network interface on the local device which is being used to attempt to establish the connection to the remote peer. this can be useful on multi-homed systems—devices with more than one network connection—to determine which network interface is being used. for example, on a mobile phone, there are typically at least tw...
.... this address identifies the network interface on the local device which is being used to attempt to establish the connection to the remote peer. this can be useful on multi-homed systems—devices with more than one network connection—to determine which network interface is being used. for example, on a mobile phone, there are typically at least two network interfaces available: the cellular connection and a wifi connection. if the local ip address isn't exposed as part of a local candidate, the value of address is null. ...
...d. for example, on a mobile phone, there are typically at least two network interfaces available: the cellular connection and a wifi connection. if the local ip address isn't exposed as part of a local candidate, the value of address is null. examples this example creates a handler for icecandidateerror events which creates human readable messages describing the local network interface for the connection as well as the ice server that was being used to try to open the connection, then calls a function to display those as well as the event's errortext property's contents. pc.addeventlistener("icecandidateerror", (event) => { let networkinfo = `[local interface: ${event.address}:${event.port}`; let iceserverinfo = `[ice server: ${event.url}`; showmessage(errortext, iceserverinfo, network...
...ty's contents. pc.addeventlistener("icecandidateerror", (event) => { let networkinfo = `[local interface: ${event.address}:${event.port}`; let iceserverinfo = `[ice server: ${event.url}`; showmessage(errortext, iceserverinfo, networkinfo); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceerrorevent.address' in that specification. candidate recommendation initial definition. ...
RTCPeerConnectionIceErrorEvent - Web APIs
the rtcpeerconnectioniceerrorevent interface—based upon the event interface—provides details pertaining to an ice error announced by sending an icecandidateerror event to the rtcpeerconnection object. constructor rtcpeerconnectioniceerrorevent() creates and returns a new rtcpeerconnectioniceerrorevent object, with its type and other properties initialized as specified in the parameters. you will not normally create an object of this type yourself. ...
...es details pertaining to an ice error announced by sending an icecandidateerror event to the rtcpeerconnection object. constructor rtcpeerconnectioniceerrorevent() creates and returns a new rtcpeerconnectioniceerrorevent object, with its type and other properties initialized as specified in the parameters. you will not normally create an object of this type yourself. properties the rtcpeerconnectioniceerrorevent interface includes the properties found on the event interface, as well as the following properties: address read only a domstring providing the local ip address used to communicate with the stun or turn server being used to negotiate the connection, or null if the local ip address has not yet been exposed as part of a local ice candidate. errorcode read only an unsigned i...
...aining the stun reason text returned by the stun or turn server. if communication with the stun or turn server couldn't be established at all, this string will be a browser-specific string explaining the error. port read only an unsigned integer value giving the port number over which communication with the stun or turn server is taking place, using the ip address given in address. null if the connection hasn't been established (that is, if address is null). url read only a domstring indicating the url of the stun or turn server with which the error occurred. methods rtcpeerconnectioniceerrorevent has no methods other than any provided by the parent interface, event. examples tbd specifications specification status comment webrtc 1.0: real-time communication b...
...address is null). url read only a domstring indicating the url of the stun or turn server with which the error occurred. methods rtcpeerconnectioniceerrorevent has no methods other than any provided by the parent interface, event. examples tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceerrorevent' in that specification. candidate recommendation initial definition. ...
ResizeObserver.disconnect() - Web APIs
editor's draft initial definition. ...
... editor's draft initial definition. ...
... editor's draft initial definition. ...
... editor's draft initial definition. ...
SharedWorkerGlobalScope: connect event - Web APIs
the connect event is fired in shared workers at their sharedworkerglobalscope when a new client connects. bubbles no cancelable no interface messageevent event handler property sharedworkerglobalscope.onconnect examples this example shows a shared worker file — when a connection to the worker occurs from a main thread via a messageport, the onconnect event handler fires. the event object is a messageevent. the connecting port can be referenced through the event object's ports parameter; this reference can have an onmessage handler attached to it to handle messages coming in through the port, and its postmessage() method can be used to send messages back to the main thread using the worker. ...
...main thread via a messageport, the onconnect event handler fires. the event object is a messageevent. the connecting port can be referenced through the event object's ports parameter; this reference can have an onmessage handler attached to it to handle messages coming in through the port, and its postmessage() method can be used to send messages back to the main thread using the worker. ...
... living standard ...
... living standard ...
SharedWorkerGlobalScope.onconnect - Web APIs
the onconnect property of the sharedworkerglobalscope interface is an event handler representing the code to be called when the connect event is raised — that is, when a messageport connection is opened between the associated sharedworker and the main thread. syntax onconnect = function() { ... }; examples this example shows a shared worker file — when a connection to the worker occurs from a main thread via a messageport, the onconnect event handler fires. the event object is a messageevent. the connecting port can be referenced through the event object's ports parameter; this reference can have an onmessage handler attached to it to handle messages coming in through the port, and its postmessage() method can be used to send messages back to the main thread using the worker. ...
...om a main thread via a messageport, the onconnect event handler fires. the event object is a messageevent. the connecting port can be referenced through the event object's ports parameter; this reference can have an onmessage handler attached to it to handle messages coming in through the port, and its postmessage() method can be used to send messages back to the main thread using the worker. onconnect = function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } port.start(); } for a complete running example, see our basic shared worker example (run shared worker.) note: the data property of the event object used to be null in firefox. as of version 65 it is now i...
...erresult); } port.start(); } for a complete running example, see our basic shared worker example (run shared worker.) note: the data property of the event object used to be null in firefox. as of version 65 it is now initialized to an empty string, as per spec (bug 1508824). specifications specification status comment html living standardthe definition of 'onconnect' in that specification. living standard browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for...
...dard browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
Window: gamepaddisconnected event - Web APIs
the gamepaddisconnected event is fired when the browser detects that a gamepad has been disconnected. ...
... the gamepaddisconnected event is fired when the browser detects that a gamepad has been disconnected. ...
... the gamepaddisconnected event is fired when the browser detects that a gamepad has been disconnected. ...
... the gamepaddisconnected event is fired when the browser detects that a gamepad has been disconnected. ...
Connection - HTTP
the connection general header controls whether or not the network connection stays open after the current transaction finishes. if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done. connection-specific header fields such as connection and keep-alive are prohibited in http/2. chrome and firefox ignore them in http/2 responses, but safari conforms to the http/2 spec requirements and won’t load any response which contains them. ...
...ed, allowing for subsequent requests to the same server to be done. connection-specific header fields such as connection and keep-alive are prohibited in http/2. chrome and firefox ignore them in http/2 responses, but safari conforms to the http/2 spec requirements and won’t load any response which contains them. except for the standard hop-by-hop headers (keep-alive, transfer-encoding, te, connection, trailer, upgrade, proxy-authorization and proxy-authenticate), any hop-by-hop headers used by the message must be listed in the connection header, so that the first proxy knows it has to consume them and not forward them further. standard hop-by-hop headers can be listed too (it is often the case of keep-alive, but this is not mandatory). header type general header forbi...
...ion and proxy-authenticate), any hop-by-hop headers used by the message must be listed in the connection header, so that the first proxy knows it has to consume them and not forward them further. standard hop-by-hop headers can be listed too (it is often the case of keep-alive, but this is not mandatory). header type general header forbidden header name yes syntax connection: keep-alive connection: close directives close indicates that either the client or the server would like to close the connection. this is the default on http/1.0 requests. any comma-separated list of http headers [usually keep-alive only] indicates that the client would like to keep the connection open. having a persistent connection is the default on http/1.1 requests. the list of hea...
... connection. this is the default on http/1.0 requests. any comma-separated list of http headers [usually keep-alive only] indicates that the client would like to keep the connection open. having a persistent connection is the default on http/1.1 requests. the list of headers are the name of the header to be removed by the first non-transparent proxy or cache in-between: these headers define the connection between the emitter and the first entity, not the destination node. ...
CONNECT - HTTP
Web › HTTP › Methods › CONNECT
the http connect method starts two-way communications with the requested resource. it can be used to open a tunnel. for example, the connect method can be used to access websites that use ssl (https). the client asks an http proxy server to tunnel the tcp connection to the desired destination. the server then proceeds to make the connection on behalf of the client. once the connection has been established by the server, the proxy server continues to proxy the tcp stream to and from the client. connect is a hop-by-hop method. ...
...onnection on behalf of the client. once the connection has been established by the server, the proxy server continues to proxy the tcp stream to and from the client. connect is a hop-by-hop method. request has body no successful response has body yes safe no idempotent no cacheable no allowed in html forms no syntax connect www.example.com:443 http/1.1 example some proxy servers might need authority to create a tunnel. see also the proxy-authorization header. ...
...rom the client. connect is a hop-by-hop method. request has body no successful response has body yes safe no idempotent no cacheable no allowed in html forms no syntax connect www.example.com:443 http/1.1 example some proxy servers might need authority to create a tunnel. see also the proxy-authorization header. ...
... allowed in html forms no syntax connect www.example.com:443 http/1.1 example some proxy servers might need authority to create a tunnel. see also the proxy-authorization header. ...
PR_ConnectContinue
syntax #include <prio.h> prstatus pr_connectcontinue( prfiledesc *fd, print16 out_flags); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket. out_flags the out_flags field of the poll descriptor returned by pr_poll(). returns if the nonblocking connect has successfully completed, pr_connectcontinue returns pr_success. 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. descr...
...r_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. ...
...onnectcontinue 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_connectcontinue() sequence until the nonblocking connect has completed. ...
XPConnect
xpconnect is a bridge between javascript and xpcom. with xpconnect, you can use xpcom components from javascript code, and interact with javascript objects from within xpcom components. xpconnect is part of firefox and is actively used in xul applications. documentation architecture basics xpconnect, javascript, xpcom, xul... using components how to talk with xpcom components. xpconnect and xpidl faq a faq about using xpconnect and xpidl. this page needs to migrate to mdn. ...
... components. xpconnect is part of firefox and is actively used in xul applications. documentation architecture basics xpconnect, javascript, xpcom, xul... using components how to talk with xpcom components. xpconnect and xpidl faq a faq about using xpconnect and xpidl. this page needs to migrate to mdn. ...
...ox and is actively used in xul applications. documentation architecture basics xpconnect, javascript, xpcom, xul... using components how to talk with xpcom components. xpconnect and xpidl faq a faq about using xpconnect and xpidl. this page needs to migrate to mdn. ...
nsISpeculativeConnect
netwerk/base/public/nsispeculativeconnect.idlscriptable lets non-networking code provide hints to the networking layer that an http connection attempt to a particular site is likely to happen soon; this lets the networking layer begin setting up tcp and, if appropriate, ssl handshakes to save time when the connection is actually opened later. 1.0 66 introduced gecko 15.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) to use this service, simply call nsisupports.queryinterface() on the nsiioservice you plan to use for the connection, to get access to the i/o service's implementation of nsispeculativeconnect. ...
...n is actually opened later. 1.0 66 introduced gecko 15.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) to use this service, simply call nsisupports.queryinterface() on the nsiioservice you plan to use for the connection, to get access to the i/o service's implementation of nsispeculativeconnect. then call speculativeconnect() to let the networking layer know what you might be doing in the future. method overview void speculativeconnect(in nsiuri auri, in nsiinterfacerequestor acallbacks, in nsieventtarget atarget); methods speculativeconnect() call this method to hint to the networking layer that a new transaction for the specified uri is likely to happen soon. the code implementing this method may use this in...
... uri is likely to happen soon. the code implementing this method may use this information to start a tcp and/or ssl level handshake for that resource immediately so that it is ready (or at least in the process of becoming ready) when the transaction is actually submitted. no obligation is taken on by the implementer, nor is the submitter obligated to actually open the new channel. void speculativeconnect( in nsiuri auri, in nsiinterfacerequestor acallbacks, in nsieventtarget atarget ); parameters auri the uri of the hinted transaction. acallbacks any security callbacks for use with ssl for interfaces such as nsibadcertlistener. may be null. atarget the thread on which the release of the callbacks will occur. may be null for "any thread". see also nsiioservice blog post: making firefox s...
RTCPeerConnection.generateCertificate() - Web APIs
the generatecertificate() method of the rtcpeerconnection interface creates and stores an x.509 certificate and corresponding private key then returns an rtccertificate, providing access to it. syntax var cert = rtcpeerconnection.generatecertificate(keygenalgorithm) parameters keygenalgorithm a domstring identifying the algorithm to use in creating the key. rtcpeerconnection.generatecertificate() is a static method, so it is always called on the rtcpeerconnection interface itself, not an instance thereof. return value a reference to an rtccertificate object. ...
...syntax var cert = rtcpeerconnection.generatecertificate(keygenalgorithm) parameters keygenalgorithm a domstring identifying the algorithm to use in creating the key. rtcpeerconnection.generatecertificate() is a static method, so it is always called on the rtcpeerconnection interface itself, not an instance thereof. return value a reference to an rtccertificate object. ...
...rtificate() is a static method, so it is always called on the rtcpeerconnection interface itself, not an instance thereof. return value a reference to an rtccertificate object. example rtcpeerconnection.generatecertificate({ name: 'rsassa-pkcs1-v1_5', hash: 'sha-256', moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]) }).then(function(cert) { var pc = new rtcpeerconnection({certificates: [cert]}); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'generatecertificate()' in that specification. candidate recommendation initial definition. ...
RTCPeerConnection.getSenders() - Web APIs
the rtcpeerconnection method getsenders() returns an array of rtcrtpsender objects, each of which represents the rtp sender responsible for transmitting one track's data. a sender object provides methods and properties for examining and controlling the encoding and transmission of the track's data. syntax var senders = rtcpeerconnection.getsenders(); return value an array of rtcrtpsender objects, one for each track on the connection. the array is empty if there are no rtp senders on the connection. the order of the returned rtcrtpsenders is not defined by the specification, and may change from one call to getsenders() to the next. example in this example, a setmuting() function is shown. this function takes as input an rtcpeerconnection, pc, and a boolean, muting. the function gets the l...
...k on the connection. the array is empty if there are no rtp senders on the connection. the order of the returned rtcrtpsenders is not defined by the specification, and may change from one call to getsenders() to the next. example in this example, a setmuting() function is shown. this function takes as input an rtcpeerconnection, pc, and a boolean, muting. the function gets the list of the peer connection's senders and iterates over every sender, setting the corresponding media track's enabled to the inverse of the specified muting. function setmuting(pc, muting) { let senderlist = pc.getsenders(); senderlist.foreach(sender) { sender.track.enabled = !muting; } } specifications specification status comment webrtc 1.0: real-time communication between bro...
... every sender, setting the corresponding media track's enabled to the inverse of the specified muting. function setmuting(pc, muting) { let senderlist = pc.getsenders(); senderlist.foreach(sender) { sender.track.enabled = !muting; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.getsenders()' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.getStreamById() - Web APIs
the rtcpeerconnection.getstreambyid() method returns the mediastream with the given id that is associated with local or remote end of the connection. if no stream matches, it returns null. this property has been replaced with the rtcpeerconnection.getlocalstreams and rtcpeerconnection.getremotestreams properties. if you have code that uses stream, you will need to update, since browsers have begun to remove support for stream. syntax var mediastream = pc.getstream(id); parameters id is a domstring corresponding to the stream to return. ...
...ream, you will need to update, since browsers have begun to remove support for stream. syntax var mediastream = pc.getstream(id); parameters id is a domstring corresponding to the stream to return. ...
...domstring corresponding to the stream to return. example var stream = pc.getstreambyid(mytrackid); if (stream) { console.log("found stream: " + stream.id); } polyfill running the following code before any other code will create rtcpeerconnection.prototype.getstreambyid() if it's not natively available. ...
RTCPeerConnection.iceGatheringState - Web APIs
the read-only property rtcpeerconnection.icegatheringstate returns an enum of type rtcicegatheringstate that describes connection's ice gathering state. this lets you detect, for example, when collection of ice candidates has finished. you can detect when the value of this property changes by watching for an event of type icegatheringstatechange. syntax var state = rtcpeerconnection.icegatheringstate; 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. constan...
... 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 server, the state will revert to "gathering"...
... "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 server, the state will revert to "gathering" to gather those candidates. example var pc = new rtcpeerconnection(); var state = pc.icegatheringstate; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.icegatheringstate' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.localDescription - Web APIs
the read-only property rtcpeerconnection.localdescription returns an rtcsessiondescription describing the session for the local end of the connection. if it has not yet been set, this is null. syntax var sessiondescription = peerconnection.localdescription; on a more fundamental level, the returned value is the value of rtcpeerconnection.pendinglocaldescription if that property isn't null; otherwise, the value of rtcpeerconnection.currentlocaldescription 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 localdescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. ...
...inglocaldescription if that property isn't null; otherwise, the value of rtcpeerconnection.currentlocaldescription 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 localdescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. ...
...s type and sdp fields. var pc = new rtcpeerconnection(); … var sd = pc.localdescription; 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.localdescription' in that specification. candidate recommendation initial specification. ...
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 setremotedescription() 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 me...
...tion; 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 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.setremotedescription(); 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 v...
... ...
RTCPeerConnection.onicecandidate - Web APIs
the rtcpeerconnection property onicecandidate property is an eventhandler which specifies a function to be called when the icecandidate event occurs on an rtcpeerconnection instance. this happens whenever the local ice agent needs to deliver a message to the other peer through the signaling server. this lets the ice agent perform negotiation with the remote peer without the browser itself needing to know any specifics about the technology being used for signaling; simply implement this method to use whatever messaging technology you choose to send the ice candidate to the remote peer. syntax rtcpeerconnection.onicecandidate = eventhandler; value this should be set to a function which you provide that accepts as input an rtcpeerconnectioniceevent object representing the icecandidate event. t...
...you don't need to watch for this explicitly; instead, if you need to sense the end of signaling, you should watch for a icegatheringstatechange event indicating that the ice negotiation has transitioned to the complete state. ...
... candidate recommendation initial specification. ...
RTCPeerConnection.onidentityresult - Web APIs
an event handler always has one single parameter, containing the event, here of type rtcidentityevent. ...
...an event handler always has one single parameter, containing the event, here of type rtcidentityevent. ...
...an event handler always has one single parameter, containing the event, here of type rtcidentityevent. ...
RTCPeerConnection.onpeeridentity - Web APIs
an event handler always has one single parameter, containing the event, here of type event. ...
...an event handler always has one single parameter, containing the event, here of type event. ...
...an event handler always has one single parameter, containing the event, here of type event. ...
RTCPeerConnection.onremovestream - Web APIs
the removestream event has been removed from the webrtc specification in favor of the existing removetrack event on the remote mediastream and the corresponding mediastream.onremovetrack event handler property of the remote mediastream. the rtcpeerconnection api is now track-based, so having zero tracks in the remote stream is equivalent to the remote stream being removed and the old removestream event. ...
...nt has been removed from the webrtc specification in favor of the existing removetrack event on the remote mediastream and the corresponding mediastream.onremovetrack event handler property of the remote mediastream. the rtcpeerconnection api is now track-based, so having zero tracks in the remote stream is equivalent to the remote stream being removed and the old removestream event. the rtcpeerconnection.onremovestream event handler is a property containing the code to execute when the removestream event, of type mediastreamevent, is received by this rtcpeerconnection. ...
...i is now track-based, so having zero tracks in the remote stream is equivalent to the remote stream being removed and the old removestream event. the rtcpeerconnection.onremovestream event handler is a property containing the code to execute when the removestream event, of type mediastreamevent, is received by this rtcpeerconnection. such an event is sent when a mediastream is removed from this connection. syntax peerconnection.onremovestream = function; values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, here of type mediastreamevent. example pc.onremovestream = function(ev) { alert("onremovestream ev...
RTCPeerConnection.ontrack - Web APIs
the rtcpeerconnection property ontrack is an eventhandler which specifies a function to be called when the track event occurs, indicating that a track has been added to the rtcpeerconnection. the function receives as input the event object, of type rtctrackevent; this event is sent when a new incoming mediastreamtrack has been created and associated with an rtcrtpreceiver object which has been added to the set of receivers on connection. syntax rtcpeerconnection.ontrack = eventhandler; value set ontrack to be a function you provide that accepts as input a rtctrackevent object describing the new track and how it's being used. this information includes the mediastreamtrack object representing the new track, the rtcrtpreceiver and rtcrtptransceiver, and a list of mediastream objects which indi...
...accepts as input a rtctrackevent object describing the new track and how it's being used. this information includes the mediastreamtrack object representing the new track, the rtcrtpreceiver and rtcrtptransceiver, and a list of mediastream objects which indicates which stream or streams the track is part of.. example this example, taken from the code for the article signaling and video calling, connects the incoming track to the <video> element which will be used to display the incoming video. pc.ontrack = function(event) { document.getelementbyid("received_video").srcobject = event.streams[0]; document.getelementbyid("hangup-button").disabled = false; }; the first line of our ontrack event handler takes the first stream in the incoming track and sets the srcobject attribute to that. thi...
...the incoming track to the <video> element which will be used to display the incoming video. pc.ontrack = function(event) { document.getelementbyid("received_video").srcobject = event.streams[0]; document.getelementbyid("hangup-button").disabled = false; }; the first line of our ontrack event handler takes the first stream in the incoming track and sets the srcobject attribute to that. this connects that stream of video to the element so that it begins to be presented to the user. the second line of code simply enables a "hang up" button, which the user can use to disconnect from the call. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.ontrack' in that specification. candid...
RTCPeerConnection.sctp - Web APIs
the read-only sctp property on the rtcpeerconnection interface returns an rtcsctptransport describing the sctp transport over which sctp data is being sent and received. if sctp hasn't been negotiated, this value is null. the sctp transport is used for transmitting and receiving data for any and all rtcdatachannels on the peer connection. syntax var sctp = rtcpeerconnection.sctp; value a rtcsctptransport object describing the sctp transport being used by the rtcpeerconnection for transmitting and receiving on its data channels, or null if sctp negotiation hasn't happened. ...
...s null. the sctp transport is used for transmitting and receiving data for any and all rtcdatachannels on the peer connection. syntax var sctp = rtcpeerconnection.sctp; value a rtcsctptransport object describing the sctp transport being used by the rtcpeerconnection for transmitting and receiving on its data channels, or null if sctp negotiation hasn't happened. ...
... candidate recommendation initial specification. ...
RTCPeerConnectionIceEvent() - Web APIs
if null, the event indicates the end of candidate gathering. "url" (optional, default is null): the url of the stun or turn server which was used to gather the candidate. if the candidate was not gathered by a stun or turn server, this value must be null. ...
... if null, the event indicates the end of candidate gathering. "url" (optional, default is null): the url of the stun or turn server which was used to gather the candidate. if the candidate was not gathered by a stun or turn server, this value must be null. ...
...the candidate was not gathered by a stun or turn server, this value must be null. "bubbles" (optional, default is false): inherited from eventinit(), this boolean option indicates whether or not the event must bubble. "cancelable" (optional, default is false, inherited from eventinit(), this boolean indicates whether or not the event can be canceled. return value a newly-created rtcpeerconnectioniceevent, configured as specified in the provided options. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceevent()' in that specification. candidate recommendation initial definition. ...
RTCPeerConnectionIceEvent - Web APIs
the rtcpeerconnectioniceevent interface represents events that occurs in relation to ice candidates with the target, usually an rtcpeerconnection. only one event is of this type: icecandidate. properties a rtcpeerconnectioniceevent being an event, this event also implements these properties. rtcpeerconnectioniceevent.candidate read only contains the rtcicecandidate containing the candidate associated with the event, or null if this event indicates that there are no further candidates to come. constructors rtcpeerconnectioniceevent() returns a new rtcpeerconnectioniceevent. it takes two parameters, the first being a domstring representing the type of the event; the second a dictionary containing the rtcicecandidate it refers to. ...
...ate containing the candidate associated with the event, or null if this event indicates that there are no further candidates to come. constructors rtcpeerconnectioniceevent() returns a new rtcpeerconnectioniceevent. it takes two parameters, the first being a domstring representing the type of the event; the second a dictionary containing the rtcicecandidate it refers to. methods a rtcpeerconnectioniceevent being an event, this event also implements these properties. there is no specific rtcdatachannelevent method. ...
...e type of the event; the second a dictionary containing the rtcicecandidate it refers to. methods a rtcpeerconnectioniceevent being an event, this event also implements these properties. there is no specific rtcdatachannelevent method. examples pc.onicecandidate = function( ev ) { alert("the ice candidate (transport address: '" + ev.candidate.candidate + "') has been added to this connection."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceevent' in that specification. candidate recommendation initial definition. ...
Window: gamepadconnected event - Web APIs
the gamepadconnected event is fired when the browser detects that a gamepad has been connected or the first time a button/axis of the gamepad is used. ...
... the gamepadconnected event is fired when the browser detects that a gamepad has been connected or the first time a button/axis of the gamepad is used. ...
... the gamepadconnected event is fired when the browser detects that a gamepad has been connected or the first time a button/axis of the gamepad is used. ...
PR_GetConnectStatus
get the completion status of a nonblocking connection. syntax prstatus pr_getconnectstatus(const prpolldesc *pd); parameter the function has the following parameter: pd a pointer to a prpolldesc satructure whose fd field is the socket and whose in_flags field 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. ...
...l_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_QueueJob_Connect
fn the function to be executed when the job is executed. arg a pointer to an argument passed to fn. joinable if pr_true, the job is joinable. if pr_false, the job is not joinable. see pr_joinjob. ...
... fn the function to be executed when the job is executed. arg a pointer to an argument passed to fn. joinable if pr_true, the job is joinable. if pr_false, the job is not joinable. see pr_joinjob. returns pointer to a prjob structure or null on error. ...
Fun With XBL and XPConnect
once the regular xul textfield widget is bound to this interface, it calls the auto complete function of the object using regular javascript. the basic model of interaction is as follows: binding to the xpcom object the widget holds onto an xpcom object that is the auto complete engine that will perform our auto complete lookups. ...
.../> </content> <implementation> <property name="autocompletesession"> <![cdata[ components.classes['component://netscape/messenger/autocomplete&type=addrbook']. getservice(components.interfaces.nsiautocompletesession); ]]> </property> so we've defined a property on the widget called autocompletesession. the initial value of this property evaluates to an xp-connect object. now accesses to autocompletesession will return the xp-connect object. exposing the xpcom interfaces one somewhat nasty trick you need to do is to manually expose the interfaces of the xpcom object that you want your widget to support. all you have to do is specifically defining a method on the xbl widget which forwards the method call to the xpcom object. <method name="autocomplet...
MutationObserver.disconnect() - Web APIs
the mutationobserver method disconnect() tells the observer to stop watching for mutations. the observer can be reused by calling its observe() method again. syntax mutationobserver.disconnect() parameters none. return value undefined. note: all notifications of mutations that have already been detected, but not yet reported to the observer, are discarded. usage notes if the element being observed is removed from the dom, and then subsequently released by the browser's garbage collection mechanism, the mutationobserver is likewise deleted. example this example creates an observer, then disconnects from it, leaving it available for possible reuse. const targetnode = document.queryselector("#someelement"); const observeroptions = { childlist: true, attributes: true } const o...
...erver is likewise deleted. example this example creates an observer, then disconnects from it, leaving it available for possible reuse. const targetnode = document.queryselector("#someelement"); const observeroptions = { childlist: true, attributes: true } const observer = new mutationobserver(callback); observer.observe(targetnode, observeroptions); /* some time later... */ observer.disconnect(); specifications specification status comment domthe definition of 'mutationobserver.disconnect()' in that specification. living standard ...
PeformanceObserver.disconnect() - Web APIs
the disconnect() method of the performanceobserver interface is used to stop the performance observer from receiving any performance entry events. syntax performanceobserver.disconnect(); example var observer = new performanceobserver(function(list, obj) { var entries = list.getentries(); for (var i=0; i < entries.length; i++) { // process "mark" and "frame" events } }); observer.observe({entrytypes: ["mark", "frame"]}); function perf_observer(list, observer) { // process the "measure" event // ... ...
...nnect(); example var observer = new performanceobserver(function(list, obj) { var entries = list.getentries(); for (var i=0; i < entries.length; i++) { // process "mark" and "frame" events } }); observer.observe({entrytypes: ["mark", "frame"]}); function perf_observer(list, observer) { // process the "measure" event // ... // disable additional performance events observer.disconnect(); } var observer2 = new performanceobserver(perf_observer); observer2.observe({entrytypes: ["measure"]}); specifications specification status comment performance timeline level 2the definition of 'disconnect()' in that specification. candidate recommendation initial definition of disconnect() method. ...
PerformanceTiming.connectEnd - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the performancenavigationtiming interface instead. the legacy performancetiming.connectend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the connection is opened network. if the transport layer reports an error and the connection establishment is started again, the last connection establisment end time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. ...
...nectend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the connection is opened network. if the transport layer reports an error and the connection establishment is started again, the last connection establisment end time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. a connection is considered as opened when all secure connection handshake, or socks authentication, is terminated. syntax time = performancetiming.connectend; specifications specification status comment navigation timingthe definition of 'performancetiming.connectend' in that specification. recommendation initial definition. ...
PerformanceTiming.connectStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the performancenavigationtiming interface instead. the legacy performancetiming.connectstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the request to open a connection is sent to the network. if the transport layer reports an error and the connection establishment is started again, the last connection establisment start time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. ...
...representing the moment, in miliseconds since the unix epoch, where the request to open a connection is sent to the network. if the transport layer reports an error and the connection establishment is started again, the last connection establisment start time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. syntax time = performancetiming.connectstart; specifications specification status comment navigation timingthe definition of 'performancetiming.connectstart' in that specification. recommendation initial definition. ...
RTCPeerConnection: addstream event - Web APIs
the obsolete addstream event is sent to an rtcpeerconnection when new media, in the form of a mediastream object, has been added to it. important: this event has been removed from the webrtc specification. you should instead watch for the track event, which is sent for each media track added to the rtcpeerconnection. bubbles no cancelable no interface mediastreamevent event handler property rtcpeerconnection.onaddstream you can, similarly, watch for streams to be removed from the connection by monitoring the removestream event. examples this example looks to determine if the user's browser supports the track event. ...
...diastreamevent event handler property rtcpeerconnection.onaddstream you can, similarly, watch for streams to be removed from the connection by monitoring the removestream event. examples this example looks to determine if the user's browser supports the track event. if it does, a track event listener is set up; otherwise, an addstream event listener is set up. pc is an rtcpeerconnection. if (pc.addtrack !== undefined) { pc.ontrack = ev => { ev.streams.foreach(stream => doaddstream(stream)); } } else { pc.onaddstream = ev => { doaddstream(ev.stream); } } this calls a function doaddstream() once for each stream being added to the rtcpeerconnection, regardless of whether the browser sends addstream or track. you can also use the addeventlistener() method to s...
RTCPeerConnection: datachannel event - Web APIs
bubbles no cancelable no interface rtcdatachannelevent event handler property ondatachannel examples this example sets up a function that handles datachannel events by gathering the information needed to communicate with the newly added rtcdatachannel and by adding event handlers for the events that occur on that channel. ...
...receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; }, false); receivechannel is set to the value of the event's channel property, which specifies the rtcdatachannel object representing the data channel linking the remote peer to the local one. ...
RTCPeerConnection.getDefaultIceServers() - Web APIs
the getdefaulticeservers() method of the rtcpeerconnection interface returns an array of objects based on the rtciceserver dictionary, which indicates what, if any, ice servers the browser will use by default if none are provided to the rtcpeerconnection in its rtcconfiguration. however, browsers are not required to provide any default ice servers at all. syntax var defaulticeservers = rtcpeerconnection.getdefaulticeservers(); return value an array of ice servers, specified as objects based on rtciceserver, which the browser will use if none are specified in the configuration of the rtcpeerconnection. if there are no defaults provided by the browser, the returned array is empty; this property's value is never null. ...
...yntax var defaulticeservers = rtcpeerconnection.getdefaulticeservers(); return value an array of ice servers, specified as objects based on rtciceserver, which the browser will use if none are specified in the configuration of the rtcpeerconnection. if there are no defaults provided by the browser, the returned array is empty; this property's value is never null. ...
RTCPeerConnection.getReceivers() - Web APIs
the rtcpeerconnection.getreceivers() method returns an array of rtcrtpreceiver objects, each of which represents one rtp receiver. each rtp receiver manages the reception and decoding of data for a mediastreamtrack on an rtcpeerconnection syntax var receivers = rtcpeerconnection.getreceivers(); return value an array of rtcrtpreceiver objects, one for each track on the connection. the array is empty if there are no rtp receivers on the connection. the order of the returned rtcrtpreceiver instances is not defined by the specification, and may change from one call to getreceivers() to the next. ...
... candidate recommendation initial specification. ...
RTCPeerConnection.ondatachannel - Web APIs
the rtcpeerconnection.ondatachannel property is an eventhandler which specifies a function which is called when the datachannel event occurs on an rtcpeerconnection. this event, of type rtcdatachannelevent, is sent when an rtcdatachannel is added to the connection by the remote peer calling createdatachannel(). at the time this event is received, the rtcdatachannel it indicates may not yet actually be open. be sure to wait for the "open" event to be fired on the new rtcdatachannel before using it. syntax rtcpeerconnection.ondatachannel = function; value set this property to be a function you provide which receives as input a single parameter: an rtcdatachannelevent which provides in its channel property the rtcdatachannel which has been created. example pc.ondatachannel = function(ev) ...
...l property the rtcdatachannel which has been created. example pc.ondatachannel = function(ev) { console.log('data channel is created!'); ev.channel.onopen = function() { console.log('data channel is open and ready to be used.'); }; }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.ondatachannel' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.onicegatheringstatechange - Web APIs
the rtcpeerconnection.onicegatheringstatechange property is an eventhandler which specifies a function to be called when the icegatheringstatechange event is sent to an rtcpeerconnection instance. this happens when the ice gathering state—that is, whether or not the ice agent is actively gathering candidates—changes. you don't need to watch for this event unless you have specific reasons to want to closely monitor the state of ice gathering. syntax rtcpeerconnection.onicegatheringstatechange = eventhandler; value a function you provide which is passed a single parameter: an event object containing the icegatheringstatechange event. you can determine the new state of ice gathering by looking at the value of the rtcpeerconnection.icegatheringstate property. example this example updat...
... candidate recommendation initial specification. ...
RTCPeerConnection: removestream event - Web APIs
the obsolete removestream event was sent to an rtcpeerconnection to inform it that a mediastream had been removed from the connection. you can use the rtcpeerconnection interface's onremovestream property to set a handler for this event. this is the counterpart to the addstream event, which is also obsolete. bubbles no cancelable no interface mediastreamevent event handler property rtcpeerconnection.onremovestream important: this event has been removed from the webrtc specification in favor of the existing removetrack event on the remote mediastream and the corresponding mediastream.onremovetrack event handler property of the remote mediastream. ...
...bbles no cancelable no interface mediastreamevent event handler property rtcpeerconnection.onremovestream important: this event has been removed from the webrtc specification in favor of the existing removetrack event on the remote mediastream and the corresponding mediastream.onremovetrack event handler property of the remote mediastream. the rtcpeerconnection api is now track-based, so having zero tracks in the remote stream is equivalent to the remote stream being removed, which caused a removestream event. ...
RTCPeerConnection.setIdentityProvider() - Web APIs
the idp will be used only when an assertion is needed. if the signalingstate is set to "closed", an invalidstateerror is raised. syntax pc.setidentityprovider(domainname [, protocol] [, username]); there is no return value for this method. parameters domainname is a domstring is the domain name where the idp is. protocol optional is a domstring representing the protocol used to communicate with the idp. it defaults to "default" and is used to determine the url where the idp is listening. ...
...rn value for this method. parameters domainname is a domstring is the domain name where the idp is. protocol optional is a domstring representing the protocol used to communicate with the idp. it defaults to "default" and is used to determine the url where the idp is listening. username optional is a domstring representing the username associated with the idp. example var pc = new peerconnection(); pc.setidentityassertion("developer.mozilla.org"); specifications specification status comment identity for webrtcthe definition of 'rtcpeerconnection.setidentityprovider()' in that specification. candidate recommendation ...
RTCPeerConnection: track event - Web APIs
the track event is sent to the ontrack event handler on rtcpeerconnections after a new track has been added to an rtcrtpreceiver which is part of the connection. bubbles yes cancelable no interface rtctrackevent event handler property ontrack by the time this event is delivered, the new track has been fully added to the peer connection. see track event types in rtctrackevent for details. examples this example shows code that creates a new rtcpeerconnection, then adds a new track event handler. ...
...bbles yes cancelable no interface rtctrackevent event handler property ontrack by the time this event is delivered, the new track has been fully added to the peer connection. see track event types in rtctrackevent for details. examples this example shows code that creates a new rtcpeerconnection, then adds a new track event handler. ...
ReportingObserver.disconnect() - Web APIs
the disconnect() method of the reportingobserver interface stops a reporting observer that had previously started observing from collecting reports. after calling disconnect(), neither reportingobserver.takerecords() nor the records parameter of the reportingobserver() callback will return any reports. the associated observer will no longer be active. syntax reportingobserverinstance.disconnect() examples let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); observer.observe() ... ...
...he reportingobserver() callback will return any reports. the associated observer will no longer be active. syntax reportingobserverinstance.disconnect() examples let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); observer.observe() ... observer.disconnect() specifications specification status comment reporting apithe definition of 'reportingobserver.disconnect()' in that specification. editor's draft ...
Connecting to Remote Content - Archive of obsolete content
"start tamper" button, for every request made you will get a popup dialog for tampering with it before it is sent. you can use it to view or even modify the data in a request, and then inspect the result. this can be a lot of work because there is a lot of web activity in a normal firefox window, so use it sparingly. a tutorial on tamper data can be found here. note: you should always test your connection code to cover edge cases, like when there is no internet connection, or the computer is connected to a local network with no internet access (like at an airport or hotel room). make sure you're not telling users everything is ok, or worse, bombarding them with error messages. « previousnext » this tutorial was kindly donated to mozilla by appcoast. ...
BlackConnect - Archive of obsolete content
blackconnect was a blackwood subproject, trying to build a java-to-xpcom bridge to allow interoperability between java and xpcom components. the goal was to be able to implement xpcom components written in java instead of c++. blackconnect is now superseeded by javaxpcom. for the remainders of the blackconnect project, see here. ...
LiveConnect Reference - Archive of obsolete content
javascript-to-java these classes allow a java object to access javascript code. jsexception the public class jsexception extends runtimeexception, and is thrown when javascript returns an error. jsobject the public class jsobject extends object. javascript objects are wrapped in an instance of the class jsobject and passed to java, allowing java to manipulate javascript objects. ...
How to investigate Disconnect failures
this article will guide you on how to investigate disconnect failures. an example of such a failure disconnect failures happens when one side is closing the connection and mozmill is unable to send the information over the bridge or when firefox crashes. usually disconnects happens when a modal dialog freezes and we cannot close it sp we close firefox with the modal frozen. we cannot investigate failures via mozmill, because we do not catch the crashes, so the crashes' information is not logged; we have to go to ci machines and investigate directly. check if firefox crashed: windows: [user]/appdata\roaming\mozilla\firefox\crash reports ubuntu: [user/home]/.mozilla/firefox/crash reports and there we can check by timestamp if firefox crashed when we had the disconnect. check...
connectGATT() - Web APIs
the bluetoothdevice.connectgatt() method returns a promise that resolves to an instance of bluetoothgattremoteserver. syntax instanceofbluetoothdevice.connectgatt().then(function(bluetoothgattremoteserver) { ... }) returns a promise that resolves to an instance of bluetoothgattremoteserver. parameters none. ...
BluetoothRemoteGATTServer.connect() - Web APIs
the bluetoothremotegattserver.connect() method causes the script execution environment to connect to this.device. syntax bluetoothremotegattserver.connect() .then(function(bluetoothremotegattserver) { ... }) returns a promise that resolves to a bluetoothremotegattserver. parameters none. specifications specification status comment web bluetooththe definition of 'connect()' in that specification. draft initial definition. ...
BluetoothRemoteGATTServer.connected - Web APIs
the bluetoothremotegattserver.connected read-only property returns a boolean value that returns true while this script execution environment is connected to this.device. it can be false while the user agent is physically connected. syntax var connected = bluetoothremotegattserver.connected specifications specification status comment web bluetooththe definition of 'connected' in that specification. draft initial definition. ...
BluetoothRemoteGATTServer.disconnect() - Web APIs
the bluetoothremotegattserver.disconnect() method causes the script execution environment to disconnect from this.device. syntax bluetoothremotegattserver.disconnect() returns none. parameters none. specifications specification status comment web bluetooththe definition of 'disconnect()' in that specification. draft initial definition. ...
Gamepad.connected - Web APIs
Web › API › Gamepad › connected
the gamepad.connected property of the gamepad interface returns a boolean indicating whether the gamepad is still connected to the system. if the gamepad is connected, the value is true; if not, it is false. syntax readonly attribute boolean connected; example var gp = navigator.getgamepads()[0]; console.log(gp.connected); value a boolean. specifications specification status comment gamepadthe definition of 'gamepad.connected' in that specification. working draft initial definition ...
IntersectionObserver.disconnect() - Web APIs
the intersectionobserver method disconnect() stops watching all of its target elements for visibility changes. syntax intersectionobserver.disconnect(); parameters none. return value undefined. specifications specification status comment intersection observerthe definition of 'intersectionobserver.disconnect()' in that specification. working draft initial definition. ...
MIDIConnectionEvent - Web APIs
the midiconnectionevent interface of the web midi api is the event passed to the onstatechange event handler of the midiaccess interface and the onstatechange event of the midiports interface. this occurs any time a new port becomes available, or when a previously available port becomes unavailable. for example, this event is fired whenever a midi device is either plugged in to or unplugged from a computer. constructor midiconnectionevent.midiconnectionevent creates a new midiconnectionevent object. properties midiconnectionevent.port returns a reference to a midiport instance for a port that has been connected or disconnected." examples specifications specification status comment web midi api working draft initial definition. ...
Navigator.connection - Web APIs
the navigator.connection read-only property returns a networkinformation object containing information about the system's connection, such as the current bandwidth of the user's device or whether the connection is metered. this could be used to select high definition content or low definition content based on the user's connection. syntax networkinformation = navigator.connection value a networkinformation object. specifications specification status comment network information apithe definition of 'navigator.connection' in that specification. draft initial specification ...
PerformanceTiming.secureConnectionStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the performancenavigationtiming interface instead. the legacy performancetiming.secureconnectionstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the secure connection handshake starts. if no such connection is requested, it returns 0. syntax time = performancetiming.secureconnectionstart; specifications specification status comment navigation timingthe definition of 'performancetiming.secureconnectionstart' in that specification. recommendation initial definition. ...
RTCPeerConnection.getIdentityAssertion() - Web APIs
the rtcpeerconnection.getidentityassertion() method initiates the gathering of an identity assertion. this has an effect only if the signalingstate is not "closed". the method returns immediately. if the assertion cannot be generated, an idpassertionerror will be sent to the object. it is not expected for the application dealing with the rtcpeerconnection: this is automatically done; an explicit call only allows to anticipate the need. syntax pc.getidentityassertion(); there is neither parameter nor return value for this method. example var pc = new peerconnection(); pc.getidentityassertion(); // not mandatory, but we know that we will need it in the future. specifications specification status comment identity for webrtcthe definition of 'rtcpeerconne...
RTCPeerConnection.getTransceivers() - Web APIs
the rtcpeerconnection interface's gettransceivers() method returns a list of the rtcrtptransceiver objects being used to send and receive data on the connection. syntax transceiverlist = rtcpeerconnection.gettransceivers(); parameters none. return value an array of the rtcrtptransceiver objects representing the transceivers handling sending and receiving all media on the rtcpeerconnection. the list is in the order in which the transceivers were added to the connection. example the following snippet of code stops all transceivers associated with an rtcpeerconnection. pc.gettransceivers().foreach(transceiver => { transceiver.stop(); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeercon...
RTCPeerConnection: identityresult event - Web APIs
note: while older versions of the webrtc specification used events to report assertions, this has been deprecated and removed from the specification. instead, the peeridentity property returns a promise that resolves with an identity or rejects if an error occurs or if unable to validate the identity. ...
RTCPeerConnection: idpassertionerror event - Web APIs
an idpassertionerror event informs the target, a rtcpeerconnection object, that the identity provider (idp) encountered an error when trying to generate an identity assertion. an event handler for this event can be added using the rtcpeerconnection.onidpassertionerror property. bubbles no cancelable no interface rtcidentityerrorevent event handler property onidpassertionerror warning: this event is no longer used; instead, you can detect an assertion error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'idpassertionerror' in that specification. candidate rec...
RTCPeerConnection: idpvalidationerror event - Web APIs
an idpvalidationerror event informs the target, a rtcpeerconnection object's onidpvalidationerror event handler, that the identity provider (idp) encountered an error while validating an identity assertion. an event handler for this event can be added using the rtcpeerconnection.onidpvalidationerror property. bubbles no cancelable no interface rtcidentityerrorevent event handler property onidpvalidationerror warning: this event is no longer used; instead, you can detect a validation error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'idpvalidationerror' in th...
RTCPeerConnection.onidpassertionerror - Web APIs
the rtcpeerconnection.onidpassertionerror event handler is a property containing the code to execute whent the idpassertionerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection. such an event is sent when the associated identity provider (idp) encounters an error while generating an identity assertion. this event handler is deprecated. you should instead detect idp assertion errors by handling rejection of the promise returned by rtcpeerconnection.peeridentity. syntax peerconnection.onidpassertionerror = function; values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, here of ty...
RTCPeerConnection.onidpvalidationerror - Web APIs
the rtcpeerconnection.onidpvalidationerror event handler is a property containing the code to execute whent the idpvalidationerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection. such an event is sent when the associated identity provider (idp) encounters an error while validating an identity assertion. this event handler is obsolete. you should instead detect idp validation errors by watching for the promise returned by rtcpeerconnection.peeridentity to be rejected. syntax peerconnection.onidpvalidationerror = function; values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, he...
RTCPeerConnection: signalingstatechange event - Web APIs
an signalingstatechange event is sent to an rtcpeerconnection to notify it that its signaling state, as indicated by the signalingstate property, has changed. bubbles no cancelable no interface event event handler property rtcpeerconnection.onsignalingstatechange examples given an rtcpeerconnection, pc, and an updatestatus() function that presents status information to the user, this code sets up an event handler to let the user know when the ice negotiation process finishes up. pc.addeventlistener("signalingstatechange", ev => { switch(pc.signalingstate) { case "stable": updatestatus("ice negotiation complete"); break; } }, false); using onsignalingstatechange, it looks like this: pc.onsignalingstatechange = ev => ...
RTCPeerConnectionIceEvent.candidate - Web APIs
the read-only candidate property of the rtcpeerconnectioniceevent interface returns the rtcicecandidate associated with the event. syntax var candidate = event.candidate; value an rtcicecandidate object representing the ice candidate that has been received, or null to indicate that there are no further candidates for this negotiation session. example pc.onicecandidate = function( ev ) { alert("the ice candidate (transport address: '" + ev.candidate.candidate + "') has been added to this connection."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceevent.candidate' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection: idpvalidationerror event - Web APIs
an idpvalidationerror event informs the target, a rtcpeerconnection object, that the identity provider (idp) encountered an error when trying to validate an identity assertion. an event handler for this event can be added via the rtcpeerconnection.onidpvalidationerror property. bubbles no cancelable no interface rtcidentityerrorevent event handler property onidpvalidationerror important: this event is no longer used; it was removed from the specification long ago. instead, you should watch for the rtcpeerconnection.peeridentity promise to be rejected with an operationerror. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'idpvalidationerror' in t...
USB.onconnect - Web APIs
Web › API › USB › onconnect
the onconnect property of the usb interface is an event handler called whenever a paired device is connected. syntax usb.onconnect = connectfunction specifications specification status comment webusbthe definition of 'onconnect' in that specification. draft initial definition. ...
USB.ondisconnect - Web APIs
Web › API › USB › ondisconnect
the ondisconnect property of the usb is an event handler called whenever a paired device is disconnected. syntax usb.ondisconnect = disconnectfunction specifications specification status comment webusbthe definition of 'ondisconnect' in that specification. draft initial definition. ...
Window.ongamepadconnected - Web APIs
the ongamepadconnected property of the window interface represents an event handler that will run when a gamepad is connected (when the gamepadconnected event fires). the event object is of type gamepadevent. syntax window.ongamepadconnected = function() { ... }; examples window.ongamepadconnected = function(event) { // all buttons and axes values can be accessed through event.gamepad; }; specifications specification status comment gamepadthe definition of 'gamepadconnected event' in that specification. working draft initial definition ...
Window.ongamepaddisconnected - Web APIs
the ongamepaddisconnected property of the window interface represents an event handler that will run when a gamepad is disconnected (when the gamepaddisconnected event fires). the event object is of type gamepadevent. syntax window.ongamepaddisconnected = function() { ... }; examples window.ongamepaddisconnected = function() { // a gamepad has been disconnected }; specifications specification status comment gamepadthe definition of 'gamepaddisconnected event' in that specification. working draft initial definition ...
WorkerNavigator.connection - Web APIs
the workernavigator.connection read-only property returns a networkinformation object containing information about the system's connection, such as the current bandwidth of the user's device or whether the connection is metered. this could be used to select high definition content or low definition content based on the user's connection. syntax connectioninfo = self.navigator.connection specifications specification status comment network information apithe definition of 'navigator.connection' in that specification. draft initial specification ...
Link types: preconnect - HTML: Hypertext Markup Language
the preconnect keyword for the rel attribute of the <link> element is a hint to browsers that the user is likely to need resources from the target resource's origin, and therefore the browser can likely improve the user experience by preemptively initiating a connection to that origin. specifications specification status comment html living standardthe definition of 'preconnect' in that specification. living standard ...
Index - Web APIs
Web › API › Index
api, audiocontext, method, reference, référence(2), web audio api, createmediastreamdestination the mediastream is created when the node is created and is accessible via the mediastreamaudiodestinationnode's stream attribute. this stream can be used in a similar way as a mediastream obtained via navigator.getusermedia — it can, for example, be sent to a remote peer using the rtcpeerconnection addstream() method. 129 audiocontext.createmediastreamsource() api, audio, audiocontext, audionode, media, mediastream, mediastreamtrack, method, reference, web, web audio, web audio api, createmediastreamsource for more details about media stream audio source nodes, check out the mediastreamaudiosourcenode reference page. 130 audiocontext.createmediastreamtrack...
...ence, web audio api the audionode interface is a generic interface for representing an audio processing module. examples include: 157 audionode.channelcount api, audionode, property, reference, web audio api, channelcount the channelcount property of the audionode interface represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. 158 audionode.channelcountmode api, audionode, property, reference, web audio api, channelcountmode the possible values of channelcountmode and their meanings are: 159 audionode.channelinterpretation api, audionode, property, reference, web audio api, channelinterpretation when the number of channels doesn't match between an...
... 159 audionode.channelinterpretation api, audionode, property, reference, web audio api, channelinterpretation when the number of channels doesn't match between an input and an output, up- or down-mixing happens according the following rules. this can be somewhat controlled by setting the audionode.channelinterpretation property to speakers or discrete: 160 audionode.connect() api, audio, audionode, media, method, reference, web audio api, connect if the destination is a node, connect() returns a reference to the destination audionode object, allowing you to chain multiple connect() calls. in some browsers, older implementations of this interface return undefined. 161 audionode.context api, audionode, context, property, reference, web audio a...
...And 295 more matches
Signaling and video calling - Web APIs
through this third server, the two devices can locate one another, and exchange negotiation messages. ...
...rial will guide you through building a two-way video-call. webrtc is a fully peer-to-peer technology for the real-time exchange of audio, video, and data, with one central caveat. a form of discovery and media format negotiation must take place, as discussed elsewhere, in order for two devices on different networks to locate one another. this process is called signaling and involves both devices connecting to a third, mutually agreed-upon server. through this third server, the two devices can locate one another, and exchange negotiation messages. in this article, we will further enhance the websocket chat first created as part of our websocket documentation (this article link is forthcoming; it isn't actually online yet) to support opening a two-way video call between users. you can try out thi...
...umentation (this article link is forthcoming; it isn't actually online yet) to support opening a two-way video call between users. you can try out this example on glitch, and you can remix the example to experiment with it as well. you can also look at the full project on github. ...
...And 85 more matches
Index
Mozilla › Tech › XPCOM › Index
sions (firefox 2 and 3, for example). 6 creating a python xpcom component guide, needshelp, pyxpcom, xpcom, xpcom:language bindings creating applications with mozilla already provides a tutorial for making a simple javascript or c++ component (implementing the nsisimple interface). here is how to make the same component in python using pyxpcom. ...
...creating a python xpcom component guide, needshelp, pyxpcom, xpcom, xpcom:language bindings creating applications with mozilla already provides a tutorial for making a simple javascript or c++ component (implementing the nsisimple interface). here is how to make the same component in python using pyxpcom. 7 fun with xbl and xpconnect xbl, xpcom, xpcom:language bindings, xpconnect no summary! 8 generating guids add-ons, developing mozilla, developing_mozilla:tools, extensions, tools, xpcom guids are used in mozilla programming for identifying several types of entities, including xpcom interfaces (this type of guids is callled iid), components (cid), and legacy add-ons—like extensions and themes—that were created prior to firefox 1.5. add-ons ...
...bedding, landing, mozilla, xpcom, xpcom:language bindings an xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings. ...
...And 47 more matches
Using DTMF with WebRTC - Web APIs
the dtmf system is often referred to as "touch tone," after an old trade name for the system. webrtc doesn't send dtmf codes as audio data. instead, they're sent out-of-band, as rtp payloads. note, however, that although it's possible to send dtmf using webrtc, there is currently no way to detect or receive incoming dtmf. ...
... teleconferencing systems menu systems voicemail systems entry of credit card or other payment information passcode entry note: while the dtmf is not sent to the remote peer as audio, browsers may choose to play the corresponding tone to the local user as part of their user experience, since users are typically used to hearing their phone play the tones audibly. sending dtmf on an rtcpeerconnection a given rtcpeerconnection can have multiple media tracks sent or received on it. when you wish to transmit dtmf signals, you first need to decide which track to send them on, since dtmf is sent as a series of out-of-band payloads on the rtcrtpsender responsible for transmitting that track's data to the other peer. once the track is selected, you can obtain from its rtcrtpsender the rtcdtmfse...
...ther peer. once the track is selected, you can obtain from its rtcrtpsender the rtcdtmfsender object you'll use for sending dtmf. from there, you can simply call rtcdtmfsender.insertdtmf() to enqueue dtmf signals to be sent on the track to the other peer. the rtcrtpsender will then send the tones to the other peer as packets alongside the track's audio data. each time a tone is sent, the rtcpeerconnection receives a tonechange event with a tone property specifying which tone finished playing, which is an opportunity to update interface elements, for example. when the tone buffer is empty, indicating that all the tones have been sent, a tonechange event with its tone property set to "" (an empty string) is delivered to the connection object. if you'd like to know more about how this works, read...
...And 42 more matches
sslfnc.html
be an ssl session and will not have certificate-based authentication, tamper detection, or encryption. ssl_request_certificate is a server option that requests a client to authenticate itself. ssl_require_certificate is a server option that requires a client to authenticate itself (only if ssl_request_certificate is also on). if client does not provide certificate, the connection terminates. default state is a third state similar to on, that provides backward compatibility with older netscape server products. ssl_handshake_as_client controls the behavior of pr_accept,. if this option is off, the pr_accept configures the ssl socket to handshake as a server. if it is on, then pr_accept configures the ssl socket to handshake as a client, even though it accept...
...minates. default state is a third state similar to on, that provides backward compatibility with older netscape server products. ssl_handshake_as_client controls the behavior of pr_accept,. if this option is off, the pr_accept configures the ssl socket to handshake as a server. if it is on, then pr_accept configures the ssl socket to handshake as a client, even though it accepted the connection as a tcp server. ssl_handshake_as_server controls the behavior of pr_connect. if this option is off, then pr_connect configures the ssl socket to handshake as a client. if it is on, then pr_connect configures the ssl socket to handshake as a server, even though it connected as a tcp client. ssl_enable_fdx tells the ssl library whether the application will have two thr...
...rites should set this to pr_true. in nss 2.8, the ssl_enable_fdx option only affects the behavior of non-blocking ssl sockets. see the description below for more information on this option. ssl_enable_ssl3 enables the application to communicate with ssl v3. factory setting is on. if you turn this option off, an attempt to establish a connection with a peer that only understands ssl v3 will fail. ssl_enable_ssl2 enables the application to communicate with ssl v2. factory setting is on. if you turn this option off, an attempt to establish a connection with a peer that only understands ssl v2 will fail. ssl_enable_tls is a peer of the ssl_enable_ssl2 and ssl_enable_ssl3 options. the ietf standard transport lay...
...And 40 more matches
A simple RTCDataChannel sample - Web APIs
the rtcdatachannel interface is a feature of the webrtc api which lets you open a channel between two peers over which you may send and receive arbitrary data. the api is intentionally similar to the websocket api, so that the same programming model can be used for each. in this example, we will open an rtcdatachannel connection linking two elements on the same page. while that's obviously a contrived scenario, it's useful for demonstrating the flow of connecting two peers. we'll cover the mechanics of accomplishing the connection and transmitting and receiving data, but we will save the bits about locating and linking to a remote computer for another example. the html first, let's take a quick look at the html that's needed. there's nothing incredibly complicated here. first, we have a coupl...
...ow of connecting two peers. we'll cover the mechanics of accomplishing the connection and transmitting and receiving data, but we will save the bits about locating and linking to a remote computer for another example. the html first, let's take a quick look at the html that's needed. there's nothing incredibly complicated here. first, we have a couple of buttons for establishing and closing the connection: <button id="connectbutton" name="connectbutton" class="buttonleft"> connect </button> <button id="disconnectbutton" name="disconnectbutton" class="buttonright" disabled> disconnect </button> then there's a box which contains the text input box into which the user can type a message to transmit, with a button to send the entered text. this <div> will be the first peer in the channel. ...
... box into which we'll insert the messages. this <div> block will be the second peer. <div class="messagebox" id="receivebox"> <p>messages received:</p> </div> the javascript code while you can just look at the code itself on github, below we'll review the parts of the code that do the heavy lifting. the webrtc api makes heavy use of promises. ...
...And 38 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
that the server cannot find the requested resource. 3 502 502, bad gateway, glossary, http errors, infrastructure, navigation an http error code meaning "bad gateway". 4 alpn alpn, draft, glossary, needscontent, tls application-layer protocol negotiation (alpn) is a tls extension which indicates what application layer protocol is negotiating the encryped connection without requiring additional round trips. 5 api codingscripting, glossary, infrastructure an api (application programming interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface. the api can be seen as a simple contract (the interface) between the a...
... a manifest applied to it. 21 argument codingscripting, glossary, javascript an argument is a value (primitive or object) passed as input to a function. 22 arpanet glossary, infrastructure the arpanet (advanced research projects agency network) was an early computer network, constructed in 1969 as a robust medium to transmit sensitive military data and to connect leading research groups throughout the united states. arpanet first ran ncp (network control protocol) and subsequently the first version of the internet protocol or tcp/ip suite, making arpanet a prominent part of the nascent internet. arpanet was closed in early 1990. 23 array array, codingscripting, glossary, javascript, programming an array is an ordered collection of dat...
... the term asynchronous refers to or multiple related things happening without waiting for the previous one to complete). 25 attribute codingscripting, glossary, html an attribute extends an element, changing its behavior or providing metadata. 26 bandwidth glossary, infrastructure bandwidth is the measure of how much information can pass through a data connection in a given amount of time. it is usually measured in multiples of bits-per-second (bps), for example megabits-per-second (mbps) or gigabits-per-second (gbps). 27 base64 advanced, base64, javascript, typed arrays, uri, url, unicode problem, atob(), btoa() base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ascii string format by tra...
...And 30 more matches
Using the Gamepad API - Web APIs
port many tasks previously requiring native code. the gamepad api is a way for developers and designers to access and use gamepads and other game controllers. the gamepad api introduces new events on the window object for reading gamepad and controller (hereby referred to as gamepad) state. ...
...e gamepads and other game controllers. the gamepad api introduces new events on the window object for reading gamepad and controller (hereby referred to as gamepad) state. in addition to these events, the api also adds a gamepad object, which you can use to query the state of a connected gamepad, and a navigator.getgamepads() method which you can use to get a list of gamepads known to the page. connecting to a gamepad when a new gamepad is connected to the computer, the focused page first receives a gamepadconnected event. if a gamepad is already connected when the page loaded, the gamepadconnected event is dispatched to the focused page when the user presses a button or moves an axis. in firefox, gamepads are only exposed to a page when the user interacts with one with the page visible. thi...
...mepad is already connected when the page loaded, the gamepadconnected event is dispatched to the focused page when the user presses a button or moves an axis. in firefox, gamepads are only exposed to a page when the user interacts with one with the page visible. this helps prevent gamepads being used for fingerprinting the user. once one gamepad has been interacted with, other gamepads that are connected will automatically be visible. you can use gamepadconnected like this: window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at index %d: %s. %d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); each gamepad has a unique id associated with it, which is available on the event's gamepad proper...
...And 25 more matches
WebRTC API - Web APIs
prise webrtc makes it possible to share data and perform teleconferencing peer-to-peer, without requiring that the user installs plug-ins or any other third-party software. webrtc consists of several interrelated apis and protocols which work together to achieve this. the documentation you'll find here will help you understand the fundamentals of webrtc, how to set up and use both data and media connections, and more. interoperability because implementations of webrtc are still evolving, and because each browser has different levels of support for codecs and webrtc features, you should strongly consider making use of the adapter.js library provided by google before you begin to write your code. adapter.js uses shims and polyfills to smooth over the differences among the webrtc implementations...
...brtc adapter.js. webrtc concepts and usage webrtc serves multiple purposes; together with the media capture and streams api, they provide powerful multimedia capabilities to the web, including support for audio and video conferencing, file exchange, screen sharing, identity management, and interfacing with legacy telephone systems including support for sending dtmf (touch-tone dialing) signals. connections between peers can be made without requiring any special drivers or plug-ins, and can often be made without any intermediary servers. connections between two peers are represented by the rtcpeerconnection interface. once a connection has been established and opened using rtcpeerconnection, media streams (mediastreams) and/or data channels (rtcdatachannels) can be added to the connection. med...
...presented by objects based on the mediastreamtrack interface, may contain one of a number of types of media data, including audio, video, and text (such as subtitles or even chapter names). most streams consist of at least one audio track and likely also a video track, and can be used to send and receive both live media or stored media information (such as a streamed movie). you can also use the connection between two peers to exchange arbitrary binary data using the rtcdatachannel interface. this can be used for back-channel information, metadata exchange, game status packets, file transfers, or even as a primary channel for data transfer. more details and links to relevant guides and tutorials needed webrtc reference because webrtc provides interfaces that work together to accomplish a vari...
...And 24 more matches
Necko walkthrough
pens on the main thread, in a non-blocking fashion: make your request on the main thread, then carry on and get the async response later, also on the main thread. there is an option to receive ondataavailable specifically on a non-main thread, but all other calls happen on the main thread. ...
...non-blocking fashion: make your request on the main thread, then carry on and get the async response later, also on the main thread. there is an option to receive ondataavailable specifically on a non-main thread, but all other calls happen on the main thread. ...
...fically on a non-main thread, but all other calls happen on the main thread. ...
...And 22 more matches
Mozilla DOM Hacking Guide
dge of c++ and xpcom is assumed. if you don't know xpcom yet, and would like to be able to read this document quickly, you can read the introduction to xpcom for the dom. otherwise, for more detailed xpcom documentation, please see the xpcom project page. class info and helper classes introduction to class info class info is what gives the dom classes their correct behavior when used through xpconnect. it lies at the heart of the famous "xpcdom landing" that happened in may. we will talk a lot about xpconnect in this document, since it is so important for the dom. by "correct behavior", i mean "the intended behavior with respect to the specification or de facto standard". we will see that class info is mainly used to implement the dom level 0. the w3c dom is mainly implemented in idl. the goal...
...the dom. by "correct behavior", i mean "the intended behavior with respect to the specification or de facto standard". we will see that class info is mainly used to implement the dom level 0. the w3c dom is mainly implemented in idl. the goals of class info are twofold: interface flattening, and implementing behaviors that are not possible with idl alone. a brief introduction to javascript and xpconnect. before we begin the explanation of class info, i'd like to introduce quickly the javascript engine and xpconnect. in javascript, there is no knowledge of types, like there is in c++. a function for example can be represented by a jsfunction, a jsobject, a jsval, ... this means that when we use the dom from javascript, we pass arguments that have no type. however, since the dom is coded in c++, ...
...e and xpconnect. in javascript, there is no knowledge of types, like there is in c++. a function for example can be represented by a jsfunction, a jsobject, a jsval, ... this means that when we use the dom from javascript, we pass arguments that have no type. however, since the dom is coded in c++, we expect to receive an argument of the correct type for our function. this is one of the jobs of xpconnect. xpconnect will "wrap" the argument in a wrapper that will be of the type expected by our c++ function. similarly, then return type of the c++ function will be wrapped by xpconnect so that javascript can use it safely. when, in javascript, a client tries to access a dom object or a dom method on a dom object, the js engine asks xpconnect to search for the relevant c++ method to call. for example...
...And 20 more matches
Implementing controls using the Gamepad API - Game development
this article looks at implementing an effective, cross-browser control system for web games using the gamepad api, allowing you to control your web games using console game controllers. it features a case study game — hungry fridge, created by enclave games. controls for web games historically playing games on a console connected to your tv was always a totally different experience to gaming on the pc, mostly because of the unique controls. eventually, extra drivers and plugins allowed us to use console gamepads with desktop games — either native games or those running in the browser. now in the era of html5, we finally have the gamepad api, which gives us the ability to play browser-based games using gamepad controllers without any plugins. the gamepad api achieves this by providing an in...
...the hungry fridge by tapping the healthy food (apples, carrots, lettuces) and avoid the "bad" food (beer, burgers, pizza.) a countdown changes the type of food the fridge wants to eat every few seconds, so you have to be careful and act quickly. the second, hidden "change" implementation is the ability to transform the static fridge into a full-blown moving, shooting and eating machine. when you connect the controller, the game significantly changes (hungry fridge turns into the super turbo hungry fridge) and you're able to control the armored fridge using the gamepad api. you have to shoot down the food, but once again you also have to find the type of food the fridge wants to eat at each point, or else you'll lose energy. the game encapsulates two totally different types of "change" — good ...
... into the code and study exactly how it works. the code explained below is from the full version of the hungry fridge game, but it's almost identical to the one from the demo — the only difference is that the full version uses the turbo variable to decide whether or not the game will be launched using super turbo mode. it works independently, so it could be turned on even if the gamepad is not connected. note: easter egg time: there's a hidden option to launch super turbo hungry fridge on the desktop without having a gamepad connected — click the gamepad icon in the top right corner of the screen. it will launch the game in the super turbo mode and you'll be able to control the fridge with the keyboard: a and d for turning the turret left and right, w for shooting and arrow keys for moveme...
...And 19 more matches
Storage
ocument covers the storage api and some peculiarities of sqlite. it does not cover sql or "regular" sqlite. you can find some very useful links in the see also section however. for storage api help, you can post to mozilla.dev.apps.platform on the news server news.mozilla.org. to report bugs, use bugzilla. the overall procedure for use is: get the storage service - mozistorageservice. ...
...f sqlite. it does not cover sql or "regular" sqlite. you can find some very useful links in the see also section however. for storage api help, you can post to mozilla.dev.apps.platform on the news server news.mozilla.org. to report bugs, use bugzilla. the overall procedure for use is: get the storage service - mozistorageservice. open a connection to the database of your choice - mozistorageconnection. ...
...te. you can find some very useful links in the see also section however. for storage api help, you can post to mozilla.dev.apps.platform on the news server news.mozilla.org. to report bugs, use bugzilla. the overall procedure for use is: get the storage service - mozistorageservice. open a connection to the database of your choice - mozistorageconnection. create statements to execute on the connection - mozistoragestatement. bind parameters to a statement as necessary. execute the statement. ...
...And 19 more matches
Index
r to granting validity to the certificate. in order to distinguish an ev certificate, cas will embed a policy oid in the certificate, and the browser is expected to verify that a trust chain permits the end entity (ee) certificate to make use of the policy. only the apis of the newer libpkix engine are capable of performing a policy verification. ...
...rtificate to make use of the policy. only the apis of the newer libpkix engine are capable of performing a policy verification. that's a good opportunity to talk about ssl/tls connections to servers in general (not just ev, not just websites). whenever this document mentions ssl, it refers to either ssl or tls. (tls is a newer version of ssl with enhanced features.) when establishing an ssl connection to a server, (at least) a server certificate (and its trust chain) is exchanged from the server to the client (e.g., the browser), and the client verifies that the certificate can be verified (including matching the name of the expected destination server). another part of the handshake between both parties is a key exchange. because public key encryption is more expensive (more calculations r...
...than symmetric encryption (where both parties use the same key), a key agreement protocol will be executed, where the public and private keys are used to proof and verify the exchanged initial information. once the key agreement is done, a symmetric encryption will be used (until a potential re-handshake on an existing channel). the combination of the hash and encryption algorithms used for a ssl connection is called a cipher suite. nss ships with a set of cipher suites that it supports at a technical level. in addition, nss ships with a default policy that defines which cipher suites are enabled by default. an application is able to modify the policy used at program runtime, by using function calls to modify the set of enabled cipher suites. if a programmer wants to influence how nss verif...
...And 18 more matches
nsIDOMWindowUtils
key inputting. this state is the same as ime-mode: password. ime_status_plugin 3 plug-in has focus. at this time we should not attempt to set the ime state. composition_attr_rawinput 0x02 synthesize a text event to the window. cannot be accessed from unprivileged context (not content-accessible) will throw a dom security error if called without universalxpconnect privileges. currently, this method doesn't support 4 or more clauses composition string. obsolete since gecko 38.0 composition_attr_selectedrawtext 0x03 obsolete since gecko 38.0 composition_attr_convertedtext 0x04 obsolete since gecko 38.0 composition_attr_selectedconvertedtext 0x05 obsolete since gecko 38.0 query_content_flag_use_nat...
...e css2 specification for details. author_sheet 2 a possible type of a style sheet loaded/removed with loadsheet()/removesheet(). see css2 specification for details. methods activatenativemenuitemat() see nsiwidget.activatenativemenuitemat(). cannot be accessed from unprivileged context (not content-accessible) will throw a dom security error if called without universalxpconnect privileges. void activatenativemenuitemat( in astring indexstring ); parameters indexstring clearmozafterpaintevents() void clearmozafterpaintevents(); parameters none. comparecanvases() compare the two canvases, returning the number of differing pixels and the maximum difference in a channel. this will throw an error if the dimensions of the two canvases are different. this m...
...enativemenuitemat( in astring indexstring ); parameters indexstring clearmozafterpaintevents() void clearmozafterpaintevents(); parameters none. comparecanvases() compare the two canvases, returning the number of differing pixels and the maximum difference in a channel. this will throw an error if the dimensions of the two canvases are different. this method requires universalxpconnect privileges. pruint32 comparecanvases( in nsidomhtmlcanvaselement acanvas1, in nsidomhtmlcanvaselement acanvas2, out unsigned long amaxdifference ); parameters acanvas1 acanvas2 amaxdifference return value computeanimationdistance() method for testing nsstyleanimation::computedistance. returns the distance between the two values as reported by nsstyleanimation::comput...
...And 18 more matches
nsIXPCScriptable
note: this is not really an xpcom interface. for example, callers must guarantee that they set the *_retval of the various methods that return a boolean to pr_true before making the call. implementations may skip writing to *_retval unless they want to return pr_false. js/src/xpconnect/idl/nsixpcscriptable.idlnot scriptable please add a summary to this article. ...
... unless they want to return pr_false. js/src/xpconnect/idl/nsixpcscriptable.idlnot scriptable please add a summary to this article. ...
...please add a summary to this article. ...
...And 18 more matches
Index - Archive of obsolete content
this tutorial focuses on extensions for firefox, but the same (or very similar) principles apply to creating extens...
...n, configuration management, enterprise no summary! 373 protecting mozilla's registry.dat file administration, configuration management, enterprise no summary! 374 automatically handle failed asserts in debug builds as of 2004-12-8, it is now possible to automatically handle failed asserts in debug builds of mozilla for windows. 375 blackconnect java no summary! 376 blackwood java no summary! 377 bonsai developing mozilla, tools it is a tool that lets you perform queries on the contents of a cvs archive; you can: get a list of checkins, see what checkins have been made by a given person, or on a given cvs branch, or in a particular time period. it also includes tools for looking at chec...
...data administration, enterprise this page will explain how to create a .rdf or .xml file that you can place in the $installfolder/default/isp to do a variety of things. this page applies to thunderbird (mail/news). 491 java in firefox extensions add-ons, extensions, java if you are in need of calling java code from within a firefox extension, you can make use of liveconnect. ...
...And 15 more matches
Sqlite.jsm
onous. use of synchronous storage apis is discouraged because they block the main thread. all the functionality in sqlite.jsm is asynchronous. easier memory management. since sqlite.jsm manages statements for you, it can perform intelligent actions like purging all cached statements not in use, freeing memory in the process. there is even a shrinkmemory api that will minimize memory usage of the connection automatically. simpler transactions. sqlite.jsm exposes a transaction api built on top of task.jsm that allows transactions to be written as procedural javascript functions (as opposed to a series of callback driven operations). if the function throws, the transaction is automatically rolled back. this makes code easy to write and read. javascript-y api. sqlite.jsm feels like a pure javascri...
...omplexities of xpcom are mostly hidden from view. javascript programmers should feel right at home using sqlite.jsm. note: the sqlite.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on. before you can use this module, you need to import it into your scope: components.utils.import("resource://gre/modules/sqlite.jsm") obtaining a connection sqlite.jsm exports the sqlite symbol. this symbol is an object with a single function: openconnection. this function takes an object defining connection options: path (required) the database file to open. this can be an absolute or relative path. if a relative path is given, it is interpreted as relative to the current profile's directory. if the path does not exist, a new sqlite database...
...kes an object defining connection options: path (required) the database file to open. this can be an absolute or relative path. if a relative path is given, it is interpreted as relative to the current profile's directory. if the path does not exist, a new sqlite database will be created. the value typically ends with .sqlite. sharedmemorycache (optional) boolean indicating whether multiple connections to the database share the same memory cache. sharing the memory cache likely results in less memory utilization. however, sharing also requires connections to obtain a lock, possibly making database access slower. defaults to true. shrinkmemoryonconnectionidlems (optional) if defined, the connection will attempt to minimize its memory usage after this many milliseconds of connection idle. t...
...And 15 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
ble.js), because there are so many values. it is taken from a repository of wavetables, which can be found in the web audio api examples from google chrome labs. the oscillator now we can create an oscillatornode and set its wave to the one we've created: function playsweep() { let osc = audioctx.createoscillator(); osc.setperiodicwave(wave); osc.frequency.value = 440; osc.connect(audioctx.destination); osc.start(); osc.stop(audioctx.currenttime + 1); } controlling amplitude this is great, but wouldn't it be nice if we had an amplitude envelope to go with it? let's create a simple one so we get used to the methods we need to create an envelope with the web audio api. let's say our envelope has attack and release. we can allow the user to control these using ra...
...ck'); attackcontrol.addeventlistener('input', function() { attacktime = number(this.value); }, false); let releasetime = 0.5; const releasecontrol = document.queryselector('#release'); releasecontrol.addeventlistener('input', function() { releasetime = number(this.value); }, false); the final playsweep() function now we can expand our playsweep() function. we need to add a gainnode and connect that through our audio graph to actually apply amplitude variations to our sound. the gain node has one property: gain, which is of type audioparam. this is really useful — now we can start to harness the power of the audio param methods on the gain value. we can set a value at a certain time, or we can change it over time with methods such as audioparam.linearramptovalueattime. for our attac...
...all you really need to know is that it returns the time we are at right now. the "pulse" — low frequency oscillator modulation great, now we've got our sweep! let'...
...And 15 more matches
RTCDtlsTransport - Web APIs
features of the dtls transport include the addition of security to the underlying transport; the rtcdtlstransport interface can be used to obtain information about the underlying transport and the security added to it by the dtls layer. ...
... features of the dtls transport include the addition of security to the underlying transport; the rtcdtlstransport interface can be used to obtain information about the underlying transport and the security added to it by the dtls layer. ...
... 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 setlocaldescription() or setremotedescription(). 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 endpoints are browsers, you can rest assured that bundling will be used. some non-browser legacy endpoints, however, may not support bundle. to be able to negotiate with such endpoints (or to exclude them entirely), the rtcconfiguration property bundlepolicy may be p...
...And 13 more matches
Codecs used by WebRTC - Web media technologies
vp8 — chrome, edge, firefox, safari (12.1+) avc / h.264 constrained baseline (cb) chrome (52+), edge, firefox[1], safari [1] firefox for android 68 and later do not support avc (h.264) anymore. this is due to a change in google play store requirements that prevent firefox from downloading and installing the openh264 codec needed to handle h.264 in webrtc connections. see this article on sumo for details. for details on webrtc-related considerations for each codec, see the sub-sections below by following the links on each codec's name. complete details of what video codecs and configurations webrtc is required to support can be found in rfc 7742: webrtc video processing and codec requirements. it's worth noting that the rfc covers a variety of video-rel...
...nal codecs as well. those are listed in the following table. other video codecs codec name profile(s) browser compatibility vp9 — chrome (48+), firefox vp8 vp8, which we describe in general in the main guide to video codecs used on the web, has some specific requirements that must be followed when using it to encode or decode a video track on a webrtc connection. unless signaled otherwise, vp8 will use square pixels (that is, pixels with an aspect ratio of 1:1). other notes the network payload format for sharing vp8 using rtp (such as when using webrtc) is described in rfc 7741: rtp payload format for vp8 video. avc / h.264 support for avc's constrained baseline (cb) profile is required in all fully-compliant webrtc implementations. cb is a subse...
...self is not required to be specified. sprop-parameter-sets sequence and picture information for avc can be sent either in-band or out-of-band. when avc is used with webrtc, this information must be signaled in-band; the sprop-parameter-sets parameter must therefore not be included in the sdp. parameters which must be specified these parameters must be specified whenever using avc in a webrtc connection. profile-level-id all webrtc implementations are required to specify and interpret this parameter in their sdp, identifying the sub-profile used by the codec. the specific value that is set is not defined; what matters is that the parameter be used at all. this is useful to note, since in rfc 6184 ("rtp payload format for h.264 video"), profile-level-id is entirely optional. other requir...
...And 13 more matches
Desktop gamepad controls - Game development
an api exposes all the information you need to hook up your game's logic and successfully control the user interface and gameplay. ...
...und 63% global coverage, according to caniuse.com. the list of supported devices is also quite extensive — most popular gamepads (e.g. xbox 360 or ps3) should be suitable for web implementations. pure javascript approach let's think about implementing pure javascript gamepad controls in our little controls demo first to see how it would work. ...
...supported devices is also quite extensive — most popular gamepads (e.g. xbox 360 or ps3) should be suitable for web implementations. pure javascript approach let's think about implementing pure javascript gamepad controls in our little controls demo first to see how it would work. ...
...And 12 more matches
WebRTC Statistics API - Web APIs
the webrtc api has a vast array of statistics available, covering the entire breadth of the webrtc connectivity system, from sender to receiver and peer to peer. collecting statistics you can collect statistics at various levels throughout the webrtc hierarchy of objects. most broadly, you can call getstats() on an rtcpeerconnection to get statistics for the connection overall. in this example, a new rtcpeerconnection is created, and then setinterval() is used to set the function getconnectionstats() to be called every second. that function, in turn, uses getstats() to obtain statistics for the connection and to make use of that data. ...
...y of objects. most broadly, you can call getstats() on an rtcpeerconnection to get statistics for the connection overall. in this example, a new rtcpeerconnection is created, and then setinterval() is used to set the function getconnectionstats() to be called every second. that function, in turn, uses getstats() to obtain statistics for the connection and to make use of that data. ...
...ly, you can call getstats() on an rtcpeerconnection to get statistics for the connection overall. in this example, a new rtcpeerconnection is created, and then setinterval() is used to set the function getconnectionstats() to be called every second. that function, in turn, uses getstats() to obtain statistics for the connection and to make use of that data. ...
...And 12 more matches
HTTP Index - HTTP
Web › HTTP › Index
1 http http, hypertext, reference, tcp/ip, web, web development, l10n:priority hypertext transfer protocol (http) is an application-layer protocol for transmitting hypermedia documents, such as html. it was designed for communication between web browsers and web servers, but it can also be used for other purposes. http follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response. http is a stateless protocol, meaning that the server does not keep any data (state) between two requests. though often based on a tcp/ip layer, it can be used on any reliable transport layer, that is, a protocol that doesn't lose messages silently like udp does. rudp — the reliable update of udp — is a suitable alternative. ...
...e, text, types, video here is a list of mime types, associated by type of documents, ordered by their common extensions. 11 resource urls guide, http, intermediate, resource resource urls, urls prefixed with the resource: scheme, are used by firefox and firefox browser extensions to load resources internally, but some of the information is available to sites the browser connects to as well. 12 browser detection using the user agent compatibility, http, web development serving different web pages or services to different browsers is usually a bad idea. the web is meant to be accessible to everyone, regardless of which browser or device they're using. there are ways to develop your website to progressively enhance itself based on the availability of f...
...ze reduction of up to 70% lowers the bandwidth capacity needs. over the years, algorithms also got more efficient, and new ones are supported by clients and servers. 14 configuring servers for ogg media audio, http, media, ogg, video this guide covers a few server configuration changes that may be necessary for your web server to correctly serve ogg media files. 15 connection management in http/1.x connection management, guide, http, networking, performance, webmechanics connection management is a key topic in http: opening and maintaining connections largely impacts the performance of web sites and web applications. in http/1.x, there are several models: short-lived connections, persistent connections, and http pipelining. 16 content security...
...And 12 more matches
Navigation and resource timings - Web Performance
been replaced with the performancenavigationtiming api. the performance timing api provided read only times, in milliseconds(ms), describing at what time each point in the page loading process was reached. as displayed in the image below, the navigation process goes from navigationstart, unloadeventstart, unloadeventend, redirectstart, redirectend, fetchstart, domainlookupstart, domainlookupend, connectstart , connectend, secureconnectionstart, requeststart, responsestart, responseend, domloading, dominteractive, domcontentloadedeventstart, domcontentloadedeventend, domcomplete, loadeventstart, and loadeventend. with the metrics above, and a little bit of math, we can calculate many important metrics like time to first byte, page load time, dns lookup, and whether the connection is secure. t...
...t time = window.performance.timing we can then use the results to measure how well our app is performing. the order is: performance timings details navigationstart when the prompt for unload terminates on the previous document in the same browsing context. if there is no previous document, this value will be the same as performancetiming.fetchstart. secureconnectionstart when the secure connection handshake starts. if no such connection is requested, it returns 0. redirectstart when the first http redirect starts. if there is no redirect, or if one of the redirects is not of the same origin, the value returned is 0. redirectend when the last http redirect is completed, that is when the last byte of the http response has bee...
... when the first http redirect starts. if there is no redirect, or if one of the redirects is not of the same origin, the value returned is 0. redirectend when the last http redirect is completed, that is when the last byte of the http response has been received. if there is no redirect, or if one of the redirects is not of the same origin, the value returned is 0. ...
...And 12 more matches
RTCConfiguration - Web APIs
the options include ice server and transport settings and identity information. properties bundlepolicy optional specifies how to handle negotiation of candidates when the remote peer is not compatible with the sdp bundle standard. this must be one of the values from the enum rtcbundlepolicy. ...
... the options include ice server and transport settings and identity information. properties bundlepolicy optional specifies how to handle negotiation of candidates when the remote peer is not compatible with the sdp bundle standard. this must be one of the values from the enum rtcbundlepolicy. ...
...dentity information. properties bundlepolicy optional specifies how to handle negotiation of candidates when the remote peer is not compatible with the sdp bundle standard. this must be one of the values from the enum rtcbundlepolicy. if this value isn't included in the dictionary, "balanced" is assumed. certificates optional an array of objects of type rtccertificate which are used by the connection for authentication. if this property isn't specified, a set of certificates is generated automatically for each rtcpeerconnection instance. although only one certificate is used by a given connection, providing certificates for multiple algorithms may improve the odds of successfully connecting in some circumstances. see using certificates below for additional information. this configuration ...
...And 11 more matches
Lifetime of a WebRTC session - Web APIs
webrtc lets you build peer-to-peer communication of arbitrary data, audio, or video—or any combination thereof—into a browser application. in this article, we'll look at the lifetime of a webrtc session, from establishing the connection all the way through closing the connection when it's no longer needed. this article doesn't get into details of the actual apis involved in establishing and handling a webrtc connection; it simply reviews the process in general with some information about why each step is required. see signaling and video calling for an actual example with a step-by-step explanation of what the code does. this page is currently under construction, and some of the content will move to other pages as the webrtc guide material is built out. pardon our dust! establishing...
...really big. it’s so big that years ago, smart people saw how big it was, how fast it was growing, and the limitations of the 32-bit ip addressing system, and realized that something had to be done before we ran out of addresses to use, so they started working on designing a new 64-bit addressing system. ...
...necessarily has a unique ip address, and, in fact, each device’s ip address may change not only if they move from one network to another, but if their network’s address is changed by nat and/or dhcp. for developers trying to do peer-to-peer networking, this introduces a conundrum: without a unique identifier for every user device, it’s not possible to instantly and automatically know how to connect to a specific device on the internet. even though you know who you want to talk to, you don’t necessarily know how to reach them or even what their address is. this is like trying to mail a package to your friend michelle by labeling it “michelle” and dropping it in a mailbox when you don't know her address. you need to look up her address and include it on the package, or she'll wind up w...
...And 11 more matches
Autodial for Windows NT - Archive of obsolete content
as last updated in 2002. introduction this document is intended to explain how the autodial helper feature implemented for bug 93002 works and why it works that way. a brief history of autodial on windows in the consumer versions of windows, (windows 95, windows 98, windows me) autodial for all applications is controlled from the control panel, in the internet options applet, under the tab connections. if you turn on the autodial feature, windows will automatically dial whenever any application tries to access a network address that can't be reached. technically, this control panel applet (internet options) is part of internet explorer. it is not present in early versions of windows until internet explorer is installed. despite this fact, the feature is triggered by any application that us...
...orking. starting with windows nt, and in all nt-based versions (windows nt, windows 2000, and windows xp, including xp home) microsoft has changed the behavior of autodial. for these oss, the autodial options found in the internet options control panel applet only apply to microsoft applications, including internet explorer and outlook. microsoft added a windows system service (remote access auto connection) to handle autodial for all other applications. if this service is running, and control panel | network connections | advanced | dialup preferences is set to enable autodial, then any application trying to access the internet will trigger the autodial feature whenever an internet address cannot be reached. however, this service will won't function if you have a lan card installed, unless that ...
...rvice is running, and control panel | network connections | advanced | dialup preferences is set to enable autodial, then any application trying to access the internet will trigger the autodial feature whenever an internet address cannot be reached. however, this service will won't function if you have a lan card installed, unless that particular address has been accessed in the past via a dialup connection. origin of the bug before the implementation of the autodial helper feature, mozilla would trigger the autodial feature on nt-based operating systems, but only if certain conditions are met. ...
...And 10 more matches
Introduction to SSL - Archive of obsolete content
displaying web pages or running email servers. the ssl protocol runs above tcp/ip and below higher-level protocols such as http or imap. it uses tcp/ip on behalf of the higher-level protocols, and in the process allows an ssl-enabled server to authenticate itself to an ssl-enabled client, allows the client to authenticate itself to the server, and allows both machines to establish an encrypted connection. these capabilities address fundamental concerns about communication over the internet and other tcp/ip networks: ssl server authentication allows a user to confirm a server's identity. ssl-enabled client software can use standard techniques of public-key cryptography to check that a server's certificate and public id are valid and have been issued by a certificate authority (ca) listed in...
...r authentication, ssl-enabled server software can check that a client's certificate and public id are valid and have been issued by a certificate authority (ca) listed in the server's list of trusted cas. this confirmation might be important if the server, for example, is a bank sending confidential financial information to a customer and wants to check the recipient's identity. ...
... the ssl protocol includes two sub-protocols: the ssl record protocol and the ssl handshake protocol. the ssl record protocol defines the format used to transmit data. ...
...And 10 more matches
mozIStorageService
storage/public/mozistorageservice.idlscriptable this interface lets you open a mozistorageconnection to a database file, as well as create backups of an unopened database file. this is the only way to open a database connection. ...
... storage/public/mozistorageservice.idlscriptable this interface lets you open a mozistorageconnection to a database file, as well as create backups of an unopened database file. this is the only way to open a database connection. ...
...ned database file. this is the only way to open a database connection. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) see mozistorageconnection method overview nsifile backupdatabasefile(in nsifile adbfile, in astring abackupfilename, [optional] in nsifile abackupparentdirectory); mozistorageconnection opendatabase(in nsifile adatabasefile); mozistorageconnection openspecialdatabase(in string astoragekey); mozistorageconnection openunshareddatabase(in nsifile adatabasefile); methods backupdatabasefile() this method makes a backup of the specified file. the database should not be open, or you should ensure that no database activity is happening when y...
...And 10 more matches
nsISocketTransport
netwerk/base/public/nsisockettransport.idlscriptable this interface specializes nsitransport for communication over network sockets. it provides methods to open blocking or non-blocking, buffered or unbuffered streams between two end-point in a ip based network. inherits from: nsitransport last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: connection setup is triggered by opening an input or output stream, it does not start on its own. completion of the connection setup is indicated by a status_connected_to notification to the event sink (if set). to create an instance, call nsisockettransportservice.createtransport() method overview prnetaddr getpeeraddr(); native code only! prnetaddr getselfaddr(); native code only! ...
...read only. securityca...
... code only! unsigned long gettimeout(in unsigned long atype); boolean isalive(); void settimeout(in unsigned long atype, in unsigned long avalue); attributes attribute type description connectionflags unsigned long a bitmask that can be used to modify underlying behavior of the socket connection. 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. securitycallbacks nsiinterfacerequestor security notification callbacks passed to the secure socket pr...
...And 10 more matches
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...
... 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 plain http connections or any tcp protocol, as well as for ssl streams, as described here. the tool cannot and does not decrypt any encrypted message data. you use the tool to look at the plain text and binary data that are part of the handshake procedure, before the secure connection is established. syntax to run the ssl debugging tool, type this command in a command shell: ssltap [-vhfsxl] [-p port] host...
...the options for the command are the following: -v print a version string for the tool. -h turn on hex/ascii printing. ...
...And 9 more matches
NSS tools : ssltap
Mozilla › Projects › NSS › tools › ssltap
-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. ...
... -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. ...
...s, followed by the same data as ascii characters. the two parts are separated by a vertical bar. nonprinting characters are replaced by dots. -f turn on fancy printing. output is printed in colored html. data sent from the client to the server is in blue; the server's reply is in red. when used with looping mode, the different connections are separated with horizontal lines. you can use this option to upload the output into a browser. -s turn on ssl parsing and decoding. the tool does not automatically detect ssl sessions. if you are intercepting an ssl connection, use this option so that the tool can detect and decode ssl structures. if the too...
...And 9 more matches
RTCIceCandidatePairStats - Web APIs
if a rtcstats-based object's type is candidate-pair, it's an rtcicecandidatepairstats object. properties rtcicecandidatepairstats is based upon rtcstats and inherits its properties. ...
...air so far. bytessent optional the total number of payload bytes sent (that is, the total number of bytes sent minus any headers, padding, or other administrative overhead) so far on this candidate pair. circuitbreakertriggercount optional an integer value indicating the number of times the circuit-breaker has been triggered for this particular 5-tuple (the set of five values comprising a tcp connection: source ip address, source port number, destination ip address, destination port number, and protocol). the circuit breaker is triggered whenever a connection times out or otherwise needs to be automatically aborted. consentexpiredtimestamp optional a domhighrestimestamp value indicating the time at which the most recent stun binding response expired. this value is undefined if no valid stun...
...d is 0. consentrequestssent optional the total number of consent requests that have been sent on this candidate pair. currentroundtriptime optional a floating-point value indicating the total time, in seconds, that elapsed elapsed between the most recently-sent stun request and the response being received. this may be based upon requests that were involved in confirming permission to open the connection. firstrequesttimestamp optional a domhighrestimestamp value which specifies the time at which the first stun request was sent from the local peer to the remote peer for this candidate pair. lastpacketreceivedtimestamp optional a domhighrestimestamp value indicating the time at which the last packet was received by the local peer from the remote peer for this candidate pair. timestamps are ...
...And 9 more matches
Controlling multiple parameters with ConstantSourceNode - Web APIs
is optimized for this kind of work and may run at a more appropriate priority level than your code. the solution is simple, and it involves using an audio node type which, at first glance, doesn't look all that useful: constantsourcenode. the technique this is actually a really easy way to do something that sounds like it might be hard to do. you simply need to create a constantsourcenode and connect it to all of the audioparams whose values should be linked to always match each other. since constantsourcenode's offset value is simply sent straight through to all of its outputs, it acts as a splitter for that value, sending it to each connected parameter. the diagram below shows how this works; an input value, n, is set as the value of the constantsourcenode.offset property. the constantsour...
...so n becomes the value of the specified parameter (gain for the gainnodes and pan for the stereopannernode. ...
...then we get references to the control widgets, settin...
...And 9 more matches
An overview of HTTP - HTTP
Web › HTTP › Overview
unicate 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 a tls-encrypted tcp connection, though any reliable transport protocol could theoretically be used. due to its extensibility, it is used to not only fetch hypertext documents, but also images and videos or to post content to servers, like with html form results. http can also be used to fetch parts of documents to update web pages on demand. components of http-based systems http is a client-server protocol: requests are s...
...exity for newcomers. http is extensible introduced in http/1.0, http headers make this protocol easy to extend and experiment with. new functionality can even be introduced by a simple agreement between a client and a server about a new header's semantics. http is stateless, but not sessionless http is stateless: there is no link between two requests being successively carried out on the same connection. this immediately has the prospect of being problematic for users attempting to interact with certain pages coherently, for example, using e-commerce shopping baskets. but while the core of http itself is stateless, http cookies allow the use of stateful sessions. using header extensibility, http cookies are added to the workflow, allowing session creation on each http request to share the sam...
...f being problematic for users attempting to interact with certain pages coherently, for example, using e-commerce shopping baskets. but while the core of http itself is stateless, http cookies allow the use of stateful sessions. using header extensibility, http cookies are added to the workflow, allowing session creation on each http request to share the same context, or the same state. http and connections a connection is controlled at the transport layer, and therefore fundamentally out of scope for http. though http doesn't require the underlying transport protocol to be connection-based; only requiring it to be reliable, or not lose messages (so at minimum presenting an error). among the two most common transport protocols on the internet, tcp is reliable and udp isn't. http therefore relie...
...And 9 more matches
Protocol upgrade mechanism - HTTP
the http/1.1 protocol provides a special mechanism that can be used to upgrade an already established connection to a different protocol, using the upgrade header field. this mechanism is optional; it cannot be used to insist on a protocol change. implementations can choose not to take advantage of an upgrade even if they support the new protocol, and in practice, this mechanism is used mostly to bootstrap a websockets connection. note also that http/2 explicitly disallows the use of this mechanism; it is specific to http/1.1. ...
... header field. this mechanism is optional; it cannot be used to insist on a protocol change. implementations can choose not to take advantage of an upgrade even if they support the new protocol, and in practice, this mechanism is used mostly to bootstrap a websockets connection. note also that http/2 explicitly disallows the use of this mechanism; it is specific to http/1.1. ...
... is used mostly to bootstrap a websockets connection. note also that http/2 explicitly disallows the use of this mechanism; it is specific to http/1.1. upgrading http/1.1 connections the upgrade header field is used by clients to invite the server to switch to one of the listed protocols, in descending preference order. because upgrade is a hop-by-hop header, it also needs to be listed in the connection header field. ...
...And 9 more matches
about:debugging - Firefox Developer Tools
d-ons, tabs, and workers. opening the about:debugging page there are two ways to open about:debugging: type about:debugging in the firefox url bar. in the tools > web developer menu, click remote debugging. when about:debugging opens, on the left-hand side, you'll see a sidebar with two options and information about your remote debugging setup: setup use the setup tab to configure the connection to your remote device. this firefox provides information about temporary extensions you have loaded for debugging, extensions that are installed in firefox, the tabs that you currently have open, and service workers running on firefox. if your about:debugging page is different from the one displayed here, go to about:config, find and set the option devtools.aboutdebugging.new-enabled to ...
... device. this firefox provides information about temporary extensions you have loaded for debugging, extensions that are installed in firefox, the tabs that you currently have open, and service workers running on firefox. if your about:debugging page is different from the one displayed here, go to about:config, find and set the option devtools.aboutdebugging.new-enabled to true. ...
...in firefox, the tabs that you currently have open, and service workers running on firefox. if your about:debugging page is different from the one displayed here, go to about:config, find and set the option devtools.aboutdebugging.new-enabled to true. setup tab connecting to a remote device firefox supports debugging over usb with android devices, using the about:debugging page. before you connect: enable developer settings on your android device. enable usb debugging in the android developer settings. enable remote debugging via usb in the advanced settings in firefox on the android device. connect the android device to your computer using a usb cable. if your device doesn't appear in the lefthand side of the about:debugging page, try clicking the refresh devices button. if it st...
...And 8 more matches
Applying styles and colors - Web APIs
with half-pixel coordinates for odd-width lines, by setting the linecap style to square, so that the outer border of the stroke around the endpoint will be automatically extended to cover the whole pixel exactly). note also that only start and final endpoints of a path are affected: if a path is closed with closepath(), there's no start and final endpoint; instead, all endpoints in the path are connected to their attached previous and next segment using the current setting of the linejoin style, whose default value is miter, with the effect of automatically extending the outer borders of the connected segments to their intersection point, so that the rendered stroke will exactly cover full pixels centered at each endpoint if those connected segments are horizontal and/or vertical). see the next...
... there are three possible values for this property: round, bevel and miter. by default this property is set to miter. note that the linejoin setting has no effect if the two ...
...ing segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified endpoints and control points are exactly at the same position, are skipped). there are three possible values for this property: round, bevel and miter. by default this property is set to miter. ...
...And 8 more matches
Writing WebSocket client applications - Web APIs
sing the websocket protocol. note: this feature is available in web workers. note: the example snippets in this article are taken from our websocket chat client/server sample. see the code, then try out the example for yourself. creating a websocket object in order to communicate using the websocket protocol, you need to create a websocket object; this will automatically attempt to open the connection to the server. the websocket constructor accepts one required and one optional parameter: websocket = new websocket(url, protocols); url the url to which to connect; this should be the url to which the websocket server will respond. this should use the url scheme wss://, although some software may allow you to use the insecure ws:// for local connections. protocols optional either a s...
...t a single server can implement multiple websocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol). if you don't specify a protocol string, an empty string is assumed. the constructor will throw a securityerror if the destination doesn't allow access. ...
...mple, you might want one server to be able to handle different types of interactions depending on the specified protocol). if you don't specify a protocol string, an empty string is assumed. the constructor will throw a securityerror if the destination doesn't allow access. this may happen if you attempt to use an insecure connection (most user agents now require a secure link for all websocket connections unless they're on the same device or possibly on the same network). ...
...And 8 more matches
Writing a WebSocket server in C# - Web APIs
introduction if you would like to use the websocket api, it is useful if you have a server. in this article i will show you how to write one in c#. you can do it in any server-side language, but to keep things simple and more understandable, i chose microsoft's language. this server conforms to rfc 6455 so it will only handle connections from chrome version 16, firefox 11, ie 10 and over. first steps websockets communicate over a tcp (transmission control protocol) connection. luckily, c# has a tcplistener class which does as the name suggests. it is in the system.net.sockets namespace. it is a good idea to include the namespace with the using keyword in order to write less. it allows usage of a namespace's classes without typing the full namespace every time. tcplistener constru...
...namespace's classes without typing the full namespace every time. tcplistener constructor: tcplistener(system.net.ipaddress localaddr, int port) localaddr specifies the ip of the listener, and port specifies the port. to create an ipaddress object from a string, use the parse static method of ipaddress. ...
...both sides of the channel have reading and writing capability. ...
...And 8 more matches
Writing WebSocket servers - Web APIs
d-balancing or other practical reasons), so you will often use a reverse proxy (such as a regular http server) to detect websocket handshakes, pre-process them, and send those clients to a real websocket server. this means that you don't have to bloat your server code with cookie and authentication handlers (for example). the websocket handshake first, the server must listen for incoming socket connections using a standard tcp socket. depending on your platform, this may be handled for you automatically. for example, let's assume that your server is listening on example.com, port 8000, and your socket server responds to get requests at example.com/chat. warning: the server may listen on any port it chooses, but if it chooses any port other than 80 or 443, it may have problems with firewalls a...
... platform, this may be handled for you automatically. for example, let's assume that your server is listening on example.com, port 8000, and your socket server responds to get requests at example.com/chat. warning: the server may listen on any port it chooses, but if it chooses any port other than 80 or 443, it may have problems with firewalls and/or proxies. browsers generally require a secure connection for websockets, although they may offer an exception for local devices. the handshake is the "web" in websockets. it's the bridge from http to websockets. in the handshake, details of the connection are negotiated, and either party can back out before completion if the terms are unfavorable. the server must be careful to understand everything the client asks for, otherwise security issues ca...
... the spec. so, many people use it to let one server handle multiple websocket applications. for example, example.com/chat could invoke a multiuser chat app, while /game on the same server might invoke a multiplayer game. ...
...And 8 more matches
Java in Firefox Extensions - Archive of obsolete content
note: the global java object has been removed in gecko 16.0, so this page is out of date. you should still be able to use the java plugin's scripting functionality, see liveconnect for the pointers. note bug 834918 about click-to-play effect on java plugins in chrome and bug 775301. if you are in need of calling java code from within a firefox extension, you can make use of liveconnect. ...
... note: the global java object has been removed in gecko 16.0, so this page is out of date. you should still be able to use the java plugin's scripting functionality, see liveconnect for the pointers. note bug 834918 about click-to-play effect on java plugins in chrome and bug 775301. if you are in need of calling java code from within a firefox extension, you can make use of liveconnect. ...
...nters. note bug 834918 about click-to-play effect on java plugins in chrome and bug 775301. if you are in need of calling java code from within a firefox extension, you can make use of liveconnect. liveconnect gives your extension's javascript code (linked from or contained in xul code) access to 2 objects: java and packages (note that per this thread, although the new documentation for the liveconnect reimplementation states that these globals will be deprecated (in the context of applets), "firefox and the java plug-in will continue to support the global java/packages keywords, in particular in the context of firefox extensions."). these 2 objects let you make use of the standard jdk classes, e.g., var ajavalist = new java.util.linkedlist(); if you want to load your own jars, then you can cr...
...And 7 more matches
JavaScript-DOM Prototypes in Mozilla
in the case where the c++ object has class info (nsiclassinfo), the jsobject is a more or less empty jsobject which is not really that special. ...
...in the case where the c++ object has class info (nsiclassinfo), the jsobject is a more or less empty jsobject which is not really that special. ...
...in the case where the c++ object has class info (nsiclassinfo), the jsobject is a more or less empty jsobject which is not really that special. ...
...And 7 more matches
NSS tools : ssltab
-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. nonprinting characters are replaced by dots. -f turn on fancy printing. output is printed in colored html. ...
...ata, 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. nonprinting characters are replaced by dots. -f turn on fancy printing. output is printed in colored html. data sent from the client to the server is in blue; the server's reply is in red. when used with looping mode, the different connections are separated with horizontal lines. you can use this option to upload the output into a browser. -s turn on ssl parsing and decoding. the tool does not automatically detect ssl sessions. if you are intercepting an ssl connection, use this option so that the tool can detect and decode ssl structures. if the tool detects a certificate chain, it saves the der-encoded certificates into files in ...
...x is the sequence number of the certificate. if the -s option is used with -h, two separate parts are printed for each record: the plain hex/ascii output, and the parsed ssl output. -x turn on hex/ascii printing of undecoded data inside parsed ssl records. used only with the -s option. this option uses the same output format as the -h option. -l prefix turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp 21 * imap 143 * imaps 993 (imap over ssl) * nntp 119 * nntps 563 (nntp over ssl) usage and examples you can use the ssl debugging tool to intercept any connection information. although y...
...And 7 more matches
NSS tools : ssltap
-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. nonprinting characters are replaced by dots. -f turn on fancy printing. output is printed in colored html. ...
...ata, 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. nonprinting characters are replaced by dots. -f turn on fancy printing. output is printed in colored html. data sent from the client to the server is in blue; the server's reply is in red. when used with looping mode, the different connections are separated with horizontal lines. you can use this option to upload the output into a browser. -s turn on ssl parsing and decoding. the tool does not automatically detect ssl sessions. if you are intercepting an ssl connection, use this option so that the tool can detect and decode ssl structures. if the tool detects a certificate chain, it saves the der-encoded certificates into files in ...
...x is the sequence number of the certificate. if the -s option is used with -h, two separate parts are printed for each record: the plain hex/ascii output, and the parsed ssl output. -x turn on hex/ascii printing of undecoded data inside parsed ssl records. used only with the -s option. this option uses the same output format as the -h option. -l prefix turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete. -p port change the default rendezvous port (1924) to another port. the following are well-known port numbers: * http 80 * https 443 * smtp 25 * ftp 21 * imap 143 * imaps 993 (imap over ssl) * nntp 119 * nntps 563 (nntp over ssl) usage and examples you can use the ssl debugging tool to intercept any connection information. although y...
...And 7 more matches
Observer Notifications
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 quit. this can be in response to a normal shutdown, or a restart. note: the data value for this notification is either 'shutdown' or 'restart'. profile-change-net-teardown the network connection is going offline at this point. note: the data value for this notification is always 'shutdown-persist'. profile-change-teardown part of the shutdown, profile data is still available at this point. note: the data value for this notification is always 'shutdown-persist'. profile-before-change called just before the profile is lost. note: the data valu...
...nner and outer windows for details about how the window hierarchy works. extensions that cache information about windows may wish to observe this so they can release information when the window is destroyed. the window id can be obtained from subject.queryinterface(components.interfaces.nsisupportspruint64).data outer-window-destroyed nsidomwindow called when an outer window is disconnected from its docshell. see inner and outer windows for details about how the window hierarchy works. extensions that cache information about windows may wish to observe this so they can release information when the window is destroyed. the window id can be obtained from subject.queryinterface(components.interfaces.nsisupportspruint64).data toplevel-window-ready nsiwindowwatcher cal...
...line-status-changed called when the offline state has changed. note: the data value for this notification 'offline' or 'online' to indicate the new state. network:link-status-changed called when the network link status changes. http requests these are the topics that you can observe during a http request (see setting http request headers and creating sandboxed http connections). both are passed an nsihttpchannel as the subject parameter. topic description http-on-modify-request called as a http request is made. the channel is available to allow you to modify headers and such. see this code snippet to learn how to get the tab that issued the request. http-on-opening-request similar to http-on-modify-request, but called earlier (s...
...And 7 more matches
CloseEvent - Web APIs
this is delivered to the listener indicated by the websocket object's onclose attribute. constructor closeevent() creates a new closeevent. properties this interface also inherits properties from its parent, event. closeevent.code read only returns an unsigned short containing the close code sent by the server. the following 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). ...
...xx 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 protocol error the endpoint is terminating the connection due to a protocol error. 1003 unsupported data ...
...cessfully 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 protocol error the endpoint is terminating the connection due to a protocol error. 1003 unsupported data the connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data). 1004 reserved. a meaning might be defined in the future. 1005 no status received reserved. indicates that no status code was provided even though one was expected. 1006 abnormal closure reserved...
...And 7 more matches
Network Information API - Web APIs
the network information api provides information about the system's connection in terms of general connection type (e.g., 'wifi', 'cellular', etc.). this can be used to select high definition content or low definition content based on the user's connection. the entire api consists of the addition of the networkinformation interface and a single property to the navigator interface: navigator.connection. note: this feature is available in web workers. examples detect connection changes this example watches for changes to the user's connection. ...
... be used to select high definition content or low definition content based on the user's connection. the entire api consists of the addition of the networkinformation interface and a single property to the navigator interface: navigator.connection. note: this feature is available in web workers. examples detect connection changes this example watches for changes to the user's connection. ...
... definition content or low definition content based on the user's connection. the entire api consists of the addition of the networkinformation interface and a single property to the navigator interface: navigator.connection. note: this feature is available in web workers. examples detect connection changes this example watches for changes to the user's connection. ...
...And 7 more matches
Visual typescript game engine - Game development
ns. npm install npm run build navigate in browser /build/app.html to see client app in action -the client part is a browser web application. no reloading or redirecting. this is a single page application. i use html request only for loading local/staged html (like register, login etc.). networking is based on websocket full-duplex communication only.you must be conform with classic socket connection methodology. webrtc can be used for any proportion. already implemented: -video chat webrtc (sip) chat and data communication. look back on main staff : -class 'connector' (native websocket) used for user session staff. for main account session staff like login, register etc. client config if you want web app without any networking then setup: appusenetwork: boolean = false; you wan...
...3; /** * domain is simple url address, * recommendent to use for local propose lan ip * like : 192.168.0.xxx if you wanna run ant test app with server. */ private domain: string = "maximumroulette.com"; /** * networkdeeplogs control of dev logs for webrtc context only. ...
...server. */ private domain: string = "maximumroulette.com"; /** * networkdeeplogs control of dev logs for webrtc context only. */ private networkdeeplogs: boolean = false; /** * masterserverkey is channel access id used to connect * multimedia server channel. */ private masterserverkey: string = "multi-platformer-sever1.maximum"; /** * rtcserverport port used to connect multimedia server. * default value is 12034 */ 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 */ ...
...And 6 more matches
Using XPCOM Components
to view, organize, or remove cookies that have been stored on the system, they are using the cookiemanager component behind the scenes. the cookie manager dialog shows user interface[cookie-manager-ui] that is presented to the user in mozilla for working with the cookiemanager component. the cookie manager dialog this dialog is written in xul and javascript, and uses a part of xpcom called xpconnect to seamlessly connect to the cookiemanager component (see connecting to components from the interface below). xul is just one way to expose the functionality of the cookiemanager component-but it's a particularly useful one in the mozilla world. the functionality of the cookiemanager component is available through the nsicookiemanager interface, which is comprised of the public methods in the ta...
...cookiemanager interface is called. the function is carried out by the cookiemanager component, and the selected cookie is deleted from disk and removed from the displayed list. ...
... .getservice(); cmgr = cmgr.queryinterface(components.interfaces.nsicookiemanager); // called as part of a largerdeleteallcookies() function function finalizecookiedeletions() { for (var c=0; c<deletedcookies.length; c++) { cmgr.remove(deletedcookies[c].host, deletedcookies[c].name, deletedcookies[c].path); } deletedcookies.length = 0; } connecting to components from the interface the mozilla user interface uses javascript that has been given access to xpcom components in the application core with a technology called xpconnect. xpconnect allows interface methods defined via xpidl to be called from javascript, as part of javascript objects that represent instances of components like the cookiemanager. xpconnect is what binds the applic...
...And 6 more matches
Use SQLite
table called attachments. you can see the schema for the attachments table in the code. to double check the information you've inserted you can query the tbird.sqlite file using regular sqlite programs. const cc = components.classes; const ci = components.interfaces; var tbirdsqlite = { onload: function() { // initialization code this.initialized = true; this.dbinit(); }, dbconnection: null, dbschema: { tables: { attachments:"id integer primary key, \ name text \ encoded text not null" } }, dbinit: function() { var dirservice = cc["@mozilla.org/file/directory_service;1"]. getservice(ci.nsiproperties); var dbfile = dirservice.get("profd", ci.nsifile); dbfile.append("tbir...
... text \ encoded text not null" } }, dbinit: function() { var dirservice = cc["@mozilla.org/file/directory_service;1"]. getservice(ci.nsiproperties); var dbfile = dirservice.get("profd", ci.nsifile); dbfile.append("tbird.sqlite"); var dbservice = cc["@mozilla.org/storage/service;1"]. ...
...text not null" } }, dbinit: function() { var dirservice = cc["@mozilla.org/file/directory_service;1"]. getservice(ci.nsiproperties); var dbfile = dirservice.get("profd", ci.nsifile); dbfile.append("tbird.sqlite"); var dbservice = cc["@mozilla.org/storage/service;1"]. ...
...And 6 more matches
RTCStatsReport - Web APIs
the rtcrtpreceiver and rtcrtpsender versions of getstats() specifically only return statistics available to the incoming or outgoing stream on which you call them. ...
...the rtcrtpreceiver and rtcrtpsender versions of getstats() specifically only return statistics available to the incoming or outgoing stream on which you call them. ...
...the rtcrtpreceiver and rtcrtpsender versions of getstats() specifically only return statistics available to the incoming or outgoing stream on which you call them. the statistics objects for each category of statistic information, there is a dictionary whose properties provide the relevant information. ...
...And 6 more matches
Using server-sent events - Web APIs
developing a web application that uses server-sent events is straightforward. you'll need a bit of code on the server to stream events to the front-end, but the client side code works almost identically to websockets in part of handling incoming events. this is one-way connection, so you can't send events from a client to a server. receiving events from the server the server-sent event api is contained in the eventsource interface; to open a connection to the server to begin receiving events from it, create a new eventsource object with the url of a script that generates the events. for example: const evtsource = new eventsource("ssedemo.php"); if the event generator script is hosted on a different origin, a new eventsource object should be created with both the url and an options dictiona...
...t.data).time; newelement.innerhtml = "ping at " + time; eventlist.appendchild(newelement); }); this code is similar, except that it will be called automatically whenever the server sends a message with the event field set to "ping"; it then parses the json in the data field and outputs that information. when not used over http/2, sse suffers from a limitation to the maximum number of open connections, which can be especially painful when opening multiple tabs, as the limit is per browser and is set to a very low number (6). the issue has been marked as "won't fix" in chrome and firefox. this limit is per browser + domain, which means that you can open 6 sse connections across all of the tabs to www.example1.com and another 6 sse connections to www.example2.com (per stackoverflow). when us...
...simple sse demo using php. error handling when problems occur (such as a network timeout or issues pertaining to access control), an error event is generated. you can take action on this programmatically by implementing the onerror callback on the eventsource object: evtsource.onerror = function(err) { console.error("eventsource failed:", err); }; closing event streams by default, if the connection between the client and server closes, the connection is restarted. the connection is terminated with the .close() method. evtsource.close(); event stream format the event stream is a simple stream of text data which must be encoded using utf-8. messages in the event stream are separated by a pair of newline characters. a colon as the first character of a line is in essence a comment, and is...
...And 6 more matches
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
this article provides an overview of what rtp is and how it functions in the context of webrtc. note: webrtc actually uses srtp (secure real-time transport protocol) to ensure that the exchanged data is secure and authenticated as appropriate. keeping latency to a minimum is especially important for webrtc, since face-to-face communication needs to be performed with as little latency as possible. ...
... key features of rtp before examining rtp's use in webrtc contexts, it's useful to have a general idea of what rtp does and does not offer. rtp is a data transport protocol, whose mission is to move data between two endpoints as efficiently as possible under current conditions. those conditions may be affected by everything from the underlying layers of the network stack to the physical network connection, the intervening networks, the performance of the remote endpoint, noise levels, traffic levels, and so forth. since rtp is simply a data transport, it is augmented by the closely-related rtp control protocol (rtcp), which is defined in rfc 3550, section 6. rtcp adds features including quality of service (qos) monitoring, participant information sharing, and the like. it isn't adequate for th...
... inherently offer any features that ensure qos. instead, it only offers the information necessary to allow qos to be implemented elsewhere in the stack. rtp doesn't handle allocation or reservation of resources that may be needed. where it matters for webrtc purposes, these are dealt with in a variety of places within the webrtc infrastructure. for example, rtcp handles qos monitoring. ...
...And 6 more matches
Introduction to WebRTC protocols - Web APIs
ice uses stun and/or turn servers to accomplish this, as described below. ...
...ice uses stun and/or turn servers to accomplish this, as described below. ...
...ice uses stun and/or turn servers to accomplish this, as described below. ...
...And 6 more matches
Event reference
event name fired when focus an element has received focus (does not bubble). blur an element has lost focus (does not bubble). focusin an element is about to receive focus (does bubble). focusout an element is about to lose focus (does bubble). websocket events event name fired when open a websocket connection has been established. message a message is received through a websocket. error a websocket connection has been closed with prejudice (some data couldn't be sent for example). close a websocket connection has been closed. session history events event name fired when pagehide a session history entry is being traversed fr...
...uccess upgradeneeded versionchange script events afterscriptexecute beforescriptexecute menu events dommenuitemactive dommenuiteminactive window events close popup events popuphidden popuphiding popupshowing popupshown tab events visibilitychange battery events chargingchange chargingtimechange dischargingtimechange levelchange call events alerting busy callschanged cfstatechange connecting dialing disconnected disconnecting error held, holding incoming resuming statechange voicechange sensor events compassneedscalibration devicemotion deviceorientation orientationchange smartcard events icccardlockerror iccinfochange smartcard-insert smartcard-remove stkcommand stksessionend cardstatechange sms and ussd events delivered received sent ussdreceived frame events mozbrowserc...
... capture audio for speech recognition. beforeprint event html5 the associated document is about to be printed or previewed for printing. beforeunload beforeunloadevent html5 the window, the document and its resources are about to be unloaded. beginevent timeevent svg a smil animation element begins. blocked indexeddb an open connection to a database is blocking a versionchange transaction on the same database. blur focusevent dom l3 an element has lost focus (does not bubble). boundary speechsynthesisevent web speech api the spoken utterance reaches a word or sentence boundary canplay event html5 media the user agent can play the media, but estimates that not enough d...
...And 6 more matches
Evolution of HTTP - HTTP
one-line protocol. http/0.9 – the one-line protocol the initial version of http had no version number; it has been later called 0.9 to differentiate it from the later versions. http/0.9 is extremely simple: requests consist of a single line and start with the only possible method get followed by the path to the resource (not the url as both the protocol, server, and port are unnecessary once connected 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 d...
...ocuments than plain html files has been added (thanks to the content-type header). ...
...rotocol in parallel to the somewhat chaotic use of the diverse implementations of http/1.0, and since 1995, well before the publication of http/1.0 document the next year, proper standardization was in progress. the first standardized version of http, http/1.1 was published in early 1997, only a few months after http/1.0. http/1.1 clarified ambiguities and introduced numerous improvements: a connection can be reused, saving the time to reopen it numerous times to display the resources embedded into the single original document retrieved. pipelining has been added, allowing to send a second request before the answer for the first one is fully transmitted, lowering the latency of the communication. chunked responses are now also supported. additional cache control mechanisms have been intro...
...And 6 more matches
Upgrade - HTTP
Web › HTTP › Headers › Upgrade
http/2 explicitly disallows the use of this mechanism/header; it is specific to http/1.1. header type request header, response header forbidden header name yes overview the upgrade header field may be used by clients to invite a server to switch to one (or more) of the listed protocols, in descending preference order. ...
... forbidden header name yes overview the upgrade header field may be used by clients to invite a server to switch to one (or more) of the listed protocols, in descending preference order. ...
... the upgrade header field may be used by clients to invite a server to switch to one (or more) of the listed protocols, in descending preference order. for example, the client might send a get request as shown, listing the preferred protocols to switch to (in this case "example/1" and "foo/2"): get /index.html http/1.1 host: www.example.com connection: upgrade upgrade: example/1, foo/2 note: connection: upgrade must be set whenever upgrade is sent. ...
...And 6 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
rouble with any of the details of the interface, it is helpful to search on the source code for usage examples within firefox. note: to look at the firefox 3 source code, choose "firefox 3" in the starting points list. for firefox 3.5 choose "mozilla 1.9.1." for the current development trunk of firefox, choose "mozilla central" and for thunderbird, choose "comm. central". calling xpcom from xpconnect use the xpconnect technology to use xpcom in javascript. listing 1 shows how you can use xpconnect to acquire references to xpcom services and create new xpcom objects. each component is identified with a contract id in the form @domain_name/module_name/component_name;version_number, and implements one or more interfaces that determine what functions can be called on these components. interface...
...be accessed with getservice(). for other components, you can create as many instances as you need. for instance, this is the case for files (nsilocalfile). those are created with createinstance(). it's important to know whether a component should be created with getservice() or createinstance(), because using one instead of the other can cause problems. ...
...g xpcom functions using xpconnect <?xml version="1.0" encoding="utf-8"?> <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript"><![cdata[ var ioservice = components.classes['@mozilla.org/network/io-service;1'] .getservice(components.interfaces.nsiioservice); alert(ioservice); ]]></script> </page> calling xpconnect using local files try saving the contents of listing 1 as the file test.xul, somewhere on your desktop, and drag and drop it into firefox to open it. you'll note that even though the file includes an alert method, nothing happens. this is a by-product of the fact that test.xul currently doesn’t have privileges. in order to use xpconnect, the file needs special universalxpconnect privileges. b...
...And 5 more matches
How do you upload your files to a web server? - Learn web development
rver) is a fictitious company "example hosting provider" whose urls look like this: mypersonalwebsite.examplehostingprovider.net. we have just opened an account and received this info from them: congratulations for opening an account at example hosting provider. your account is: demozilla your website will be visible at demozilla.examplehostingprovider.net to publish to this account, please connect through sftp with the following credentials: sftp server: sftp://demozilla.examplehostingprovider.net username: demozilla password: quickbrownfox port: 5548 to publish on the web, put your files into the public/htdocs directory. let's first look at http://demozilla.examplehostingprovider.net/ — as you can see, so far there is nothing there: note: depending on your hosting provider...
...ort: 5548 to publish on the web, put your files into the public/htdocs directory. let's first look at http://demozilla.examplehostingprovider.net/ — as you can see, so far there is nothing there: note: depending on your hosting provider, most of the time you'll see a page saying something like “this website is hosted by [hosting service].” when you first go to your web address. to connect your sftp client to the distant server, follow these steps: choose file > site manager... from the main menu. in the site manager window, press the new site button, then fill in the site name as demozilla in the provided space. fill in the sftp server your host provided in the host: field. in the logon type: drop down, choose normal, then fill in your provided username and password in the r...
...e manager window, press the new site button, then fill in the site name as demozilla in the provided space. fill in the sftp server your host provided in the host: field. in the logon type: drop down, choose normal, then fill in your provided username and password in the relevant fields. fill in the correct port and other information. ...
...And 5 more matches
sslintro.html
hich cipher suites are permitted by policy (for example, to comply with export restrictions). cipher suites disabled by policy cannot be enabled by user preference. one of these functions must be called before any cryptographic operations can be performed with nss. ssl_cipherprefsetdefault. enables all ciphers chosen by user preference. optional. ...
...hic operations can be performed with nss. ssl_cipherprefsetdefault. enables all ciphers chosen by user preference. optional. initializing caches ssl peers frequently reconnect after a relatively short time has passed. to avoid the overhead of repeating the full ssl handshake in situations like this, the ssl protocol supports the use of a session cache, which retains information about each connection, such as the master secret generated during the ssl handshake, for a predetermined length of time. if ssl can locate the information about a previous connection in the local session cache, it can reestablish the connection much more quickly than it can without the connection information. by default, ssl allocates one session cache. this default cache is called the client session id cache, (al...
...od. ssl_importfd. makes an nspr socket into an ssl socket. required. brings an ordinary nspr socket into the ssl library, returning a new nspr socket that can be used to make ssl calls. you can pass this function a model file descriptor to create the new ssl socket with the same configuration state as the model. it is also possible for an application to import a socket into ssl after the tcp connection on that socket has already been established. in this case, initial configuration takes place in the same way: pass the existing nspr file descriptor to ssl_importfd and perform any additional configuration that has not already been determined by the model file descriptor. configuration functions control the configuration of an individual socket. pr_getsocketoption. retrieves the socket o...
...And 5 more matches
nsIWebSocketChannel
ibute type description extensions acstring sec-websocket-extensions response header value. 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 the case of a redirect or uri "resolution" (for example resolving a resource: uri to a file: uri) so that the original pre-redirect uri can still be obtained. this is never null. read only. protocol acstring sec-websocket-protocol value. securityinfo nsisupports transport-level security information (if any). read only. uri nsiuri th...
...edirect or uri "resolution" (for example resolving a resource: uri to a file: uri) so that the original pre-redirect uri can still be obtained. this is never null. 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 ...
... 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 the endpoint is terminating the connection due to a protocol error. ...
...And 5 more matches
NetworkInformation.downlinkMax - Web APIs
the networkinformation.downlinkmax read-only property returns the maximum downlink speed, in megabits per second (mbps), for the underlying connection technology. note: this feature is available in web workers. syntax var max = networkinformation.downlinkmax return value an unrestricted double representing the maximum downlink speed, in megabits per second (mb/s), for the underlying connection technology. examples the following example monitors the connection using the change event and logs changes as they occur. ...
...nnection technology. note: this feature is available in web workers. syntax var max = networkinformation.downlinkmax return value an unrestricted double representing the maximum downlink speed, in megabits per second (mb/s), for the underlying connection technology. examples the following example monitors the connection using the change event and logs changes as they occur. ...
...e: this feature is available in web workers. syntax var max = networkinformation.downlinkmax return value an unrestricted double representing the maximum downlink speed, in megabits per second (mb/s), for the underlying connection technology. examples the following example monitors the connection using the change event and logs changes as they occur. ...
...And 5 more matches
RTCDataChannel.readyState - Web APIs
the read-only rtcdatachannel property readystate returns an enum of type rtcdatachannelstate which indicates the state of the data channel's underlying 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...
... "open" the underlying data transport has been established and data can be transferred bidirectionally across it. ...
... "open" the underlying data transport has been established and data can be transferred bidirectionally across it. this is the default state of a new rtcdatachannel created by the webrtc layer when the remote peer created the channel and delivered to the site or app in a datachannel event of type rtcdatachannelevent. ...
...And 5 more matches
RTCDtlsTransport.state - Web APIs
the state read-only property of the rtcdtlstransport interface provides information which describes a datagram transport layer security (dtls) transport state. syntax let mystate = dtlstransport.state; value a string whose value is taken from the rtcdtlstransportstate enumerated type. its value is one of the following: new the initial state when dtls has not started negotiating yet. connecting dtls is in the process of negotiating a secure connection and verifying the remote fingerprint. connected dtls has completed negotiation of a secure connection and verified the remote fingerprint. closed the transport has been closed intentionally as the result of receipt of a close_notify alert, or calling rtcpeerconnection.close(). failed the transport has failed as the result of an error...
...the remote fingerprint. closed the transport has been closed intentionally as the result of receipt of a close_notify alert, or calling rtcpeerconnection.close(). failed the transport has failed as the result of an error (such as receipt of an error alert or failure to validate the remote fingerprint). examples this example presents a function, tallysenders(), which iterates over an rtcpeerconnection's rtcrtpsenders, tallying up how many of them are in various states. the function returns an object containing properties whose values indicate how many of the senders are in each state. ...
...error (such as receipt of an error alert or failure to validate the remote fingerprint). examples this example presents a function, tallysenders(), which iterates over an rtcpeerconnection's rtcrtpsenders, tallying up how many of them are in various states. the function returns an object containing properties whose values indicate how many of the senders are in each state. let pc = new rtcpeerconnection({ bundlepolicy: "max-bundle" }); /* ... ...
...And 5 more matches
RTCIceTransportState - Web APIs
or the remote device to begin to transmit the remote candidates, or both. in this state, checking of candidates to look for those which might be acceptable has not yet begun. "checking" at least one remote candidate has been received, and the rtcicetransport has begun examining pairings of remote and local candidates in order to attempt to identify viable pairs that could be used to establish a connection. keep in mind that gathering of local candidates may still be underway, and, similarly, the remote device also may still be gathering candidates of its own. "connected" a viable candidate pair has been found and selected, and the rtcicetransport has connected the two peers together using that pair. however, there are still candidates pairings to consider, and there may still be gathering u...
... similarly, the remote device also may still be gathering candidates of its own. "connected" a viable candidate pair has been found and selected, and the rtcicetransport has connected the two peers together using that pair. however, there are still candidates pairings to consider, and there may still be gathering underway on one or both of the two devices. the transport may revert from the "connected" state to the "checking" state if either peer decides to cancel consent to use the selected candidate pair, and may revert to "disconnected" if there are no candidates left to check but one or both clients are still gathering candidates. "completed" the transport has finished gathering local candidates and has received a notification from the remote peer that no more candidates will be sent...
...lients are still gathering candidates. "completed" the transport has finished gathering local candidates and has received a notification from the remote peer that no more candidates will be sent. in addition, all candidate pairs have been considered and a pair has been selected for use. if consent checks fail on all successful candidate pairs, the transport state will change to "failed". "disconnected" the ice agent has determined that connectivity has been lost for this rtcicetransport. this is not a failure state (that's "failed"). a value of "disconnected" means that a transient issue has occurred that has broken the connection, but that should resolve itself automatically without your code having to take any action. see the disconnected state for additional details. "failed" the rtcic...
...And 5 more matches
Populating the page: how browsers work - Web Performance
ave to be made for each one. this can be problematic for performance, particularly on mobile networks. when a user is on a mobile network, each dns lookup has to go from the phone to the cell tower to reach an authoritative dns server. the distance between a phone, a cell tower, and the name server can add significant latency. tcp handshake once the ip address is known, the browser sets up a connection to the server via a tcp three-way handshake. this mechanism is designed so that two entities attempting to communicate—in this case the browser and web server—can negotiate the parameters of the network tcp socket connection before transmitting data, often over https. tcp's three way handshaking technique is often referred to as "syn-syn-ack"—or more accurately syn, syn-ack, ack—becau...
...smitting data, often over https. tcp's three way handshaking technique is often referred to as "syn-syn-ack"—or more accurately syn, syn-ack, ack—because there are three messages transmitted by tcp to negotiate and start a tcp session between two computers. yes, this means three more messages back and forth between each server, and the request has yet to be made. tls negotiation for secure connections established over https, another "handshake" is required. this handshake, or rather the tls negotiation, determines which cipher will be used to encrypt the communication, verifies the server, and establishes that a secure connection is in place before beginning the actual transfer of data. this requires three more round trips to the server before the request for content is actually sent. w...
... over https, another "handshake" is required. this handshake, or rather the tls negotiation, determines which cipher will be used to encrypt the communication, verifies the server, and establishes that a secure connection is in place before beginning the actual transfer of data. this requires three more round trips to the server before the request for content is actually sent. while making the connection secure adds time to the page load, a secure connection is worth the latency expense, as the data transmitted between the browser and the web server cannot be decrypted by a third party. ...
...And 5 more matches
The Joy of XUL - Archive of obsolete content
this guide is designed to introduce application developers and their managers to xul so they can not only understand why mozilla's platform is based on it, but how they might adopt it for their own use. xul (pronounced "zool") is mozilla's xml-based user interface language that lets you build feature rich cross-platform applications that can run connected to or disconnected from the internet. these applications are easily customized with alternative text, graphics, and layout so they can be readily branded or localized for various markets. web developers already familiar with dynamic html (dhtml) will learn xul quickly and can start building applications right away. also described are some reasons application developers might choose to leverage xul and mozilla technology for building cro...
...h to keep proprietary. the netscape public license (npl) and mozilla public license (mpl) require developers who alter original work (source code files that are provided with mozilla) to release the source code for these changes to their customers. overlays can be used to add features to mozilla without contaminating the original open source code with proprietary alterations. ...
...the netscape public license (npl) and mozilla public license (mpl) require developers who alter original work (source code files that are provided with mozilla) to release the source code for these changes to their customers. overlays can be used to add features to mozilla without contaminating the original open source code with proprietary alterations. ...
...And 4 more matches
Using the Right Markup to Invoke Plugins - Archive of obsolete content
itecture. here's an example of this kind of usage for ie: <!-- ie only code --> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="366" height="142" id="myflash"> <param name="movie" value="javascript-to-flash.swf" /> <param name="quality" value="high" /> <param name="swliveconnect" value="true" /> </object> in the above example, the classid attribute that goes along with the object element points to a "clsid:" urn followed by the unique identifier of an activex control (in the above example, the string beginning with "d27..."). this is, in fact, the unique identifier of macromedia's flash plugin, and developers are expected to know such unique identifiers in order to inv...
...illa-based browsers support the use of the object element along with a mime type. here is an example of this usage, once again for the macromedia flash plugin: <object type="application/x-shockwave-flash" data="javascript-to-flash.swf" width="366" height="142" id="myflash"> <param name="movie" value="javascript-to-flash.swf" /> <param name="quality" value="high" /> <param name="swliveconnect" value="true" /> <p>you need flash -- get the latest version from <a href= "http://www.macromedia.com/downloads/">here.</a></p> </object> in the above example, application/x-shockwave-flash is the flash mime type, and will invoke the netscape-specific flash architecture in mozilla-based browsers. the data attribute points to the swf file to play, and the configuration parameters (the pa...
... understands the mime type for flash: <!-- usage will not work as intended --> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="366" height="142" id="myflash"> <param name="movie" value="javascript-to-flash.swf" /> <param name="quality" value="high" /> <param name="swliveconnect" value="true" /> <object type="application/x-shockwave-flash" data="javascript-to-flash.swf" width="366" height="142" id="myflashnscp"> <param name="movie" value="javascript-to-flash.swf" /> <param name="quality" value="high" /> <param name="swliveconnect" value="true" /> <p>you need flash -- get the latest version from <a href="http://www.macromedia.com/downloads/"> here...
...And 4 more matches
ICE - MDN Web Docs Glossary: Definitions of Web-related terms
ice (interactive connectivity establishment) is a framework used by webrtc (among other technologies) for connecting two peers, regardless of network topology (usually for audio and video chat). this protocol lets two peers find and establish a connection with one another even though they may both be using network address translator (nat) to share a global ip address with other devices on their respective local networks. ...
...technologies) for connecting two peers, regardless of network topology (usually for audio and video chat). this protocol lets two peers find and establish a connection with one another even though they may both be using network address translator (nat) to share a global ip address with other devices on their respective local networks. ...
...(usually for audio and video chat). this protocol lets two peers find and establish a connection with one another even though they may both be using network address translator (nat) to share a global ip address with other devices on their respective local networks. ...
...And 4 more matches
How does the Internet work? - Learn web development
mmunicate all together. the history of the internet is somewhat obscure. it began in the 1960s as a us-army-funded research project, then evolved into a public infrastructure in the 1980s with the support of many public universities and private companies. the various technologies that support the internet have evolved over time, but the way it works hasn't changed that much: internet is a way to connect computers all together and ensure that, whatever happens, they find a way to stay connected. active learning how the internet works in 5 minutes: a 5 minute video to understand the very basics of internet by aaron titus. how does the internet work? detailed well visualized 8 minute video. deeper dive a simple network when two computers need to communicate, you have to link them, either p...
...: a 5 minute video to understand the very basics of internet by aaron titus. how does the internet work? detailed well visualized 8 minute video. deeper dive a simple network when two computers need to communicate, you have to link them, either physically (usually with an ethernet cable) or wirelessly (for example with wifi or bluetooth systems). ...
...computers need to communicate, you have to link them, either physically (usually with an ethernet cable) or wirelessly (for example with wifi or bluetooth systems). all modern computers can sustain any of those connections. note: for the rest of this article, we will only talk about physical cables, but wireless networks work the same. such a network is not limited to two computers. you can connect as many computers as you wish. but it gets complicated quickly. if you're trying to connect, say, ten computers, you need 45 cables, with nine plugs per computer! to solve this problem, each computer on a network is connected to a special tiny computer called a router. this router has only one job: like a signaler at a railway station, it makes sure that a message sent from a given computer ar...
...And 4 more matches
wrappedJSObject
wrappedjsobject is a property sometimes available on xpconnect wrappers. when available, it lets you access the javascript object hidden by the wrapper. there are two kinds of xpconnect wrappers that support the wrappedjsobject property: xpcnativewrappers which are used to protect the chrome code working with content objects. see xpcnativewrapper for detailed documentation. regular xpconnect wrappers which you can encounter, for example, when using xpcom components implemented in js. this article focuses on the latter kind of wrappers, which hide any properties or methods on the component that are not part of the supported interfaces as declared in xpidl. the rest of this article demonstrates what xpconnect wrappers do and how wrappedjsobject can be used to bypass them. example c...
...e @myself.com/my-component;1 contract. ...
...ce: function(aiid) { if (!aiid.equals(components.interfaces.nsisupports) && !aiid.equals(components.interfaces.nsihelloworld)) throw components.results.ns_error_no_interface; return this; } }; xpconnect wrapping now let's get a reference to our component. ...
...And 4 more matches
WebIDL bindings
you want here. return; } // for some reason we want to catch and rethrow exceptions from setsomenumber, say. acallback.setsomenumber(2*number, rv, erethrowexceptions); if (rv.failed()) { // the exception is now stored on rv. this code must report // it usefully; otherwise it will assert. } } external interfaces external interfaces are represented in c++ as objects that xpconnect knows how to unwrap to. this can mean xpcom interfaces (whether declared in xpidl or not) or it can mean some type that there's a castable native unwrapping function for. the c++ type to be used should be the nativetype listed for the external interface in the bindings.conf file. the exact representation depends on how the type is being used. arguments become nsifoo*. return values can be alr...
...ment, defaulting to ereportexceptions, and calling it will invoke the callable with undefined as the this value. the second call method allows passing in an explicit this value as the first argument. this second call method is a template on the type of the first argument, so the this value can be passed in in whatever form is most convenient, as long as it's either a type that can be wrapped by xpconnect or a webidl interface type. if areportexceptions is set to ereportexceptions, the call methods will report js exceptions before returning. if areportexceptions is set to erethrowexceptions, js exceptions will be stashed in the errorresult and will be reported when the stack unwinds to wherever the errorresult was set up. for example, this webidl: callback mycallback = long (myinterface arg1, ...
...gincallable] used to flag a method that, when called, will not have the same-origin constraint tested: it can be called from a context with a different origin. [securecontext] we implement the standard extended attribute with a few details specific to gecko: system principals are considered secure. an extension poking at non-secured dom objects will see apis marked with [securecontext]. xpconnect sandboxes doesn't see [securecontext] apis, but this may change in bug 1273687. [needssubjectprincipal], [getterneedssubjectprincipal], [setterneedssubjectprincipal] used to flag a method or an attribute that needs to know the subject principal. this principal will be passed as argument. if the interface is not exposed on any worker global, the argument will be a nsiprincipal& because a subje...
...And 4 more matches
EventSource - Web APIs
if there is an event field in the incoming message, the triggered event is the same as the event field value. if no event field is present, then a generic message event is fired. ...
...if there is an event field in the incoming message, the triggered event is the same as the event field value. if no event field is present, then a generic message event is fired. ...
...if there is an event field in the incoming message, the triggered event is the same as the event field value. if no event field is present, then a generic message event is fired. ...
...And 4 more matches
RTCConfiguration.bundlePolicy - Web APIs
the rtcconfiguration dictionary's bundlepolicy property is a string value indicating which sdp bundling policy, if any, to use for the underlying rtp streams used by an rtcpeerconnection. the configuration object is used as an input to the rtcpeerconnection() constructor. syntax let rtcconfiguration = { bundlepolicy: policy }; rtcconfiguration.bundlepolicy = policy; value a domstring identifying the sdp bundling policy to use for the rtp streams used by the rtcpeerconnection. this string, which must be a member of the rtcbundlepolicy enumeration, has the following possible values: balanced the ice agent begins by creating one rtcdtlstransport to handle each type of content added: one for audio, one for video, and one for the rtc data channel, if applicable. if the remote peer isn't ...
...ues: balanced the ice agent begins by creating one rtcdtlstransport to handle each type of content added: one for audio, one for video, and one for the rtc data channel, if applicable. if the remote peer isn't bundle-aware, the ice agent chooses one audio track and one video track and those two tracks are each assigned to the corresponding rtcdtlstransport. all other tracks are ignored by the connection. this is the default, and most compatible, policy. max-compat the ice agent intially creates one rtcdtlstransport for each media track and a separate one for the rtcdatachannel, if one is created. if the remote endpoint can't handle bundling, each media track is negotiated on its own separate transport. this introduces bundling but will fall back to not bundling if the remote peer can't hand...
...ne rtcdtlstransport for each media track and a separate one for the rtcdatachannel, if one is created. if the remote endpoint can't handle bundling, each media track is negotiated on its own separate transport. this introduces bundling but will fall back to not bundling if the remote peer can't handle it. ...
...And 4 more matches
Using WebRTC data channels - Web APIs
since all webrtc components are required to use encryption, any data transmitted on an rtcdatachannel is automatically secured using datagram transport layer security (dtls). see security below for more information. ...
... since all webrtc components are required to use encryption, any data transmitted on an rtcdatachannel is automatically secured using datagram transport layer security (dtls). see security below for more information. ...
...nnel can be created in one of two ways: let webrtc create the transport and announce it to the remote peer for you (by causing it to receive a datachannel event). this is the easy way, and works for a wide variety of use cases, but may not be flexible enough for your needs. write your own code to negotiate the data transport and write your own code to signal to the other peer that it needs to connect to the new channel. let's look at each of these cases, starting with the first, which is the most common. automatic negotiation often, you can allow the peer connection to handle negotiating the rtcdatachannel connection for you. to do this, simply call createdatachannel() without specifying a value for the negotiated property, or specifying the property with a value of false. this will auto...
...And 4 more matches
Using the Web Audio API - Web APIs
n a play button, for instance), we're in good shape and should have no problems from autoplay blocking. so, let's start by taking a look at our play and pause functionality. ...
...n the track is playing: <button data-playing="false" role="switch" aria-checked="false"> <span>play/pause</span> </button> before we can play our track we need to connect our audio graph from the audio source/input node to the destination. we've already created an input node by passing our audio element into the api. for the most part, you don't need to create an output node, you can just connect your other nodes to baseaudiocontext.destination, which handles the situation for you: track.connect(audiocontext.destination); a good way to visualise these nodes is by drawing an audio graph so you can visualize it. this is what our current audio graph looks like: now we can add the play and pause functionality. // select our play button const playbutton = document.queryselector('button'...
...epresents how big our sound wave is. there are two ways you can create nodes with the web audio api. you can use the factory method on the context itself (e.g. audiocontext.creategain()) or via a constructor of the node (e.g. new gainnode()). we'll use the factory method in our code: const gainnode = audiocontext.creategain(); now we have to update our audio graph from before, so the input is connected to the gain, then the gain node is connected to the destination: track.connect(gainnode).connect(audiocontext.destination); this will make our audio graph look like this: the default value for gain is 1; this keeps the current volume the same. gain can be set to a minimum of about -3.4 and a max of about 3.4. here we'll allow the boombox to move the gain up to 2 (double the original volum...
...And 4 more matches
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
here is a an example javascript function that prints the security details of an xmlhttprequest sent over ssl. the function is passed the channel property of an xmlhttprequest to extract the following information: was the connection secure? was the used ssl certificate valid and what are its details (owner, expiration, certificate authority, etc.)? notes: this code requires elevated privileges to run; you can only call it from a browser extension or from a xulrunner application. the channel property becomes available only after the request is sent and the connection was established, that is, on readystate loaded, interactive or completed. by setting the mozbackgroundrequest property of the request object and modifying the example appropriately, you can create your own alert dialog ...
... ssl_error_unsupported_version, ssl(9) errname = 'securityunsupportedtlsversionerror'; break; case 12: // ssl_error_bad_cert_domain, ssl(12) errname = 'securitycertificatedomainmismatcherror'; break; default: errname = 'securityerror'; break; } } } else { errtype = 'network'; switch (status) { // connect to host:port failed case 0x804b000c: // ns_error_connection_refused, network(13) errname = 'connectionrefusederror'; break; // network timeout error case 0x804b000e: // ns_error_net_timeout, network(14) errname = 'networktimeouterror'; break; // hostname lookup failed case 0x804b001e: // ns_error_unknown_host, network(30) errna...
...nd // contains a documented tcperror.webidl that maps all the error codes we use in // this file to slightly more readable explanations. ...
...And 4 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
Web › HTTP › CORS
rticle. simple requests some requests don’t trigger a cors preflight. those are called “simple requests” in this article, though the fetch spec (which defines cors) doesn’t use that term. ...
...eges: let's look at what the browser will send to the server in this case, and let's see how the server responds: get /resources/public-data/ http/1.1 host: bar.other user-agent: mozilla/5.0 (macintosh; intel mac os x 10.14; rv:71.0) gecko/20100101 firefox/71.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip,deflate connection: keep-alive origin: https://foo.example the request header of note is origin, which shows that the invocation is coming from https://foo.example. http/1.1 200 ok date: mon, 01 dec 2008 00:23:53 gmt server: apache/2 access-control-allow-origin: * keep-alive: timeout=2, max=100 connection: keep-alive transfer-encoding: chunked content-type: application/xml […xml data…] in response, the ...
...options request. let's look at the full exchange between client and server. ...
...And 4 more matches
Index - HTTP
Web › HTTP › Headers › Index
ve in a request is not implying that the same directive is to be given in the response. 20 clear-site-data http, http header, reference, header the clear-site-data header clears browsing data (cookies, storage, cache) associated with the requesting website. it allows web developers to have more control over the data stored locally by a browser for their origins. 21 connection http, headers, reference, web the connection general header controls whether or not the network connection stays open after the current transaction finishes. if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done. 22 content-disposition http, reference, header in a multipart/for...
...ed using https. 31 csp: child-src csp, directive, http, reference, security the deprecated http content-security-policy (csp) child-src directive defines the valid sources for web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>. for workers, non-compliant requests are treated as fatal network errors by the user agent. 32 csp: connect-src csp, directive, http, reference, security the http content-security-policy (csp) connect-src directive restricts the urls which can be loaded using script interfaces. the apis that are restricted are: 33 csp: default-src csp, directive, http, reference, security the http content-security-policy (csp) default-src directive serves as a fallback for the other csp f...
...thod, only if it has not been last modified after the given date. if the resource has been modified after the given date, the response will be a 412 (precondition failed) error. 82 index http, http header, index found 115 pages: 83 keep-alive general header, http, http header, reference the keep-alive general header allows the sender to hint about how the connection may be used to set a timeout and a maximum amount of requests. 84 large-allocation http, http header, non-standard, reference, response header, header the non-standard large-allocation response header tells the browser that the page being loaded is going to want to perform a large allocation. it is currently only implemented in firefox, but is harmless to send to every bro...
...And 4 more matches
HTTP headers - HTTP
Web › HTTP › Headers
contain more information about the resource to be fetched, or about the client requesting the resource. response headers hold additional information about the response, like its location or about the server providing it. entity headers contain information about the body of the resource, like its content length or mime type. headers can also be grouped according to how proxies handle them: connection keep-alive proxy-authenticate proxy-authorization te trailer transfer-encoding upgrade (see also protocol upgrade mechanism). end-to-end headers these headers must be transmitted to the final recipient of the message: the server for a request, or the client for a response. intermediate proxies must retransmit these headers unmodified and caches must store them. hop-by-hop headers ...
...ailer transfer-encoding upgrade (see also protocol upgrade mechanism). end-to-end headers these headers must be transmitted to the final recipient of the message: the server for a request, or the client for a response. intermediate proxies must retransmit these headers unmodified and caches must store them. hop-by-hop headers these headers are meaningful only for a single transport-level connection, and must not be retransmitted by proxies or cached. note that only hop-by-hop headers may be set using the connection general header. authentication www-authenticate defines the authentication method that should be used to access a resource. authorization contains the credentials to authenticate a user-agent with a server. proxy-authenticate defines the authentication method that sh...
...transmitted only if it has not been modified after the given date. this ensures the coherence of a new fragment of a specific range with previous ones, or to implement an optimistic concurrency control system when modifying existing documents. vary determines how to match request headers to decide whether a cached response can be used rather than requesting a fresh one from the origin server. connection management connection controls whether the network connection stays open after the current transaction finishes. keep-alive controls how long a persistent connection should stay open. content negotiation accept informs the server about the types of data that can be sent back. accept-charset which character encodings the client understands. accept-encoding the encoding algorithm...
...And 4 more matches
Network Error Logging - HTTP
s server failed due to reasons not covered by previous errors (e.g. servfail) dns.address_changed for security reasons, if the server ip address that delivered the original report is different to the current server ip address at time of error generation, the report data will be downgraded to only include information about this problem and the type set to dns.address_changed. ...
...rrors (e.g. servfail) dns.address_changed for security reasons, if the server ip address that delivered the original report is different to the current server ip address at time of error generation, the report data will be downgraded to only include information about this problem and the type set to dns.address_changed. ...
... reasons, if the server ip address that delivered the original report is different to the current server ip address at time of error generation, the report data will be downgraded to only include information about this problem and the type set to dns.address_changed. ...
...And 4 more matches
Proxy Auto-Configuration (PAC) file - HTTP
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. ...
...in that case, the next value will be used, etc. the browser will automatically retry a previously unresponsive proxy after 30 minutes. additional attempts will continue beginning at one hour, always adding 30 minutes to the elapsed time between attempts. if all proxies are down, and there was no direct option specified, the browser will ask if proxies should be temporarily igno...
.... in that case, the next value will be used, etc. the browser will automatically retry a previously unresponsive proxy after 30 minutes. additional attempts will continue beginning at one hour, always adding 30 minutes to the elapsed time between attempts. if all proxies are down, and there was no direct option specified, the browser will ask if proxies should be temporarily ignored, and direct connections attempted. after 20 minutes, the browser will ask if proxies should be retried, asking again after an additional 40 minutes. queries will continue, always adding 20 minutes to the elapsed time between queries. examples proxy w3proxy.netscape.com:8080; proxy mozilla.netscape.com:8081 primary proxy is w3proxy:8080; if that goes down start using mozilla:8081 until the primary proxy comes up...
...And 4 more matches
Using custom elements - Web Components
so: class wordcount extends htmlparagraphelement { constructor() { // always call super first in constructor super(); // element functionality written in here ... } } this is just a simple example, but there is more you can do here. it is possible to define specific lifecycle callbacks inside the class, which run at specific points in the element's lifecycle. for example, connectedcallback is invoked each time the custom element is appended into a document-connected element, while attributechangedcallback is invoked when one of the custom element's attributes is added, removed, or changed. you'll learn more about these in the using the lifecycle callbacks section below. there are two types of custom elements: autonomous custom elements are standalone — they don't i...
...ifferent: <ul is="expanding-list"> ... </ul> you use a <ul> element as normal, but specify the name of the custom element inside the is attribute. note: again, you can see the full javascript source code here. ...
... but specify the name of the custom element inside the is attribute. note: again, you can see the full javascript source code here. using the lifecycle callbacks you can define several different callbacks inside a custom element's class definition, which fire at different points in the element's lifecycle: connectedcallback: invoked each time the custom element is appended into a document-connected element. this will happen each time the node is moved, and may happen before the element's contents have been fully parsed. note: connectedcallback may be called once your element is no longer connected, use node.isconnected to make sure. disconnectedcallback: invoked each time the custom element is disconnected from the document's dom. adoptedcallback: invoked each time the custom...
...And 4 more matches
Remotely debugging Firefox for Metro - Archive of obsolete content
classic "desktop" mode on windows, mac os x, or linux, either on a separate computer or in a separate profile on the same computer. set up firefox for metro go to about:config in firefox for metro, and set the following required preference: devtools.debugger.remote-enabled = true you may also want to set these optional preferences: devtools.debugger.force-local = false (if you want to connect from a different machine over the network) devtools.debugger.remote-host (to change the tcp hostname where firefox will listen for connections) devtools.debugger.remote-port (to change the tcp port number where firefox will listen for connections) devtools.debugger.prompt-connection = false (allow connections without displaying a confirmation prompt. this can be a security risk, especially if...
...y if you also set the force-local preference to false.) set up firefox for desktop on the desktop, remote debugging is enabled by a setting in the toolbox. open the toolbox, click the "settings" button in the toolbar, and check "enable remote debugging" in the settings tab. if you're using a version of firefox older than 27, you'll need to restart the browser for the setting to take effect. ...
... on the desktop, remote debugging is enabled by a setting in the toolbox. open the toolbox, click the "settings" button in the toolbar, and check "enable remote debugging" in the settings tab. if you're using a version of firefox older than 27, you'll need to restart the browser for the setting to take effect. connecting on the desktop on the desktop, open the web developer menu and select "connect...". ...
...And 3 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
and include the path in your classpath environment variable. the code in listing 1 is a sample javascript script which incorporates java classes to handle the database query. ...
...iable. the code in listing 1 is a sample javascript script which incorporates java classes to handle the database query. ...
... ": " + rs.getobject( i ) + "\n" ); } print( "----------\n" ); } // cleanup rs.close(); stmt.close(); conn.close(); this code starts off by using a rhino function named importpackage which is just like using the import statement in java. here, we’re including all the classes in the java.sql namespace in the script. the appropriate database driver for mysql is loaded and the connection string to a database named rhino on my local machine is configured using the user account urhino with the password of prhino. the sql statement is prepared, executed, and printed with the help of the metadata obtained from the resultset. sample output is shown in listing 2. id: 1 first_name: sammy last_name: hamm department: it title: network administrator ---------- id: 2 first_name: nigel l...
...And 3 more matches
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. ...
... 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). ...
...to receive data, one can call pr_read or pr_recv. to send data, one can call pr_write, pr_writev, pr_send, or pr_transmitfile. ...
...And 3 more matches
Mozilla internal string guide
string types the c++ signatures follow the abstract-type convention described above, such that all method parameters are based on the abstract classes. the following table describes the purpose of each string type in idl. idl type c++ type purpose string char* raw character pointer to ascii (7-bit) string, no string classes used. high bit is not guaranteed across xpconnect boundaries. wstring char16_t* raw character pointer to utf-16 string, no string classes used. astring nsastring utf-16 string. acstring nsacstring 8-bit string. all bits are preserved across xpconnect boundaries. autf8string nsacstring utf-8 string. converted to utf-16 as necessary when value is used across xpconnect boundaries. ...
...the special javascript value undefined becomes the string "undefined". ...
...the implementation of getutf16string() will use aresult.assign to "return" the value. in setutf16string() the value of the string can be used through a variety of methods including iterators, promiseflatstring, and assignment to other strings. in getvalue(), the first parameter, akey, is treated as a raw sequence of 8-bit values. any non-ascii characters in akey will be preserved when crossing xpconnect boundaries. the implementation of getvalue() will assign a utf-8 encoded 8-bit string into aresult. if the this method is called across xpconnect boundaries, such as from a script, then the result will be decoded from utf-8 into utf-16 and used as a unicode value. choosing a string type it can be difficult to determine the correct string type to use for idl. the following points should help det...
...And 3 more matches
mozIStorageAggregateFunction
this is an interface that must be implemented by consumers. it allows consumers to add aggregate functions that are available to sql queries and triggers. an aggregate function is a function that returns one value from a series of values. there are a number of already defined aggregate functions provided by sqlite. objects implementing this interface can be registered with mozistorageconnection.createaggregatefunction(). storage/public/mozistorageaggregatefunction.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void onstep(in mozistoragevaluearray afunctionarguments); nsivariant onfinal(); methods onstep() this is called for each row of results returned by the...
...hod overview void onstep(in mozistoragevaluearray afunctionarguments); nsivariant onfinal(); methods onstep() this is called for each row of results returned by the query. the implementation should store or perform some work to prepare to return a value. note this callback is executed on the thread that the statement or trigger is executing on. if you use mozistorageconnection.executeasync() or, mozistoragestatement.executeasync() this callback will run on a different thread from the rest of your code. likewise, if you execute sql on a different thread, this callback will be executed on that thread. this callback should be reentrant if any of the above applies to your use of the storage apis! void onstep( in mozistoragevaluearray afunctionarguments ); paramet...
...ionarguments a mozistoragevaluearray holding the arguments passed in to the function. onfinal() this is called after all results have been obtained and notified via mozistorageaggregatefunction. the implementation should finish its calculations on the data, and return a result. note this callback is executed on the thread that the statement or trigger is executing on. if you use mozistorageconnection.executeasync() or, mozistoragestatement.executeasync() this callback will run on a different thread from the rest of your code. likewise, if you execute sql on a different thread, this callback will be executed on that thread. this callback should be reentrant if any of the above applies to your use of the storage apis! nsivariant onfinal() return value an nsivariant this is the return v...
...And 3 more matches
mozIStorageFunction
this is an interface that must be implemented by consumers. it allows consumers to add functions that are available to sql queries and triggers. there are a number of already defined functions provided by sqlite. objects implementing this interface can be registered with mozistorageconnection.createfunction(). storage/public/mozistoragefunction.idlscriptable please add a summary to this article. ...
...istoragefunction.idlscriptable please add a summary to this article. last changed in gecko 1.9.1.4 (firefox 3.5.4) inherits from: nsisupports method overview nsivariant onfunctioncall(in mozistoragevaluearray afunctionarguments); methods onfunctioncall() the implementation of the function. this is called by the database engine when the function registered with mozistorageconnection.createfunction() is used in an executing sql statement or trigger. note this callback is executed on the thread that the statement or trigger is executing on. if you use mozistorageconnection.executeasync() or, mozistoragestatement.executeasync() this callback will run on a different thread from the rest of your code. likewise, if you execute sql on a different thread, this callback will be...
...to your use of the storage apis! nsivariant onfunctioncall( in mozistoragevaluearray afunctionarguments ); parameters afunctionarguments a mozistoragevaluearray holding the arguments passed in to the function. return value an nsivariant this is the return value of the function. sample code both of the following code samples assume that the variable dbconn is an opened mozistorageconnection. javascript starting in gecko 1.9.1.4 (firefox 3.0.15), you can directly pass your function into the mozistorageconnection method mozistorageconnection, like this: dbconn.createfunction("square", 1, function(aarguments) { let value = aarguments.getint32(0); return value * value; }); // run some query that uses the function. let stmt = dbconn.createstatement("select square(value) fr...
...And 3 more matches
mozIStorageStatement
storage/public/mozistoragestatement.idlscriptable this interface lets you create and execute sql statements on a mozistorageconnection. inherits from: mozistoragevaluearray last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) for an introduction on how to use this interface, see the storage overview document. ...
... storage/public/mozistoragestatement.idlscriptable this interface lets you create and execute sql statements on a mozistorageconnection. inherits from: mozistoragevaluearray last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) for an introduction on how to use this interface, see the storage overview document. ...
...ublic/mozistoragestatement.idlscriptable this interface lets you create and execute sql statements on a mozistorageconnection. inherits from: mozistoragevaluearray last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) for an introduction on how to use this interface, see the storage overview document. ...
...And 3 more matches
MailNews fakeserver
to take into account a new handler. a handler will contain the following methods: <caption> handler methods </caption> name arguments returns notes [command] rest of sent line server's response the name is normalized to be uppercase. onerror command, rest of sent line server's response called if handler does not define the command function. onstartup none server's response called when a connection is made. onmultiline sent line server's response or nothing called when in multi-line mode. postcommand server object none called after every command. the server is smart about the responses and will normalize all 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 ...
... handler in handlers) { // this sets up the fake server var server = new nsmailserver(new handler(daemon)); // port to use. i tend to like using 1024 + default port number myself. // probably best to include as a constant somewhere. also, use something // larger than 1024 for best results. ...
...smailserver(new handler(daemon)); // port to use. i tend to like using 1024 + default port number myself. // probably best to include as a constant somewhere. also, use something // larger than 1024 for best results. server.start(port); // set up a nsimsgincomingserver locally localserver.someactionrequiringconnection(); server.performtest(); // nothing will be executed until the connection is closed // localserver.closecachedconnections() is generally a good way to do so server.resettest(); // set up second test server.performtest(); transaction = server.playtransaction(); // finished with tests server.stop(); } currently, fakeserver provides no means to keep a persistent connection past a test, requiring connections to be closed, possibly forcibly. alternativel...
...And 3 more matches
Network request details - Firefox Developer Tools
"name": "x-varnish", "value": "766019457, 417549316" } ] }, "request headers (665 b)": { "headers": [ { "name": "accept", "value": "*/*" }, { "name": "accept-encoding", "value": "gzip, deflate, br" }, { "name": "accept-language", "value": "en-us,en;q=0.5" }, { "name": "connection", "value": "keep-alive" }, { "name": "cookie", "value": "wmf-last-access=11-jun-2019; wmf-last-access-global=11-jun-2019; mwphp7seed=5c9; geoip=us:ny:port_jervis:41.38:-74.67:v4" }, { "name": "dnt", "value": "1" }, { "name": "host", "value": "en.wikipedia.org" }, { "name": "referer",...
...bug 1452715). params tab this tab displays the get parameters and post data of a request: response tab the complete content of the response. if the response is html, js, or css, it will be shown as text: if the response is json, it will be shown as an inspectable object: if the response is an image, the tab displays a preview: for network responses that are initiated by a websocket connection, the details pane shows any associated messages. for more information, see inspecting web sockets. cache tab if the response is cached (i.e. a 304), the cache tab displays details about that cached resource. these details include: last fetched: the date the resource was last fetched fetched count: the number of times in the current session that the resource has been fetched data size...
...ote: 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 a connection is released. dns resolution time taken to resolve a ...
...And 3 more matches
BaseAudioContext.createChannelMerger() - Web APIs
umber of channels in the input audio streams, which the output stream will contain; the default is 6 if this parameter is not specified. returns a channelmergernode. example the following example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. ...
... default is 6 if this parameter is not specified. returns a channelmergernode. example the following example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify both the index of the channel to connect from and the index of the channel to connect to. ...
... to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify both the index of the channel to connect from and the index of the channel to connect to. ...
...And 3 more matches
BaseAudioContext.createChannelSplitter() - Web APIs
of channels in the input audio stream that you want to output separately; the default is 6 if this parameter is not specified. returns a channelsplitternode. example the following simple example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. ...
...ault is 6 if this parameter is not specified. returns a channelsplitternode. example the following simple example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify the index of the channel to connect from and the index of the channel to connect to. ...
... need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify the index of the channel to connect from and the index of the channel to connect to. ...
...And 3 more matches
ChannelMergerNode - Web APIs
instance. properties no specific property; inherits properties from its parent, audionode. methods no specific method; inherits methods from its parent, audionode. example the following example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. ...
...onode. methods no specific method; inherits methods from its parent, audionode. example the following example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify both the index of the channel to connect from and the index of the channel to connect to. ...
... to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify both the index of the channel to connect from and the index of the channel to connect to. ...
...And 3 more matches
ChannelSplitterNode - Web APIs
e. properties no specific property; inherits properties from its parent, audionode. methods no specific method; inherits methods from its parent, audionode. example the following simple example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. ...
...ode. methods no specific method; inherits methods from its parent, audionode. example the following simple example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify the index of the channel to connect from and the index of the channel to connect to. ...
... need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify the index of the channel to connect from and the index of the channel to connect to. ...
...And 3 more matches
IDBDatabaseSync - Web APIs
important: the synchronous version 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 databasesync interface in the indexeddb api represents a synchronous connection to a database. method overview idbobjectstoresync createobjectstore (in domstring name, in domstring keypath, in optional boolean autoincrement) raises (idbdatabaseexception); idbobjectstoresync openobjectstore (in domstring name, in optional unsigned short mode) raises (idbdatabaseexception); void removeobjectstore (in domstring storename) raises (idbdatabaseexception); void setversion (in domst...
...has the null value when the database is first created. methods createobjectstore() creates and re...
...sion (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() creates and returns a new object store with the given name in the connected database. idb...
...And 3 more matches
PerformanceTiming - Web APIs
nse has been received. if there is no redirect, or if one of the redirects is not of the same origin, the value returned is 0. performancetiming.fetchstart read only when the browser is ready to fetch the document using an http request. this moment is before the check to any application cache. performancetiming.domainlookupstart read only when the domain lookup starts. if a persistent connection is used, or the information is stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart. performancetiming.domainlookupend read only when the domain lookup is finished. if a persistent connection is used, or the information is stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart. performancetiming.c...
...e or a local resource, the value will be the same as performancetiming.fetchstart. performancetiming.domainlookupend read only when the domain lookup is finished. if a persistent connection is used, or the information is stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart. performancetiming.connectstart read only when the request to open a connection is sent to the network. if the transport layer reports an error and the connection establishment is started again, the last connection establishment start time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. performancetiming.connectend read only when the connection is opened network. if the transport layer reports an error and th...
...n is sent to the network. if the transport layer reports an error and the connection establishment is started again, the last connection establishment start time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. performancetiming.connectend read only when the connection is opened network. if the transport layer reports an error and the connection establishment is started again, the last connection establishment end time is given. if a persistent connection is used, the value will be the same as performancetiming.fetchstart. a connection is considered as opened when all secure connection handshake, or socks authentication, is terminated. ...
...And 3 more matches
RTCIceServers.urls - Web APIs
Web › API › RTCIceServer › urls
ceserverurl | [ url1, ..., urln ], username: "webrtc", // optional credential: "turnpassword" // optional }; iceservers.push(iceserver); the value of this property may be specified as a single url or as an array of multiple urls. examples let's look a few examples of varying complexity. a single ice server this example creates a new rtcpeerconnection which will use a stun server at stunserver.example.org to negotiate connections. mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: "stun:stunserver.example.org" } ] }); notice that only the urls property is provided; the stun server doesn't require authentication, so this is all that's needed. a single ice server with authentication the second example creat...
...se a stun server at stunserver.example.org to negotiate connections. mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: "stun:stunserver.example.org" } ] }); notice that only the urls property is provided; the stun server doesn't require authentication, so this is all that's needed. a single ice server with authentication the second example creates a new rtcpeerconnection which will use a turn server at turnserver.example.org to negotiate connections. logging into the turn server will use the username "webrtc" and the creative password "turnpassword". ...
...at only the urls property is provided; the stun server doesn't require authentication, so this is all that's needed. a single ice server with authentication the second example creates a new rtcpeerconnection which will use a turn server at turnserver.example.org to negotiate connections. logging into the turn server will use the username "webrtc" and the creative password "turnpassword". mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: "turn:turnserver.example.org", username: "webrtc", credential: "turnpassword" } ] }); a single ice server with multiple urls the next example creates a new rtcpeerconnection which will use a single turn server which has multiple urls. this is useful if the server is, for example, available both on "turn" and "turns...
...And 3 more matches
RTCIceTransport - Web APIs
properties the rtcicetransport interface inherits properties from its parent, eventtarget. it also offers the following properties: component read only the ice component being used by the transport. the value is one of the strings from the rtcicetransport enumerated type: "rtp" or "rtsp". ...
...domstring whose value is one of the members of the rtcicerole enumerated type: "controlling" or "controlled"; this indicates whether the ice agent is the one that makes the final decision as to the candidate pair to use or not. state read only a domstring indicating what the current state of the ice agent is. the value of state can be used to determine whether the ice agent has made an initial connection using a viable candidate pair ("connected"), made its final selection of candidate pairs ("completed"), or in an error state ("failed"), among other states. see the rtcicetransportstate enumerated type for a complete list of states. methods also includes methods from eventtarget, the parent interface. getlocalcandidates() returns an array of rtcicecandidate objects, each describing one ...
... type for a complete list of states. methods also includes methods from eventtarget, the parent interface. getlocalcandidates() returns an array of rtcicecandidate 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.setlocaldescription() 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 en...
...And 3 more matches
RTCOfferOptions.iceRestart - Web APIs
the icerestart property of the rtcofferoptions dictionary is a boolean value which, when true, tells the rtcpeerconnection to start ice renegotiation. note: rather than manually creating and submitting an offer with icerestart set to true, you should consider calling the rtcpeerconnection method restartice() instead. syntax var options = { icerestart: trueorfalse }; value a boolean value indicating whether or not the rtcpeerconnection should generate new values for the connection's ice-ufrag and ice-pwd values, which will trigger ice renegotiation on the next message sent to the remote peer. ...
...e, you should consider calling the rtcpeerconnection method restartice() instead. syntax var options = { icerestart: trueorfalse }; value a boolean value indicating whether or not the rtcpeerconnection should generate new values for the connection's ice-ufrag and ice-pwd values, which will trigger ice renegotiation on the next message sent to the remote peer. usage notes when the rtcpeerconnection object's ice connection state changes to failed, you should try to trigger an ice restart. you should ideally do this by calling the rtcpeerconnection's restartice() method, if it's available. ...
...tes when the rtcpeerconnection object's ice connection state changes to failed, you should try to trigger an ice restart. you should ideally do this by calling the rtcpeerconnection's restartice() method, if it's available. fundamentally, this renegotiation is triggered by generating and using new values for the ice username fragment ("ufrag")}} example this example shows a handler for the iceconnectionstatechange 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. ...
...And 3 more matches
RTCStatsType - Web APIs
rings which define the type of statistics reported in a record found in the rtcstatsreport object. this type determines which of the rtcstats-based dictionaries the record is based upon. values candidate-pair an rtcicecandidatepairstats object providing statistics related to an rtcicetransport. candidate pairs other than the currently active pair for the transport are deleted when the rtcpeerconnection changes its rtcpeerconnection.icegatheringstate to new during an ice restart. the active candidate pair is deleted after the transport switches to another candidate pair; this change cannot be detected otherwise. certificate an rtccertificatestats object providing statistics related to a certificate being used by an rtcicetransport. codec an rtccodecstats object containing statistics about...
...e active candidate pair is deleted after the transport switches to another candidate pair; this change cannot be detected otherwise. certificate an rtccertificatestats object providing statistics related to a certificate being used by an rtcicetransport. codec an rtccodecstats object containing statistics about a codec currently being used by rtp streams to send or receive data for the rtcpeerconnection. csrc an rtccontributingsourcestats object which contains statistics related to a contributing source (csrc) that contributed to an inbound rtp stream. data-channel an rtcdatachannelstats object which contains statistics about each rtcdatachannel on the connection. inbound-rtp an rtcinboundrtpstreamstats object providing statistics about inbound data being received from remote peers. sin...
... local-candidate an rtcicecandidatestats object giving statistics about an ice local candidate; these candidates are found in the output from rtcicetransport.getlocalcandidates(). outbound-rtp the report is an rtcoutboundrtpstreamstats object providing statistics based on the local peer's outgoing data being sent to its peers. ...
...And 3 more matches
Using the Resource Timing API - Web APIs
ore details about the interfaces, including examples, see each interface's reference page and the references in the see also section. a live version of the examples is available on github, as is the source code. pull requests and bug reports are welcome. resource loading phases an application can get timestamps for the various phases of resource loading such as redirection, dns lookup, and tcp connection setup. those phases and their property names are illustrated in figure 1. figure 1. resource timing properties an application developer can use the property values to calculate the length of time a phase takes and that information can help diagnose performance issues. timing resource loading phases the following example illustrates using the resource timing properties to calculate the amo...
...he property values to calculate the length of time a phase takes and that information can help diagnose performance issues. timing resource loading phases the following example illustrates using the resource timing properties to calculate the amount of time the following phases take: redirection (redirectstart and redirectend ), dns lookup (domainlookupstart and domainlookupend), tcp handshake (connectstart and connectend), and response (responsestart and responseend). this example also calculates the time from the start of the fetch and request start phases (fetchstart and requeststart, respectively), until the response has ended (responseend). this timing data provides a detailed profile of the resource loading phases and this data can be used to help identify performance bottlenecks. functi...
...es.length; i++) { console.log("== resource[" + i + "] - " + resources[i].name); // redirect time var t = resources[i].redirectend - resources[i].redirectstart; console.log("... redirect time = " + t); // dns time t = resources[i].domainlookupend - resources[i].domainlookupstart; console.log("... dns lookup time = " + t); // tcp handshake time t = resources[i].connectend - resources[i].connectstart; console.log("... tcp time = " + t); // secure connection time t = (resources[i].secureconnectionstart > 0) ? (resources[i].connectend - resources[i].secureconnectionstart) : "0"; console.log("... secure connection time = " + t); // response time t = resources[i].responseend - resources[i].responsestart; console.log("... response time =...
...And 3 more matches
Example and tutorial: Simple synth keyboard - Web APIs
ion. <div class="settingsbar"> <div class="left"> <span>volume: </span> <input type="range" min="0.0" max="1.0" step="0.01" value="0.5" list="volumes" name="volume"> <datalist id="volumes"> <option value="0.0" label="mute"> <option value="1.0" label="100%"> </datalist> </div> we specify a default value of 0.5, and we provide a <datalist> element which is connected to the range using the name attribute to find an option list whose id matches; in this case, the data set is named "volume". this lets us provide a set of common values and special strings which the browser may optionally choose to display in some fashion; we provide names for the values 0.0 ("mute") and 1.0 ("100%"). the waveform picker on the right side of the settings bar, we place a label...
...innode = null; audiocontext is set to reference the global audiocontext object (or webkitaudiocontext if necessary). osclist is set up to be ready to contain a list of all currently-playing oscillators. it starts off empty, since there are none playing yet. mastergainnode is set to null; during the setup process, it will be configured to contain a gainnode which all playing oscillators will connect to and play through to allow the overall volume to be controlled using a single slider control. let keyboard = document.queryselector(".keyboard"); let wavepicker = document.queryselector("select[name='waveform']"); let volumecontrol = document.queryselector("input[name='volume']"); references to elements we'll need access to are obtained: keyboard is the container element into which the k...
... => concat(e, typeof k === 'string' && isenumerable(o, k) ? [[k, o[k]]] : []), []); }; } building the keyboard the setup() function is responsible for building the keyboard and preparing the app to play music. function setup() { notefreq = createnotetable(); volumecontrol.addeventlistener("change", changevolume, false); mastergainnode = audiocontext.creategain(); mastergainnode.connect(audiocontext.destination); mastergainnode.gain.value = volumecontrol.value; // create the keys; skip any that are sharp or flat; for // our purposes we don't need them. each octave is inserted // into a <div> of class "octave". notefreq.foreach(function(keys, idx) { let keylist = object.entries(keys); let octaveelem = document.createelement("div"); octaveelem.classname = "...
...And 3 more matches
Window - Web APIs
Web › API › Window
bient light levels changes window.ondevicemotion called if accelerometer detects a change (for mobile devices) window.ondeviceorientation called when the orientation is changed (for mobile devices) window.ondeviceorientationabsolute an event handler property for any device orientation changes. window.ondeviceproximity an event handler property for device proximity event window.ongamepadconnected represents an event handler that will run when a gamepad is connected (when the gamepadconnected event fires). window.ongamepaddisconnected represents an event handler that will run when a gamepad is disconnected (when the gamepaddisconnected event fires). window.onmozbeforepaint an event handler property for the mozbeforepaint event, which is sent before repainting the window if the event...
...y mouse button is pressed. globaleventhandlers.onmousemove called continously when the mouse is moved inside the window. globaleventhandlers.onmouseout called when the pointer leaves the window. globaleventhandlers.onmouseover called when the pointer enters the window globaleventhandlers.onmouseup called when any mouse button is released windoweventhandlers.onoffline called when network connection is lost. see offline event. windoweventhandlers.ononline called when network connection is established. see online event. windoweventhandlers.onpagehide called when the user navigates away from the page, before the onunload event. see pagehide event. windoweventhandlers.onpageshow called after all resources and the dom are fully loaded. see pageshow event. windoweventhandlers.onpopstate...
...hanges. copy fired when the user initiates a copy action through the browser's user interface. also available via the oncopy property. cut fired when the user initiates a cut action through the browser's user interface. also available via the oncut property. paste fired when the user initiates a paste action through the browser's user interface. also available via the onpaste property. connection events offline fired when the browser has lost access to the network and the value of navigator.online has switched to false. also available via the onoffline property. online fired when the browser has gained access to the network and the value of navigator.online has switched to true. also available via the ononline property. focus events blur fired when an element has lost fo...
...And 3 more matches
Understanding latency - Web Performance
latency is the time it takes for a packet of data to travel from source to a destination. in terms of performance optimization, it's important to optimize to reduce causes of lacency and to test site performance emulating high latency to optimizer for users with lousy connections. this article explains what latency is, how it impacts performance, how to measure latency, and how to reduce it. ...
... reduce it. what is latency? latency is generally considered to be the amount of time it takes from when a request is made by the user to the time it takes for the response to get back to that user. on a first request, for the first 14kb bytes, latency is longer because it includes a dns lookup, a tcp handshake, the secure tls negotiation. subsequent requests will have less latency because the connection to the server is already set. latency describes the amount of delay on a network or internet connection. low latency implies that there are no or almost no delays. high latency implies that there are many delays. one of the main aims of improving performance is to reduce latency. the latency associated with a single asset, especially a basic html page, may seem trivial. but websites generall...
... one of the main aims of improving performance is to reduce latency. the latency associated with a single asset, especially a basic html page, may seem trivial. but websites generally involve multiple requests: the html includes requests for multiple css, scripts, and media files. the greater the number and size of these requests, the greater the impact of high latency on user experience. on a connection with low latency, requested resources will appear almost immediately. on a connection with high latency, there will be a discernible delay between the time that a request is sent, and the resources are returned. we can determine the amount of latency by measuring the speed with which the data moves from one network location to another. latency can be measured one way, for example, the amount ...
...And 3 more matches
Using dns-prefetch - Web Performance
target a user tries to follow. why use dns-prefetch? when a browser requests a resource from a (third party) server, that cross-origin’s domain name must be resolved to an ip address before the browser can issue the request. this process is known as dns resolution. while dns caching can help to reduce this latency, dns resolution can add significant latency to requests. for websites that open connections to many third parties, this latency can significantly reduce loading performance. dns-prefetch helps developers mask dns resolution latency. the html <link> element offers this functionality by way of a rel attribute value of dns-prefetch. the cross-origin domain is then specified in the href attribute: syntax <link rel="dns-prefetch" href="https://fonts.gstatic.com/" > examples <html> ...
...d using it to point to your site or domain. this is because the ip behind your site’s domain will have already been resolved by the time the browser sees the hint. second, it’s also possible to specify dns-prefetch (and other resources hints) as an http header by using the http link field: link: <https://fonts.gstatic.com/>; rel=dns-prefetch third, consider pairing dns-prefetch with the preconnect hint. while dns-prefetch only performs a dns lookup, preconnect establishes a connection to a server. this process includes dns resolution, as well as establishing the tcp connection, and performing the tls handshake—if a site is served over https. combining the two provides an opportunity to further reduce the perceived latency of cross-origin requests. you can safely use them together like so...
...prefetch only performs a dns lookup, preconnect establishes a connection to a server. this process includes dns resolution, as well as establishing the tcp connection, and performing the tls handshake—if a site is served over https. combining the two provides an opportunity to further reduce the perceived latency of cross-origin requests. you can safely use them together like so: <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin> <link rel="dns-prefetch" href="https://fonts.gstatic.com/"> note: if a page needs to make connections to many third-party domains, preconnecting them all is counterproductive. the preconnect hint is best used for only the most critical connections. for the others, just use <link rel="dns-prefetch"> to save time on the first step — the dns looku...
...And 3 more matches
<metadata> - SVG: Scalable Vector Graphics
Web › SVG › Element › metadata
tes global attributes core attributes global event attributes specific attributes none dom interface this element implements the svgmetadataelement interface. ...
... global event attributes specific attributes none dom interface this element implements the svgmetadataelement interface. ...
...is element implements the svgmetadataelement interface. ...
...And 3 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
.org/thunderbird...oconfiguration . it's mission is to enable completely automatic configuration of mozilla's apps preferences based on users properties either retrieved from system environement variables or on an organisation ldap directory. situation int-evry manages about 3000 users (mostly students) who share computers in labs and "self service" computer rooms. ...
...choosing mozilla products allow us to use the same apps while running either windows or linux systems (i suspect mac osx would be fine too). instead of configuring end user individual preferences files (~/.mozilla/default/randomdir/prefs.js) we now use a centralized default set of preferences. ...
...ker_mode", "0"); lockpref("mail.identity.id1.organization", "int evry france"); lockpref("mail.identity.id1.overrideglobal_pref", true); lockpref("mail.identity.id1.reply_to", ""); //imap lockpref("mail.server.server2.hostname", "imap-int.int-evry.fr"); lockpref("mail.server.server2.issecure", true); lockpref("mail.server.server2.login_at_startup", true); lockpref("mail.server.server2.max_cached_connections", 5); //lockpref("mail.server.server2.name", "jehan.procaccia@int-evry.fr"); lockpref("mail.server.server2.type", "imap"); lockpref("mail.server.server2.username", env_user); //smtp lockpref("mail.identity.id1.smtpserver", "smtp1"); lockpref("mail.identity.id1.stationery_folder", "imap://" + env_user + "@imap-int.int-evry.fr/templates"); lockpref("mail.identity.id1.tmpl_folder_picker_mode", ...
...And 2 more matches
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
at the queries use syntax that is specific to xml. 952 textbox (xpfe autocomplete) xul elements, xul reference this element is created by setting the type attribute of a textbox to autocomplete. it is used to create a textbox with a popup containing a list of possible completions for what the user has started to type. ...
...these applications are easily customized with alternative text, graphics, and layout so they can be readily branded or localized for various markets. web developers already familiar with dynamic html (dhtml) will learn xul quickly and can start building applications right away. ...
...these applications are easily customized with alternative text, graphics, and layout so they can be readily branded or localized for various markets. web developers already familiar with dynamic html (dhtml) will learn xul quickly and can start building applications right away. ...
...And 2 more matches
Gecko Compatibility Handbook - Archive of obsolete content
you're using netscape 4.x and microsoft proprietary technologies, see using web standards in your web pages for a quick tutorial on what's different in gecko. aol or compuserve problems even if your site works on netscape 7.x, it is important to test your site in aol for macos and compuserve 7 to check for browser detection and network issues. ...
...see webmaster@aol for further information. ...
...see webmaster@aol for further information. ...
...And 2 more matches
Unconventional controls - Game development
to visit the leapjs repository on github to learn about the javascript client for the leap motion controller and read the documentation there. if all else fails, there's also a gallery of working examples you can look at. to get the leap motion working on your computer you have to first install it by following the steps at leapmotion.com/setup. when everything is installed and the controller is connected to your computer we can proceed with implementing support in our little demo. first, we add a <script> tag with the url pointing at this file, and add <div id="output"></div> just before the closing </body> tag for outputting diagnostic information. we will need a few helper variables for our code to work — one for the purpose of calculating the degrees from radians, two for holding the hori...
...; the min and max values are the minimum and the maximum distances respectively between which the sensor can detect the exact proximity value. all three are calculated in centimetres. note: see the deviceproximityevent reference page for more details. ...
...ut connecting real-world, conductive objects to a computer and using them as touch interfaces. check out the banana piano video, and be sure to visit the quick start guide for all the needed info. there's even a cylon.js-supported makey button functionality inspired by the makey makey board, so you can use the popular cylon robotics framework for your experiments with arduino or raspberry pi. ...
...And 2 more matches
Client-Server Overview - Learn web development
ion about a specific resource without getting the body like get would. you might for example use a head request to find out the last time a resource was updated, and then only use the (more "expensive") get request to download the resource if it has changed. put: update an existing resource (or create a new one if it doesn't exist). delete: delete the specified resource. trace, options, connect, patch: these verbs are for less common/advanced tasks, so we won't cover them here. additional information can be encoded with the request (for example, html form data). information can be encoded as: url parameters: get requests encode data in the url sent to the server by adding name/value pairs onto the end of it — for example http://mysite.com?name=fred&age=11. you always have ...
...the first part is called the header, and contains useful information about the request, in the same way that an html head contains useful information about an html document (but not the actual content itself, which is in the body): get https://developer.mozilla.org/search?q=client+server+overview&topic=apps&topic=html&topic=css&topic=js&topic=api&topic=webdev http/1.1 host: developer.mozilla.org connection: keep-alive pragma: no-cache cache-control: no-cache upgrade-insecure-requests: 1 user-agent: mozilla/5.0 (windows nt 10.0; wow64) applewebkit/537.36 (khtml, like gecko) chrome/52.0.2743.116 safari/537.36 accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 referer: https://developer.mozilla.org/ accept-encoding: gzip, deflate, sdch, br accept-charset: iso-8859-1,...
...e head also tells us how big it is (content-length: 41823). at the end of the message we see the body content — which contains the actual html returned by the request. ...
...And 2 more matches
Communicating with frame scripts
this takes two parameters: the name of the message and a listener function. the listener will be passed a message object whose data property is the message payload: // frame script function handlemessagefromchrome(message) { var payload = message.data.details; // "some more details" } addmessagelistener("my-addon@me.org:message-from-chrome", handlemessagefromchrome); message-manager-disconnect if you're using a message manager to communicate with a script that may be running in a different process, you can listen for the message-manager-disconnect observer notification to know when the message manager has disconnected from the other end of the conversation, so you can stop sending it messages or expecting to receive messages. for example, suppose we load a script into the current <br...
...wser> on some event, and keep the browser message manager in an array, so we can send it messages: var messagemanagers = []; ... ...
... in an array, so we can send it messages: var messagemanagers = []; ... ...
...And 2 more matches
Getting Started with Chat
20, mozilla moved away from irc to matrix for its public channels, the irc server was shut down. this page is being retained for historical and reference purposes. the general rules and etiquette are still useful for our new home. please see https://wiki.mozilla.org/matrix for up-to-date information. general rules and etiquette once you have your client set up (see software below) and are connected, there are some basic rules you should follow to ensure the most enjoyable and productive experience: as with all mozilla forums and events, agreeing to our community participation guidelines is a requirement for participation. try to keep messages as concise as possible. if you have something long to post, a code snippet for example, use paste.mozilla.org and paste the generated url in irc...
...m pst monday to friday, excluding us holidays. when asking a question, be patient. sometimes, it can take a few minutes for people to respond. posting a message like "help!" is not particularly helpful. asking a good question will result in a better experience for both you and the person trying to help. ...
...t can take a few minutes for people to respond. posting a message like "help!" is not particularly helpful. asking a good question will result in a better experience for both you and the person trying to help. relax and have fun! software there are several different applications which allow you to connect to irc networks. you will need to use the following information to configure the server connection: server: irc.mozilla.org port: 6667 (default) or 6697 (ssl) desktop clients desktop clients tens to allow the most detailed configuration. for example, you can connect using ssl or a non-secure connection, and you can configure the client to automatically connect to a server and join a particular set of channels when you start the client. the following are some other options available t...
...And 2 more matches
PR_Accept
if unsuccessful, null. ...
... if unsuccessful, null. ...
...include <prio.h> prfiledesc* pr_accept( prfiledesc *fd, prnetaddr *addr, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing the rendezvous socket on which the caller is willing to accept new connections. addr a pointer to a structure of type prnetaddr. on output, this structure contains the address of the connecting 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. des...
...And 2 more matches
PR_OpenTCPSocket
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. ...
...s 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). ...
...to receive data, one can call pr_read or pr_recv. to send data, one can call pr_write, pr_writev, pr_send, or pr_transmitfile. ...
...And 2 more matches
An overview of NSS Internals
r to granting validity to the certificate. in order to distinguish an ev certificate, cas will embed a policy oid in the certificate, and the browser is expected to verify that a trust chain permits the end entity (ee) certificate to make use of the policy. only the apis of the newer libpkix engine are capable of performing a policy verification. ...
...rtificate to make use of the policy. only the apis of the newer libpkix engine are capable of performing a policy verification. that's a good opportunity to talk about ssl/tls connections to servers in general (not just ev, not just websites). whenever this document mentions ssl, it refers to either ssl or tls. (tls is a newer version of ssl with enhanced features.) when establishing an ssl connection to a server, (at least) a server certificate (and its trust chain) is exchanged from the server to the client (e.g., the browser), and the client verifies that the certificate can be verified (including matching the name of the expected destination server). another part of the handshake between both parties is a key exchange. because public key encryption is more expensive (more calculations r...
...than symmetric encryption (where both parties use the same key), a key agreement protocol will be executed, where the public and private keys are used to proof and verify the exchanged initial information. once the key agreement is done, a symmetric encryption will be used (until a potential re-handshake on an existing channel). the combination of the hash and encryption algorithms used for a ssl connection is called a cipher suite. nss ships with a set of cipher suites that it supports at a technical level. in addition, nss ships with a default policy that defines which cipher suites are enabled by default. an application is able to modify the policy used at program runtime, by using function calls to modify the set of enabled cipher suites. if a programmer wants to influence how nss verif...
...And 2 more matches
HTTP delegation
it does so in a blocking fashion, and also directly to the responder, ignoring any proxy the application may wish to use. this causes ocsp requests to fail if the network environment requires the use of a proxy. there are two possible solutions to this limitation. instead of improving the simple http client in nss, the nss team has decided to provide an nss api to register application callback functions. if provided by the application, nss will use the registered http client for querying an oscp responder. this nss feature is currently targeted to first appear in nss version 3.11.1. ...
...es a simple function that accepts the uri and data to be sent, and returns the result data. but there is no such simple interface. the api should allow nss to use the http client either asynchronously or synchronously. in addition, during an application session with ocsp enabled, a large number of ocsp requests might have to be sent. therefore the api should allow for keep-alive (persistent) http connections. http uris consist of host:port and a path, e.g. http://ocsp.provider.com:80/cgi-bin/ocsp-responder if nss needs to access a http server, it will request that an "http server session object" be created (sec_httpserver_createsessionfcn). the http server session object is logically associated with host and port destination information, in our example this is "host ocsp.provider.com port 80". th...
...0/cgi-bin/ocsp-responder if nss needs to access a http server, it will request that an "http server session object" be created (sec_httpserver_createsessionfcn). the http server session object is logically associated with host and port destination information, in our example this is "host ocsp.provider.com port 80". the object may be used by the application to associate it with a physical network connection. (nss might choose to be smart, and only create a single http server session object for each server encountered. nss might also choose to be simple, and request multiple objects for the same server. the application must support both strategies.) the logical http server session object is expected to remain valid until explicitly destroyed (sec_httpserver_freesessionfcn). should the application ...
...And 2 more matches
HTTP delegation
it does so in a blocking fashion, and also directly to the responder, ignoring any proxy the application may wish to use. this causes ocsp requests to fail if the network environment requires the use of a proxy. there are two possible solutions to this limitation. instead of improving the simple http client in nss, the nss team has decided to provide an nss api to register application callback functions. if provided by the application, nss will use the registered http client for querying an oscp responder. this nss feature is currently targeted to first appear in nss version 3.11.1. ...
...es a simple function that accepts the uri and data to be sent, and returns the result data. but there is no such simple interface. the api should allow nss to use the http client either asynchronously or synchronously. in addition, during an application session with ocsp enabled, a large number of ocsp requests might have to be sent. therefore the api should allow for keep-alive (persistent) http connections. http uris consist of host:port and a path, e.g. http://ocsp.provider.com:80/cgi-bin/ocsp-responder if nss needs to access a http server, it will request that an "http server session object" be created (sec_httpserver_createsessionfcn). the http server session object is logically associated with host and port destination information, in our example this is "host ocsp.provider.com port 80". th...
...0/cgi-bin/ocsp-responder if nss needs to access a http server, it will request that an "http server session object" be created (sec_httpserver_createsessionfcn). the http server session object is logically associated with host and port destination information, in our example this is "host ocsp.provider.com port 80". the object may be used by the application to associate it with a physical network connection. (nss might choose to be smart, and only create a single http server session object for each server encountered. nss might also choose to be simple, and request multiple objects for the same server. the application must support both strategies.) the logical http server session object is expected to remain valid until explicitly destroyed (sec_httpserver_freesessionfcn). should the application ...
...And 2 more matches
sslerr.html
as received a certificate from the local system, and has determined that the certificate has been revoked. ssl_error_expired_cert_alert -12269 "ssl peer rejected your certificate as expired." the remote system has received a certificate from the local system, and has determined that the certificate has expired. ssl_error_ssl_disabled -12268 "cannot connect: ssl is disabled." the local socket is configured in such a way that it cannot use any of the ssl cipher suites. possible causes include: (a) both ssl2 and ssl3 are disabled, (b) all the individual ssl cipher suites are disabled, or (c) the socket is configured to handshake as a server, but the certificate associated with that socket is inappropriate for the key exchange algorithm selec...
...n such a way that it cannot use any of the ssl cipher suites. possible causes include: (a) both ssl2 and ssl3 are disabled, (b) all the individual ssl cipher suites are disabled, or (c) the socket is configured to handshake as a server, but the certificate associated with that socket is inappropriate for the key exchange algorithm selected. ssl_error_fortezza_pqg -12267 "cannot connect: ssl peer is in another fortezza domain." the local system and the remote system are in different fortezza domains. they must be in the same domain to communicate. ssl_error_unknown_cipher_suite -12266 "an unknown ssl cipher suite has been requested." the application has attempted to configure ssl to use an unknown cipher suite. ssl_error_no_cip...
...peer system has a flawed implementation of ssl, and is violating the ssl specification. ssl_error_tx_record_too_long -12262 "ssl attempted to send a record that exceeded the maximum permissible length." this error should never occur. if it does, it indicates a flaw in the nss ssl library. ssl_error_close_notify_alert -12230 "ssl peer has closed this connection." the local socket received an ssl3 alert record from the remote peer, reporting that the remote peer has chosen to end the connection. the receipt of this alert is an error only if it occurs while a handshake is in progress. ssl_error_pub_key_size_limit_exceeded -12210 "ssl server attempted to use domestic-grade public key with export cipher suite." on...
...And 2 more matches
History Service Design
ice.idl) is the core of places, every other places service depends on it to correctly work, so it gets always initialized at application startup. actual tasks executed by this service include: database creation, maintenance and initialization: all services rely on a common shared database called places.sqlite. history service checks for database existance and coherence, and initializes the connection through the storage service. history management: provides basic and advanced apis to store and modify visits and page details. relevance calculation: maintain and expire frecency values for pages. history expiration: expire old visits and invalid informations from the database. queries creation: allows the creation for complex queries. queries results maintenance:...
...y values for pages. history expiration: expire old visits and invalid informations from the database. queries creation: allows the creation for complex queries. queries results maintenance: allows easy access to queries results. charset for pages: allows setting and reading charset for each page. database maintenance at startup the service creates an exclusive storage connection to places.sqlite, the exclusive locking is needed for both a perf gain and data-safety. in case the database is missing a new one is created, if instead the database exists but the connection to it fails due to database corruption, the corrupt database is moved away and a new one is created. in both cases an implementer can know what did happen at startup and act accordingly (maybe restoring a...
...schema version is upgraded every time a change is made to the database schema, history service will eventually upgrade the database, moving and fixing its datas accordingly. ...
...And 2 more matches
Language bindings
other languages for which xpcom bindings exist to access these modules. since the xpcom layer itself is written in c/c++, its api can be accessed out-of-the-box using c or c++. in order to allow any other language to use the xpcom api, a bridging layer is required. ...
...ther language to use the xpcom api, a bridging layer is required. the following bridging layers are currently available: components objectthe components object is the object through which xpconnect functionality is reflected into javascript. ...
...ue or false respectively.components.lastresultcomponents.managercomponents.manager is a convenience reflection of the global native component manager service. the scriptable methods on the nsicomponentmanager interface can be called directly on this object.components.resultscomponents.results is a read-only object whose properties are the names listed as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at table of errors), with the value of each corresponding to that constant's value.components.returncodecomponents.stackcomponents.stack is a read only property of type nsistackframe (idl definition) that represents a snapshot of the current javascript callstack. this can be used for various diagnostic purposes.components.utilscomponents.utils is a collection of various useful x...
...And 2 more matches
mozIStorageProgressHandler
the mozistorageprogresshandler interface lets storage consumers receive callbacks during the execution of sqlite requests. storage/public/mozistorageprogresshandler.idlscriptable please add a summary to this article. ...
... the mozistorageprogresshandler interface lets storage consumers receive callbacks during the execution of sqlite requests. storage/public/mozistorageprogresshandler.idlscriptable please add a summary to this article. ...
...1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview boolean onprogress(in mozistorageconnection aconnection); methods onprogress() the onprogress() method is called periodically while an sqlite operation is ongoing. this allows you to monitor the progress and possibly display status information to the user. boolean onprogress( in mozistorageconnection aconnection ); parameters <tt>aconnection</tt> a mozistorageconnection connection indicating the connection for which the callback was invoked. return value return true to abort the request or false to allow it to continue. ...
...And 2 more matches
nsINetworkLinkService
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 only. linkstatusknown boolean this is set to true when we believe that islinkup is accurate. read only. ...
...s a service: var networklinkservice = components.classes["@mozilla.org/network/network-link-service;1"] .getservice(components.interfaces.nsinetworklinkservice); attributes attribute type description islinkup boolean this is set to true when the system is believed to have a usable network connection. 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 only. linkstatusknown boolean this is set to true when we believe that islinkup is accurate. read only. linktype unsigned long the type of ...
... 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 only. linkstatusknown boolean this is set to true when we believe that islinkup is accurate. read only. linktype 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 ...
...And 2 more matches
nsIProtocolProxyService
exception ns_base_stream_would_block to indicate that it failed due to this flag being present. methods resolve() deprecated since gecko 18 this method has been removed in firefox 18. use resolveasync instead previous doc this method returns a nsiproxyinfo instance that identifies a proxy to be used for loading the given uri. otherwise, this method returns null indicating that a direct connection should be used. if this proxy is unavailable, getfailoverforproxy() may be called to determine the correct secondary proxy to be used. if the protocol handler for the given uri supports nsiproxiedprotocolhandler, then the nsiproxyinfo instance returned from resolve may be passed to the nsiproxiedprotocolhandler.newproxiedchannel() method to create a nsichannel to the given uri that uses th...
...nsiproxiedprotocolhandler. nsiproxyinfo resolve( in nsiuri auri, in unsigned long aflags ); parameters auri the uri to test. aflags a bit-wise combination of the resolve_ flags defined above. pass 0 to specify the default behavior. any additional bits that do not correspond to a resolve_ flag are reserved for future use. return value an nsiproxyinfo object or null for a direct connection. note: if pac is configured, and the pac file has not yet been loaded, then this method will return a nsiproxyinfo instance with a type of "unknown" to indicate to the consumer that asyncresolve should be used to wait for the pac file to finish loading. otherwise, the consumer may choose to treat the result as type "direct" if desired. see nsiproxiedprotocolhandler.newproxiedchannel(). asyn...
...ation. if canceled, the cancellation status (areason) will be forwarded to the callback's nsiprotocolproxycallback.onproxyavailable() method via the astatus parameter. newproxyinfo() this method may be called to construct a nsiproxyinfo instance from the given parameters. this method may be useful in conjunction with nsisockettransportservice.createtransport() for creating, for example, a socks connection. nsiproxyinfo newproxyinfo( in acstring atype, in autf8string ahost, in long aport, in unsigned long aflags, in unsigned long afailovertimeout, in nsiproxyinfo afailoverproxy ); parameters atype the proxy type is a string value that identifies the proxy type. standard values are: "http" - specifies a http proxy "https" - specifies a https proxy "socks" - specifies a ...
...And 2 more matches
nsIRadioInterfaceLayer
llcallback(in nsirildatacallback callback); attributes attribute type description currentstate jsval read only. obsolete since gecko 13.0 microphonemuted bool radiostate jsval read only. ...
...back callback); attributes attribute type description currentstate jsval read only. obsolete since gecko 13.0 microphonemuted bool radiostate jsval read only. ...
...nce gecko 13.0 microphonemuted bool radiostate jsval read only. ...
...And 2 more matches
nsIServerSocket
netwerk/base/public/nsiserversocket.idlscriptable please add a summary to this article. last changed in gecko 1.6 inherits from: nsisupports implemented by: @mozilla.org/network/server-socket;1. ...
...se(); void asynclisten(in nsiserversocketlistener alistener); prnetaddr getaddress();native code only! attributes attribute type description port long returns the port of this server socket. 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 asynclisten() (the calling thread must have an nsieventtarget). the listener will be passed a reference to an already connected socket transport (nsisockettransport). see nsiserversocketlistener for more details. void asyncli...
...ed() method will be called on the same thread that called asynclisten() (the calling thread must have an nsieventtarget). the listener will be passed a reference to an already connected socket transport (nsisockettransport). see nsiserversocketlistener for more details. void asynclisten( in nsiserversocketlistener alistener ); parameters alistener the listener to be notified when client connections are accepted. close() this method closes a server socket. this does not affect already connected client sockets (i.e., the nsisockettransport instances created from this server socket). this will cause the onstoplistening event to asynchronously fire with a status of ns_binding_aborted. void close(); parameters none. native code only!getaddress returns the address to which this server...
...And 2 more matches
Drawing shapes with canvas - Web APIs
the top left corner of the blue square becomes x pixels from the left and y pixels from the top, at coordinate (x,y). later in this tutorial we'll see how we can translate the origin to a different position, rotate the grid and even scale it, but for now we'll stick to the default. drawing rectangles unlike svg, <canvas> only supports two primitive shapes: rectangles and paths (lists of points connected by lines). all other shapes must be created by combining one or more paths. luckily, we have an assortment of path drawing functions which make it possible to compose very complex shapes. first let's look at the rectangle. there are three functions that draw rectangles on the canvas: fillrect(x, y, width, height) draws a filled rectangle. strokerect(x, y, width, height) draws a rectangul...
...tangular outline 50x50 pixels within the cleared square. in upcoming pages we'll see two alternative methods for clearrect(), and we'll also see how to change the color and stroke style of the rendered shapes. unlike the path functions we'll see in the next section, all three rectangle functions draw immediately to the canvas. drawing paths now let's look at paths. a path is a list of points, connected by segments of lines that can be of different shapes, curved or not, of different width and of different color. a path, or even a subpath, can be closed. to make shapes using paths, we take some extra steps: first, you create the path. then you use drawing commands to draw into the path. once the path has been created, you can stroke or fill the path to render it. here are the functions ...
...function. you can probably best think of this as lifting a pen or pencil from one spot on a piece of paper and placing it on the next. moveto(x, y) moves the pen to the coordinates specified by x and y. when the canvas is initialized or beginpath() is called, you typically will want to use the moveto() function to place the starting point somewhere else. we could also use moveto() to draw unconnected paths. take a look at the smiley face below. to try this for yourself, you can use the code snippet below. just paste it into the draw() function we saw earlier. <html> <body onload="draw();"> <canvas id="canvas" width="150" height="150"></canvas> </body> </html> function draw() { var canvas = document.getelementbyid('canvas'); if (canvas.getcontext) { var ctx = canvas.getco...
...And 2 more matches
GamepadEvent.gamepad - Web APIs
%d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); value a gamepad object. ...
...%d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); value a gamepad object. ...
...%d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); value a gamepad object. ...
...And 2 more matches
IDBDatabase - Web APIs
the interface provides the only way to get and manage versions of the database. note: this feature is available in web workers. note: everything you do in indexeddb always happens in the context of a transaction, representing interactions with data in the database. all objects in indexeddb — including object stores, indexes, and cursors — are tied to a particular transaction. thus, you cannot execute commands, access data, or open anything outside of a transaction. ...
... methods inherits from: eventtarget idbdatabase.close() ret...
...-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbdatabase</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties idbdatabase.name read only a domstring that contains the name of the connected database. idbdatabase.version read only a 64-bit integer that contains the version of the connected database. when a database is first created, this attribute is an empty string. idbdatabase.objectstorenames read only a domstringlist that contains a list of the names of the object stores currently in the connected database. methods inherits from: eventtarget idbdatabase.close() returns immediately and closes the connection to a database in a separate thread. idbdatabase.createmutab...
...And 2 more matches
Basic concepts - Web APIs
ay for you to persistently store data inside a user's browser. because it lets you create web applications with rich query abilities regardless of network availability, these applications can work both online and offline. indexeddb is useful for applications that store a large amount of data (for example, a catalog of dvds in a lending library) and applications that don't need persistent internet connectivity to work (for example, mail clients, to-do lists, and notepads). about this document this introduction discusses essential concepts and terminology in indexeddb. it gives you the big picture and explains key concepts. you'll find the following useful: for an overview of the design and structure of indexeddb, see big concepts. to learn more about indexeddb terms, see the definitions se...
...rent one. this will start a versionchange transaction and fire an upgradeneeded event. the only place where the schema of the database can be updated is inside the handler of that event. note: this definition describes the most recent specification, which is only implemented in up-to-date browsers. old browsers implemented the now deprecated and removed idbdatabase.setversion() method. ...
...only place where the schema of the database can be updated is inside the handler of that event. note: this definition describes the most recent specification, which is only implemented in up-to-date browsers. old browsers implemented the now deprecated and removed idbdatabase.setversion() method. database connection an operation created by opening a database. a given database can have multiple connections at the same time. ...
...And 2 more matches
PerformanceResourceTiming.responseEnd - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged. ...
...events are logged. ...
...And 2 more matches
RTCDataChannel: open event - Web APIs
ransport used to send and receive the data channel's messages is opened or re-opened. ...
... cancelable no interface rtcdatachannelevent event handler property onopen examples this example adds to the rtcdatachannel dc a handler for the open event that adjusts the user interface to indicate that a chat window is ready to be used after a connection has been established. it enables the message input box and send button as well as enabling the disconnect button and disabling the connect button. ...
... chat window is ready to be used after a connection has been established. it enables the message input box and send button as well as enabling the disconnect button and disabling the connect button. finally, the message input box is focused so the user can immediately begin to type. dc.addeventlistener("open", ev => { messageinputbox.disabled = false; sendmessagebutton.disabled = false; disconnectbutton.disabled = false; connectbutton.disabled = true; messageinputbox.focus(); }, false); this can also be done by directly setting the value of the channel's onopen event handler property. ...
...And 2 more matches
RTCDataChannel - Web APIs
the rtcdatachannel interface represents a network channel which can be used for bidirectional peer-to-peer transfers of arbitrary data. every data channel is associated with an rtcpeerconnection, and each peer connection can have up to a theoretical maximum of 65,534 data channels (the actual limit may vary from browser to browser). to create a data channel and ask a remote peer to join you, call the rtcpeerconnection's createdatachannel() method. the peer being invited to exchange data receives a datachannel event (which has type rtcdatachannelevent) to let it know the data channel has been added to the connection. propertiesalso inherits properties from: eventtargetbinarytype the property binarytype on the rtcdatachannel interface is a domstring which specifies the type of javascript object...
... created, or null.maxretransmits read only the read-only rtcdatachannel property maxretransmits returns the maximum number of times the browser should try to retransmit a message before giving up, as set when the data channel was created, or null, which indicates that there is no maximum.negotiated read only the read-only rtcdatachannel property negotiated indicates whether the rtcdatachannel's connection was negotiated by the web app (true) or by the webrtc layer (false).ordered read only the read-only rtcdatachannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered.protocol read only the read-only rtcdatachannel property protocol returns a domstring containing th...
...nly rtcdatachannel property protocol returns a domstring containing the name of the subprotocol in use. ...
...And 2 more matches
RTCIceCandidateStats.networkType - Web APIs
note: the networktype property is only included in rtcicecandidatestats objects for local candidates (that is, candidates generated locally and included in an sdp offer or answer that has been sent to the remote peer). syntax networktype = rtcicecandidatestats.networktype; value a domstring whose value is taken from the rtcnetworktype enumerated type. ...
... and included in an sdp offer or answer that has been sent to the remote peer). syntax networktype = rtcicecandidatestats.networktype; value a domstring whose value is taken from the rtcnetworktype enumerated type. the string indicates the type of network connection that the described candidate would use to communicate with the other peer. the permitted values are: bluetooth a bluetooth connection is used by the described connection. cellular the connection uses a cellular data service to connect. ...
...ates the type of network connection that the described candidate would use to communicate with the other peer. the permitted values are: bluetooth a bluetooth connection is used by the described connection. cellular the connection uses a cellular data service to connect. this includes all cellular data services including edge (2g), hspa (3g), lte (4g), and nr (5g). ethernet the described connection uses an ethernet network. wifi the described connection uses wifi. wimax the described connection uses a wimax network. vpn the connection uses a virtual private network (vpn). the vpn obscures the underlying network type, which is not discernible. unknown the user's browser is unable or unwilling to identify the underlying connection technology used by the described connection. this m...
...And 2 more matches
RTCIceServer - Web APIs
the rtciceserver dictionary defines how to connect to a single ice server (such as a stun or turn server). objects of this type are provided in the configuration of an rtcpeerconnection, in the iceservers array. properties credential optional the credential to use when logging into the server. this is only used if the rtciceserver represents a turn server. credentialtype optional if the rtciceserver represents a turn server, this attribute specifies what kind of credential is to be used when connecting. this must be one of the values defined by the rtcicecredentialtype enum. the default is password. urls this required property is either a single domstring or an array of domstrings, each specifying a url which can be used to connect to the server. username optional if the rtciceserver ...
...every server in the list will be contacted and tried out before one is selected to be used for negotiation. ...
... ...
...And 2 more matches
RTCIceTcpCandidateType - Web APIs
usage notes the rtcicetcpcandidatetype type is used by the tcptype property of rtcicecandidate objects. ...
... usage notes the rtcicetcpcandidatetype type is used by the tcptype property of rtcicecandidate objects. ...
... usage notes the rtcicetcpcandidatetype type is used by the tcptype property of rtcicecandidate objects. ...
...And 2 more matches
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
you can examine, try out, and experiment with this example on glitch. example in this example, we have a pair of functions: the first, networkteststart(), captures an initial report, and the second, networkteststop(), captures a second report, then uses the two reports to output some information about the network conditions... xxx ... ...
...a second report, then uses the two reports to output some information about the network conditions... xxx ... networkteststart() this function simply calls the rtcpeerconnection method getstats() to request an rtcstatsreport and store it in the variable startreport. let startreport; async function networkteststart(pc) { if (pc) { startreport = await pc.getstats(); } } given an rtcpeerconnection, pc, this calls its getstats() method to obtain a statistics report object, which it stores in startreport for use once the end-of-test data has been collected by networkteststop(). networkteststop() the networkteststop() function obtains a second report, endreport, then uses the two reports together to determine several... xxx ... finding paired statistics each statistics record of type r...
...te over the map's values() to examine each of the rtcstats-based statistics records in the report until we find one that has the key property with the specified value. when a match is found, the statistics object is returned. if no match is found, the function returns null. the main networkteststop() function now let's look at the networkteststop() function itself. it takes as input the rtcpeerconnection being tested, calls getstats() to get a new rtcstatsreport with current statistics, then computes the results it's looking for, outputting those results as appropriate to the user by appending appropriate html to the contents of the <div> element whose class is stats-box. async function networkteststop(pc) { if (pc) { let statsbox = document.queryselector(".stats-box"); let endrepor...
...And 2 more matches
RTCSessionDescription - Web APIs
properties the rtcsessiondescription interface doesn't inherit any properties. ...
... properties the rtcsessiondescription interface doesn't inherit any properties. ...
... properties the rtcsessiondescription interface doesn't inherit any properties. ...
...And 2 more matches
RTCTrackEvent - Web APIs
the webrtc api interface rtctrackevent represents the track event, which is sent when a new mediastreamtrack is added to an rtcrtpreceiver which is part of the rtcpeerconnection. the target is the rtcpeerconnection object to which the track is being added. this event is sent by the webrtc layer to the web site or application, so you will not typically need to instantiate an rtctrackevent yourself. constructor rtctrackevent() creates and returns a new rtctrackevent object, initialized with properties taken from the specified rtctrackeventinit dictionary. you will probably not need to create new track events yourself, since they're typically created by the webrtc infrastructure and sent to the connection's ontrack event handler. properties since rtctrackevent is based on event, its proper...
...e specified rtctrackeventinit dictionary. you will probably not need to create new track events yourself, since they're typically created by the webrtc infrastructure and sent to the connection's ontrack event handler. properties since rtctrackevent is based on event, its properties are also available. receiver read only the rtcrtpreceiver used by the track that's been added to the rtcpeerconnection. streams read only optional an array of mediastream objects, each representing one of the media streams to which the added track belongs. by default, the array is empty, indicating a streamless track. track read only the mediastreamtrack which has been added to the connection. transceiver read only the rtcrtptransceiver being used by the new track. track event types there is only o...
...ch representing one of the media streams to which the added track belongs. by default, the array is empty, indicating a streamless track. track read only the mediastreamtrack which has been added to the connection. transceiver read only the rtcrtptransceiver being used by the new track. track event types there is only one type of track event. track the track event is sent to the rtcpeerconnection when a new track has been added to the connection. by the time the track event is delivered to the rtcpeerconnection's ontrack handler, the new media has completed its negotiation for a specific rtcrtpreceiver (which is specified by the event's receiver property). in addition, the mediastreamtrack specified by the receiver's track is the same one specified by the event's track, and the track ...
...And 2 more matches
ScriptProcessorNode.bufferSize - Web APIs
worki...
... working draft ...
... working draft ...
...And 2 more matches
WebSocket - Web APIs
Web › API › WebSocket
the websocket object provides the api for creating and managing a websocket connection to a server, as well as for sending and receiving data on the connection. to construct a websocket, use the websocket() constructor. constructor websocket(url[, protocols]) returns a newly created websocket object. constants constant value websocket.connecting 0 websocket.open 1 websocket.closing 2 websocket.closed 3 properties websocket.binarytype the binary data type used by the connection. websocket.bufferedamount read only the number of bytes of queued data. websocket.extensions read only the extensions selected by the server. websocket.onclose an event listener to be called when the connection is closed. websocket.one...
...of queued data. websocket.extensions read only the extensions selected by the server. websocket.onclose an event listener to be called when the connection is closed. websocket.onerror an event listener to be called when an error occurs. websocket.onmessage an event listener to be called when a message is received from the server. websocket.onopen an event listener to be called when the connection is opened. websocket.protocol read only the sub-protocol selected by the server. websocket.readystate read only the current state of the connection. websocket.url read only the absolute url of the websocket. methods websocket.close([code[, reason]]) closes the connection. websocket.send(data) enqueues data to be transmitted. events listen to these events using addeventliste...
...read only the current state of the connection. websocket.url read only the absolute url of the websocket. methods websocket.close([code[, reason]]) closes the connection. websocket.send(data) enqueues data to be transmitted. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. close fired when a connection with a websocket is closed. also available via the onclose property error fired when a connection with a websocket has been closed because of an error, such as when some data couldn't be sent. also available via the onerror property. message fired when data is received through a websocket. also available via the onmessage property. ...
...And 2 more matches
Writing a WebSocket server in Java - Web APIs
introduction this example shows you how to create a websocket api server using oracle java. although other server-side languages can be used to create a websocket server, this example uses oracle java to simplify the example code. this server conforms to rfc 6455, so it only handles connections from chrome version 16, firefox 11, ie 10 and higher. first steps websockets communicate over a tcp (transmission control protocol) connection. java's serversocket class is located in the java.net package. serversocket constructor: serversocket(int port) when you instantiate the serversocket class, it is bound to the port number you specified by the port argument. here's an implementation split into parts: import java.io.ioexception; import java.io.inputstream; import java.io.outputstr...
... java.net.socket getoutputstream() returns an output stream for this socket. outputstream methods: write(byte[] b, int off, int len) writes len bytes from the specified byte array starting at offset off t...
... java.net.socket getoutputstream() returns an output stream for this socket. outputstream methods: write(byte[] b, int off, int len) writes len bytes from the specified byte array starting at offset off to this output stream. inputstream methods: read(byte[] b, int off, int len) reads...
...And 2 more matches
Audio and video manipulation - Developer guides
b audio api has a lot of different filter/effects that can be applied to audio using the biquadfilternode, for example. ...
... different filter/effects that can be applied to audio using the biquadfilternode, for example. ...
...n" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> filter.type = "lowshelf"; filter.frequency.value = 1000; filter.gain.value = 25;</textarea> var context = new audiocontext(), audiosource = context.createmediaelementsource(document.getelementbyid("my-video")), filter = context.createbiquadfilter(); audiosource.connect(filter); filter.connect(context.destination); var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var edit = document.getelementbyid('edit'); var code = textarea.value; function setfilter() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; setfilter(); }); edit.addeventlistener('click', function() { ...
...And 2 more matches
Content-Security-Policy - HTTP
rectives fetch directives control the locations from which certain resource types may be loaded. child-src defines the valid sources for web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>. instead of child-src, if you want to regulate nested browsing contexts and workers, you should use the frame-src and worker-src directives, respectively. connect-src restricts the urls which can be loaded using script interfaces default-src serves as a fallback for the other fetch directives. font-src specifies valid sources for fonts loaded using @font-face. frame-src specifies valid sources for nested browsing contexts loading using elements such as <frame> and <iframe>. img-src specifies valid sources of images and favicons. manifest-src spe...
... policy of the document or worker that created it. multiple content security policies the csp mechanism allows multiple policies being specified for a resource, including via the content-security-policy header, the content-security-policy-report-only header and a <meta> element. you can use the content-security-policy header more than once, as in the example below. pay special attention to the connect-src directive here. even though the second policy would allow the connection, the first policy contains connect-src 'none'. adding additional policies can only further restrict the capabilities of the protected resource, which means that there will be no connection allowed and, as the strictest policy, connect-src 'none' is enforced. content-security-policy: default-src 'self' http://example.com...
...hough the second policy would allow the connection, the first policy contains connect-src 'none'. adding additional policies can only further restrict the capabilities of the protected resource, which means that there will be no connection allowed and, as the strictest policy, connect-src 'none' is enforced. ...
...And 2 more matches
Keep-Alive - HTTP
chrome and firefox ignore them in http/2 responses, but safari conforms to the http/2 spec requirements and won’t load any response which contains them. ...
...chrome and firefox ignore them in http/2 responses, but safari conforms to the http/2 spec requirements and won’t load any response which contains them. ...
...chrome and firefox ignore them in http/2 responses, but safari conforms to the http/2 spec requirements and won’t load any response which contains them. ...
...And 2 more matches
Link - HTTP
Web › HTTP › Headers › Link
ink> element. syntax link: < uri-reference >; param1=value1; param2="value2" <uri-reference> the uri reference, must be enclosed between < and >. parameters the link header contains parameters, which are separated with ; and are equivalent to attributes of the <link> element. ...
...>; param1=value1; param2="value2" <uri-reference> the uri reference, must be enclosed between < and >. parameters the link header contains parameters, which are separated with ; and are equivalent to attributes of the <link> element. ...
...s parameters, which are separated with ; and are equivalent to attributes of the <link> element. ...
...And 2 more matches
HTTP Messages - HTTP
Web › HTTP › Messages
messages are how data is exchanged between a server and a client. there are two types of messages: requests sent by the client to trigger an action on the server, and responses, the answer from the server. http messages are composed of textual information encoded in ascii, and span over multiple lines. in http/1.1, and earlier versions of the protocol, these messages were openly sent across the connection. in http/2, the once human-readable message is now divided up into http frames, providing optimization and performance improvements. web developers, or webmasters, rarely craft these textual http messages themselves: software, a web browser, proxy, or web server, perform this action. they provide http messages through config files (for proxies or servers), apis (for browsers), or other interf...
... it can be an absolute path, ultimately followed by a '?' and query string. this is the most common form, known as the origin form, and is used with get, post, head, and options methods. ...
... /test.html?query=alibaba http/1.1 options /anypage.html http/1.0 a complete url, known as the absolute form, is mostly used with get when connected to a proxy. get http://developer.mozilla.org/docs/web/http/messages http/1.1 the authority component of a url, consisting of the domain name and optionally the port (prefixed by a ':'), is called the authority form. it is only used with connect when setting up an http tunnel. connect developer.mozilla.org:80 http/1.1 the asterisk form, a simple asterisk ('*') is used with options, representing the server as a whole. options * http/1.1 the http version, which defines the structure of the remaining message, acting as an indicator of the expected version to use for the response. headers http headers from a request follo...
...And 2 more matches
A typical HTTP session - HTTP
Web › HTTP › Session
in client-server protocols, like http, sessions consist of three phases: the client establishes a tcp connection (or the appropriate connection if the transport layer is not tcp). the client sends its request, and waits for the answer. the server processes the request, sending back its answer, providing a status code and appropriate data. as of http/1.1, the connection is no longer closed after completing the third phase, and the client is now granted a further request: this means the second and third phases can now be performed any number of times. establishing a connection in client-server protocols, it is the client which establishes the connection. opening a connection in http means initiating a connection in the underlying transport layer, usually this is tcp. with tcp the default...
... is 80. see identifying resources on the web for more details. note: the client-server model does not allow the server to send data to the client without an explicit request for it. to work around this problem, web developers use several techniques: ping the server periodically via the xmlhttprequest, fetch apis, using the websockets api, or similar protocols. sending a client request once the connection is established, the user-agent can send the request (a user-agent is typically a web browser, but can be anything else, a crawler, for example). a client request consists of text directives, separated by crlf (carriage return, followed by line feed), divided into three blocks: the first line contains a request method followed by its parameters: the path of the document, i.e. an absolu...
... also be nouns, these requests methods are sometimes referred as http verbs. the most common requests are get and post: the get method requests a data representation of the specified resource. requests using get should only retrieve data. the post method sends data to a server so it may change its state. this is the method often used for html forms. structure of a server response after the connected agent has sent its request, the web server processes it, and ultimately returns a response. similar to a client request, a server response is formed of text directives, separated by crlf, though divided into three blocks: the first line, the status line, consists of an acknowledgment of the http version used, followed by a status request (and its brief meaning in human-readable text). subse...
...And 2 more matches
Transport Layer Security - Web security
this article's goal is to help you make these decisions to ensure the confidentiality and integrity communication between client and server. the mozilla operations security (opsec) team maintains a wiki entry with reference configurations for servers. the transport layer security (tls) protocol is the standard for enabling two networked applications or devices to exchange information privately and robustly. applications that use tls can choose their security parameters, which can have a substantial impact on the security and reliability of data. ...
... communication verify that the other party is who they claim to be. encryption data is encrypted while being transmitted between the user agent and the server, in order to prevent it from being read and interpreted by unauthorized parties. integrity tls ensures that between encrypting, transmitting, and decrypting the data, no information is lost, damaged, tampered with, or falsified. a tls connection starts with a handshake phase where a client and server agree on a shared secret and important parameters, like cipher suites, are negotiated. once parameters and a data exchange mode where application data, such http, is exchanged. cipher suites the primary parameters that the tls handshake negotiates is a cipher suite. in tls 1.2 and earlier, the negotiated cipher suite includes a set of ...
...ards. the cipher names correspondence table on the mozilla opsec team's article on tls configurations lists these names as well as information about compatibility and security levels. configuring your server correctly configuring your server is crucial. in general, you should try to limit cipher support to the newest ciphers possible which are compatible with the browsers you want to be able to connect to your site. the mozilla opsec guide to tls configurations provides more information on recommended configurations. to assist you in configuring your site, mozilla provides a helpful tls configuration generator that will generate configuration files for the following web servers: apache nginx lighttpd haproxy amazon web services cloudformation elastic load balancer using the configurat...
...And 2 more matches
Index of archived content - Archive of obsolete content
adding sidebars adding windows and dialogs appendix a: add-on performance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loading scripts appendix e: dom building and insertion (html & xul) appendix f: monitoring dom changes connecting to remote content custom xul elements with xbl getting started with firefox extensions handling preferences intercepting page loads introduction javascript object management local storage mozilla documentation roadmap observer notifications setting up a de...
...inds its configuration files how thunderbird and firefox find their configuration files introduction kill the xul.mfl file for good locked config settings other mozilla customization pages protecting mozilla's registry.dat file automatically handle failed asserts in debug builds blackconnect blackwood bonsai bookmark keywords build building transformiix standalone chromeless compiling the npruntime sample plugin in visual studio creating a firefox sidebar extension creating a microsummary creating a mozilla extension adding the structure ...
...ed) e4x e4x for templating processing xml with e4x e4x tutorial accessing xml children descendants and filters introduction namespaces the global xml object iterator liveconnect liveconnect overview liveconnect reference jsexception jsobject msx emulator (jsmsx) old proxy api parallelarray properly using css and javascript in xhtml documents examples ...
... making sure your theme works with rtl locales theme changes in firefox 2 theme changes in firefox 3 theme changes in firefox 3.5 theme changes in firefox 4 updating an extension to support multiple mozilla applications using firebug and jquery (screencast) using io timeout and interrupt on nt using ssh to connect to cvs using web standards in your web pages developing cross-browser and cross-platform pages references summary of changes using the w3c dom using workers in extensions web standards choosing standards compliance over proprietary practices community ...
Monitoring WiFi access points - Archive of obsolete content
code with universalxpconnect privileges can monitor the list of available wifi access points to obtain information about them including their ssid, mac address, and signal strength. this capability was introduced primarily to allow wifi-based location services to be used by geolocation services. example this example simply displays a list of the available access points. ...
...y was introduced primarily to allow wifi-based location services to be used by geolocation services. example this example simply displays a list of the available access points. ...
...oints.length; i++) { var a = accesspoints[i]; d.innerhtml += "<p>" + a.mac + " " + a.ssid + " " + a.signal + "</p>"; } var c = document.getelementbyid("c"); c.innerhtml = "<p>" + count++ + "</p>"; }, onerror: function (value) { alert("error: " +value); }, queryinterface: function(iid) { netscape.security.privilegemanager.enableprivilege('universalxpconnect'); if (iid.equals(components.interfaces.nsiwifilistener) || iid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_error_no_interface; }, } netscape.security.privilegemanager.enableprivilege('universalxpconnect'); var listener = new test(); var wifi_service = components.classes["@mozilla.org/wifi/monitor;1"].getse...
... </head> <body> <div id="d"><p></p></div> <div id="c"><p></p></div> </body> </html> the nsiwifilistener object the first thing the code above does is to prototype the listener object that will be receiving notifications of changes to the access point list. this object is described in lines 11 through 40 in the code above. the onchange() method (lines 13 through 27) begins by enabling universalxpconnect privileges, then clearing out the div (d) that will receive the updated list of access points. then the loop in lines 19-22 iterates over the list of access points received in the accesspoints array and adds them to the html in the div. then the c div is updated with the number of times the list has been refreshed. the onerror() method simply opens an alert that displays the error code received. ...
Mozilla Application Framework in Detail - Archive of obsolete content
ross-platform, full-featured, mature and well-tested layout engine available, providing robust and high quality support for a massive array of standards. its ability to render web content correctly is exceptional. gecko consists roughly of an html parser and xml parser, a dom implementation, a css parser and style system, and the code for css-based and html-based layout and rendering. as personal connectivity expands from the desktop computer to new web-enabled products and devices, gecko is a browser engine that has been designed from the ground up to power a new generation of desktop browsers and browsing devices and to accelerate the growth and development of the next-generation internet. small, fast and standards compliant, gecko is easily embeddable across platforms in browsers, desktop appl...
...ssing memory management this component object model makes virtually all of the functionality of gecko available as a series of components, or reusable cross-platform libraries, that can be accessed from the browser or scripted from any mozilla application. applications that want to access the various mozilla xpcom libraries (networking, security, dom, etc.) use a special layer of xpcom called xpconnect, which reflects the library interfaces into javascript (or other languages). xpconnect glues the front end to the c++-based components in xpcom, and it can be extended to include scripting support for other languages: pyxpcom already offers support for python, java is supported by javaxpcom, and there are efforts underway to add perl and ruby language support for xpconnect. on the developer side,...
...t is broad and includes.... mozilla has introductory support for wsdl... mozilla engineers have written and are in the process of refining a new security model for web services that will ease the deployment of applications using web services while maintaining the security of sites inside the user's firewall. ...
... origi...
XPJS Components Proposal - Archive of obsolete content
this is a proposal for a system that got implemented, but it may differ from the actual implementation. see the status document for more recent info on the status of this proposal. draft 1.0 what are xpjs components? xpjs components is a (cheesy) name for a system to support xpcom components written in javascript. now, you might ask: "isn't that what xpconnect does?" and i would answer that xpconnect is necessary, but not sufficient to the task. xpconnect provides the mechanisms for communication between native and js xpcom components, but it does not provide all of the infrastructure to register and instantiate js components outside of the limitations of the browser window. xpjs will provide that infrastructure. so what does this mean? the xpjs component system will support implem...
...r. the xpjsmanager is in charge of loading these .js files, helping them register themselves, and acting as an intermediary between the xpcom component manager and the js code. xjs components are not run in browser windows. each .js file (let's call it a module) is started up and run in the context of a relatively 'raw' js global object. the standard (non-dom) js classes will be available. the xpconnectcomponents object will be available. and some additional yet to be defined objects may be available. the xpconnectcomponents object allows access to the whole repository of native and js xpcom components, so this is not as isolated an environment as it might at first sound. a 'load' or 'import' function will also be provided to let the js code import other .js files where libraries of code might ...
... when a xpjs component module is first installed - or at autoregistration time - the xpjsmanager will load the .js file into a fresh js environment, let its top level script run to do whatever initialization it wants to do, and then it will call the module's nsregisterself function (passing the filespec of the .js file). ...
...nce for some clsid (or progid). the component manager will load up the xpjsmanager's module and call the native nsgetfactory it finds there. that native nsgetfactory function will check the information it stored in the registry to see that the js factory for the given clsid is in a given .js file. it will load that .js file (if not already loaded) and call the nsgetfactory function. our friend xpconnect will convert the js object returned from the js module's nsgetfactory function into an xpcom object. the component manager (and anyone else with a reference to that factory) can then call the factory's createinstance method at will. the js module is free to implement factories and components and services that the factories construct on command. any code anywhere and implemented in any language c...
Archived Mozilla and build documentation - Archive of obsolete content
how the autodial helper feature implemented for bug 93002 works and why it works that way. automated testing tips and tricks automatic mozilla configurator ankh8 automatically handle failed asserts in debug builds as of 2004-12-8, it is now possible to automatically handle failed asserts in debug builds of mozilla for windows. blackconnect blackwood bonsai it is a tool that lets you perform queries on the contents of a cvs archive; you can: get a list of checkins, see what checkins have been made by a given person, or on a given cvs branch, or in a particular time period. it also includes tools for looking at checkin logs (and comments); doing diffs between various versio...
... 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. java in firefox extensions if you are in need of calling java code from within a firefox extension, you can make use of liveconnect. ...
...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. java in firefox extensions if you are in need of calling java code from within a firefox extension, you can make use of liveconnect. ...
...ata. java in firefox extensions if you are in need of calling java code from within a firefox extension, you can make use of liveconnect. liveconnect gives your extension's javascript code (linked from or contained in xul code) access to 2 objects: java and packages (note that per this thread, although the new documentation for the liveconnect reimplementation states that these globals will be deprecated (in the context of applets), "firefox and the java plug-in will continue to support the global java/packages keywords, in particular in the context of firefox extensions."). these 2 objects let you make use of the standard jdk classes, e.g., javascript crypto mozilla defines a specia...
Deploying our app - Learn web development
lso allows you to run pre-deployment tasks, which in our case means that all the production code build processes can be performed inside of netlify and if the build is successful, the website changes will be deployed. although netlify offers a drag and drop deployment service, we are intending to trigger a new deployment to netlify each time we push to a github repo. it's exactly these kinds of connected services that we would encourage you to look for when deciding on your own build toolchain. we can commit our code and push to github and the updated code will automatically trigger the entire build routine. if all is well, we get a live change deployed automatically. the only action we need to perform is that initial "push". however, we do have to set these steps up, and we'll look at that no...
...we could have called it anything we like) using the branch master. we've not encountered branches at all, but the (terribly named) "master" branch is the default place for our work and it's what git starts on. it's also the default branch that netlify will look for, which is convenient. so with our project committed in git and pushed to our github repository, the next step in the toolchain is to connect github to netlify so our project can be deployed live on the web! using netlify for deployment deploying from github to netlify is surprisingly simple once you know the steps, particularly with "static websites" such as this project. note: there are also a lot of guides and tutorials on netlify to help you improve your development workflow. let's get this done: go to https://app.netli...
...ing on whether you authorized netlify before, you might need to authorize netlify with github, and choose what account you want to authorize it for (if you have multiple github accounts or orgs). choose the one you pushed your project to. netlify will prompt you with a list of the github repositories it can find. select your project repository and proceed to the next step. since we've connected netlify to our github account and given it access to deploy the project repository, netlify will ask how to prepare the project for deployment and what to deploy. you should enter the command npm run build for the build command, and specify the dist directory for the publish directory — this contains the code that we want to make public. to finish up, click deploy site. aft...
.... i'll show you how to add an initial test to your project and how to use the test to prevent or to allow the project deployment to happen. when approaching tests there's a good deal of ways to approach the problem: end-to-end testing, which involves your visitor clicking a thing and some other thing happening. integration testing, which basically says "does one block of code still work when connected to another block?" unit testing, where small and specific bits of functionality are tested to see if they do what they are supposed to do. and many more types. also see our cross browser testing module for a bunch of useful testing information remember also that tests are not limited to javascript; tests can be run against the rendered dom, user interactions, css, and even how a page looks.
Error codes returned by Mozilla APIs
ns_error_dom_file_not_found_err (0x80650000) file was not found. ns_error_dom_file_not_readable_err (...
...(0x805303f5) ns_error_dom_quota_reached (0x805303f6) an attempt was made to add data into the local or global storage for a given domain that would exceed the amount allowed for that domain. ns_error_dom_file_not_found_err (0x80650000) file was not found. ns_error_dom_file_not_readable_err (0x80650001) file could not be read. network errors the following errors can occur when creating connections over the network, or when reading or writing data. ns_binding_failed (0x804b0001) ns_binding_aborted (0x804b0002) the asynchronous request failed because it was aborted by some user action. ns_binding_redirected (0x804b0003) the asynchronous request has been "redirected" to a different async request. (for example, an http redirect occurred). this error code is used with load groups ...
...p is redirected to another request. ns_binding_retargeted (0x804b0004) the asynchronous request has been "retargeted" to a different "handler." this error code is used with load groups to notify the load group observer when a request in the load group is removed from the load group and added to a different load group. ns_error_malformed_uri (0x804b000a) the uri is malformed. ns_error_already_connected (0x804b000b) the connection is already established. xxx currently unused - consider removing. ns_error_not_connected (0x804b000c) the connection does not exist. xxx currently unused - consider removing. ns_error_connection_refused (0x804b000d) ns_error_net_timeout (0x804b000e) ns_error_in_progress (0x804b000f) the requested action could not be completed while the object is busy. im...
... ns_error_first_header_field_component_empty (0x804b0022) while parsing for the first component of a header field using syntax such as that for content-disposition or content-type, the first component was found to be empty. ...
Storage access policy: Block cookies from trackers
refox by clicking "report a problem" in the content blocking section of the control center (this shortcut may not be available in all versions of firefox). tracking protection explained how does firefox determine which resources are tracking resources? firefox uses the tracking protection list to determine which resources are tracking resources. the tracking protection list is maintained by disconnect. when the list is applied in firefox, we make two important changes: first, we only use the "basic protection" version of the list, which excludes some categories of trackers. in the future, we may expand our protections to use the "strict protection" version of the list. second, firefox uses an additional "entity list", which prevents domains from being classified as trackers when they are l...
...xception. dom cache: calls to cachestorage will always reject with a securityerror. browser caches: the http cache, the image cache, and the alternative services (alt-svc) cache are all partitioned for tracking resources, such that each top-level origin will have a separate partition and tracking resources on different top-level origins will be cached separate from each other. ...
...r. browser caches: the http cache, the image cache, and the alternative services (alt-svc) cache are all partitioned for tracking resources, such that each top-level origin will have a separate partition and tracking resources on different top-level origins will be cached separate from each other. network connections: tls sessions will not be resumed using a session ticket when an https connection is made to an embedded third-party resource that is classified as a tracker. ...
...) cache are all partitioned for tracking resources, such that each top-level origin will have a separate partition and tracking resources on different top-level origins will be cached separate from each other. network connections: tls sessions will not be resumed using a session ticket when an https connection is made to an embedded third-party resource that is classified as a tracker. http connection reuse by domains classified as trackers is limited to requests that occur under the same top-level origin. for example, a request for content from tracker.example on news.example will not reuse an http connection with a request for content from tracker.example on shopping.example or with requests that occur when tracker.example is visited directly (i.e., as a first party). http referrers ...
Leak-hunting strategies and tips
ructors that should have been virtual: if you expect to override an object's destructor (which includes giving a derived class of it an nscomptr member variable) and delete that object through a pointer to the base class using delete, its destructor better be virtual. ...
...verride an object's destructor (which includes giving a derived class of it an nscomptr member variable) and delete that object through a pointer to the base class using delete, its destructor better be virtual. (but we have many virtual destructors in the codebase that don't need to be -- don't do that.) debugging leaks that go through xpconnect many large object graphs that leak go through xpconnect. ...
...ncludes giving a derived class of it an nscomptr member variable) and delete that object through a pointer to the base class using delete, its destructor better be virtual. (but we have many virtual destructors in the codebase that don't need to be -- don't do that.) debugging leaks that go through xpconnect many large object graphs that leak go through xpconnect. ...
...ough a pointer to the base class using delete, its destructor better be virtual. (but we have many virtual destructors in the codebase that don't need to be -- don't do that.) debugging leaks that go through xpconnect many large object graphs that leak go through xpconnect. this can mean there will be xpconnect wrapper objects showing up as owning the leaked objects, but it doesn't mean it's xpconnect's fault (although that has been known to happen, it's rare). debugging leaks that go through xpconnect requires a basic understanding of what xpconnect does. xpconnect allows an xpcom object to be exposed to javascript, and it allows certain javascript objects to be exposed to c++ code as normal xpcom objects. when a c++ object is exposed to javascript (the more common of the two), an xpcwrapped...
I/O Functions
ed after the popular berkeley sockets. differences include the following: the blocking socket functions in nspr take a timeout parameter. two new functions, pr_transmitfile and pr_acceptread, can exploit the new system calls of some operating systems for higher performance. ...
... popular berkeley sockets. differences include the following: the blocking socket functions in nspr take a timeout parameter. two new functions, pr_transmitfile and pr_acceptread, can exploit the new system calls of some operating systems for higher performance. ...
...-write accesses to the file to be accomplished by normal memory accesses. memory-mapped i/o functions are currently implemented for unix, linux, mac os x, and win32 only. pr_createfilemap pr_memmap pr_memunmap pr_closefilemap anonymous pipe function pr_createpipe polling functions this section describes two of the most important polling functions provided by nspr: pr_poll pr_getconnectstatus pollable events a pollable event is a special kind of file descriptor. the only i/o operation you can perform on a pollable event is to poll it with the pr_poll_read flag. you cannot read from or write to a pollable event. the purpose of a pollable event is to combine event waiting with i/o waiting in a single pr_poll call. pollable events are implemented using a pipe or a pair of tcp...
... pollable events a pollable event is a special kind of file descriptor. the only i/o operation you can perform on a pollable event is to poll it with the pr_poll_read flag. you cannot read from or write to a pollable event. the purpose of a pollable event is to combine event waiting with i/o waiting in a single pr_poll call. pollable events are implemented using a pipe or a pair of tcp sockets connected via the loopback address, therefore setting and/or waiting for pollable events are expensive operating system calls. do not use pollable events for general thread synchronization; use condition variables instead. a pollable event has two states: set and unset. events are not queued, so there is no notion of an event count. a pollable event is either set or unset. pr_newpollableevent pr_des...
NSPR Error Handling
escriptor that is currently busy with another operation. pr_directory_open_error the directory could not be opened. pr_invalid_argument_error one or more of the arguments to the function is invalid. pr_address_not_available_error the network address (prnetaddr) is not available (probably in use). pr_address_not_supported_error the type of network address specified is not supported. pr_is_connected_error an attempt to connect on an already connected network file descriptor. pr_bad_address_error the network address specified is invalid (as reported by the network). pr_address_in_use_error network address specified (prnetaddr) is in use. pr_connect_refused_error the peer has refused to allow the connection to be established. pr_network_unreachable_error the network address specifie...
...d network file descriptor. pr_bad_address_error the network address specified is invalid (as reported by the network). pr_address_in_use_error network address specified (prnetaddr) is in use. pr_connect_refused_error the peer has refused to allow the connection to be established. pr_network_unreachable_error the network address specifies a host that is unreachable (perhaps temporary). pr_connect_timeout_error the connection attempt did not complete in a reasonable period of time. pr_not_connected_error the preceding function attempted to use connected semantics on a network file descriptor that was not connected. pr_load_library_error failure to load a dynamic library. pr_unload_library_error failure to unload a dynamic library. pr_find_symbol_error symbol could not be found in ...
...ge to perform the operation requested. pr_operation_not_supported_erro the requested operation is not supported by the platform. pr_protocol_not_supported_error the host operating system does not support the protocol requested. pr_remote_file_error access to the remote file has been severed. pr_buffer_overflow_error the value retrieved is too large to be stored in the buffer provided. pr_connect_reset_error the (tcp) connection has been reset by the peer. pr_range_error unused. pr_deadlock_error performing the requested operation would have caused a deadlock. the deadlock was avoided. pr_file_is_locked_error an attempt to acquire a lock on a file has failed because the file is already locked. pr_file_too_big_error completing the write or seek operation would have resulted in a f...
...m the desired request is locked. pr_no_more_files_error there are no more entries in the directory. pr_end_of_file_error unexpectedly encountered end of file (mac os only). pr_file_seek_error an unexpected seek error (mac os only). pr_file_is_busy_error the file is busy and the operation cannot be performed. pr_in_progress_error the operation is still in progress (probably a nonblocking connect). pr_already_initiated_error the (retried) operation has already been initiated (probably a nonblocking connect). pr_group_empty_error the wait group is empty. pr_invalid_state_error the attempted operation is on an object that was in an improper state to perform the request. pr_max_error placeholder for the end of the list. ...
PR_TransmitFile
sourcefile a pointer to a prfiledesc object representing the file to send. headers a pointer to the buffer holding the headers to be sent before sending data. hlen length of the headers buffer in bytes. flags one of the following flags: pr_transmitfile_keep_open indicates that the socket will be kept open after the data is sent. ...
... sourcefile a pointer to a prfiledesc object representing the file to send. headers a pointer to the buffer holding the headers to be sent before sending data. hlen length of the headers buffer in bytes. flags one of the following flags: pr_transmitfile_keep_open indicates that the socket will be kept open after the data is sent. ...
...a over. sourcefile a pointer to a prfiledesc object representing the file to send. headers a pointer to the buffer holding the headers to be sent before sending data. hlen length of the headers buffer in bytes. flags one of the following flags: pr_transmitfile_keep_open indicates that the socket will be kept open after the data is sent. pr_transmitfile_close_socket indicates that the connection should be closed immediately after successful transfer 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...
...ns 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 = 1 } prtransmitfileflags; ...
Notes on TLS - SSL 3.0 Intolerant Servers
problem a number of netscape 6.x/7.x and mozilla users have reported that some secure sites -- typically sites featuring online transactions or online banking over the https protocol -- do not display any content at all. the connection seems terminated and a blank page is displayed. this is the main symptom of the problem when mozilla based browsers encounter tls/ssl 3.0 intolerant servers. cause there are some number of web servers in production today which incorrectly implement the ssl 3.0 specification. this incorrect implementation causes them to reject connection attempts from clients that are compliant with the ssl 3.0 and tls (aka ssl 3.1) specifications. netscape 6.x/7.x and mozilla browsers (0.9.1 and later versions) correctly implement the tls specification, and the users cannot ut...
...a browsers (0.9.1 and later versions) correctly implement the tls specification, and the users cannot utilize sites which have this problem. technical information the ssl 3.0 and tls (aka ssl 3.1) specs both contain a provision -- the same provision -- for detecting "version rollback attacks". it is designed to permit a server to detect a man-in-the-middle that is altering the ssl client hello (connection) requests as they pass from the client to the server, altering them by changing the protocol version number to a lower version number. this feature was kind of meaningless until tls (ssl 3.1) came along because there was no version higher than 3.0 from which to be rolled back. tls is now available and used, and products that have implemented the roll-back detection incorrectly are not interope...
... higher than 3.0 from which to be rolled back. tls is now available and used, and products that have implemented the roll-back detection incorrectly are not interoperable with tls/ssl spec-compliant clients. normally the servers which have this problem are not equipped to deal with the tls protocol, but instead of rolling back to ssl 3.0 as the rollback provision provides, they terminate/drop the connection, thus resulting in most cases a blank page display. for up-to-date information, you can read a bugzilla bug report which keeps track of this problem with mozilla-based browsers. see bug 59321. servers currently known to exhibit this intolerant behavior as of this writing, this problem has been reported for the following servers: (wherever there is an upgraded version which fixes the problem...
...0/6.01/6.1 pr 1 or mozilla build (prior to 6/11/2001), you should look out for the symptom described below. you may also run this test with versions later than the older versions of netscape 6.x or mozilla -- just in case code changes in netscape 6.1/mozilla 0.9.2 or later may not catch all problem servers. when you find a secure site which simply does not display any page content or drops the connection, check to see if the preference option edit | preferences | privacy and security | ssl | enable tls is turned on. if so, turn it off. now re-visit the problem site. if the content displays this time, you are most likely witnessing a tls/ssl 3.0 intolerant server. report such a problem to the server's administrator. how to report an intolerant server optional:get the name of the ssl serv...
Avoiding leaks in JavaScript XPCOM components
n firefox 3, a cycle collector was introduced and refined in later versions, and mozilla is currently working on a generational garbage collector for js. this article needs to be updated to reflect the changes and the cases where they help. take every information on this site with a grain of salt, although most concepts and best practices still apply. using xpcom in javascript (also known as xpconnect) is an environment where memory management issues are not obvious. there are no calls to malloc and free and no reference counting. despite this, it's easy to write javascript code that leaks. it's easy to write leaky code in any garbage-collected language. but it's even easier in this environment because some of the objects you're dealing with are reference-counted behind the scenes. programmer...
...ammer can still create leaks by leaving objects reachable that are no longer needed. for example, if an object's constructor adds the object to a list that is reachable from a global variable and nothing ever removes it from the list, the object will never be destroyed since it is always reachable from the list. ...
...it allows javascript code to access xpcom objects (i.e., it wraps native xpcom objects for javascript) and it allows javascript code to implement xpcom interfaces (i.e., it wraps javascript objects for xpcom). ...
...it allows javascript code to access xpcom objects (i.e., it wraps native xpcom objects for javascript) and it allows javascript code to implement xpcom interfaces (i.e., it wraps javascript objects for xpcom). for javascript objects that implement xpcom interfaces, the interface between reference counting and garbage collection is quite simple. ...
Using the Multiple Accounts API
r nsimsgaccountmanager.createincomingserver(in string type) nsimsgincomingserver nsimsgaccountmanager.getincomingserver(in string key) smtp servers smtp servers are kept separately from all the other account management stuff. a user's smtp servers are not actually dependant on any of the account settings. the only thing that determines which smtp server a user should use is their physical connection to the internet. for instance, if a user is connected to the internet through myisp, inc. then he or she must use myisp's smtp server, no matter what identity they will be sending mail with. the smtp server list is accessable through the smtp service. you can add (and eventually delete) servers and have a default server. smtp servers are stored in your preferences in a manner resembling the ...
...: mail.server.server.empty_trash_on_exit boolean, (should not be imap-specific) - should we empty this server's trash when we quit? preference: mail.server.server.offline_download - boolean, is this server marked for offline download? preference: mail.server.server.override_namespaces - boolean, should we override namespaces on this server? ...
...xit boolean, (should not be imap-specific) - should we empty this server's trash when we quit? preference: mail.server.server.offline_download - boolean, is this server marked for offline download? preference: mail.server.server.override_namespaces - boolean, should we override namespaces on this server? ...
...ctions left open to the server preference: mail.server.server.empty_trash_threshhold integer, (should not be imap-specific) max k of wasted diskspace before we purge a folder preference: mail.server.server.delete_model - integer, delete model (move to trash, imap delete, purge immediately, not sure of values) preference: mail.server.server.timeout - integer, number of minutes a connection is idle before we drop it preference: mail.server.server.capability - list of capabilities of this server preference: mail.server.server.namespace.public - the server's namespace for public folders preference: mail.server.server.namespace.personal - the server's namespace for personal folders preference: mail.server.server.namespace.other_users - the server's namespace for othe...
Mozilla
he fact that there is more than one way to achieve any given visual effect in a browser. so, if the effect of complex markup is being tested, put that complex markup into a page and create another page that uses simple markup to achieve the same visual effect. reftest will then compare them and verify whether they produce the same bitmap. creating sandboxed http connections starting with gecko 1.8.1 (firefox 2), it is possible to create sandboxed http connections which don't affect the user's cookies. this article will cover the basics of doing http connections from xpcom javascript, and should easily translate to c++ xpcom. debugging debugging a project as large as mozilla can be...
...ons.) how to implement a custom autocomplete search component the xul textbox element supports an autocomplete mechanism that is used to create a textbox with a popup containing a list of possible completions for what the user has started to type. there are actually two autocomplete mechanisms: how to investigate disconnect failures this article will guide you on how to investigate disconnect failures. an example of such a failure how to report a hung firefox is your firefox not responding? or are you regularly seeing the "firefox is running but is not responding..." dialog? this usually means that something in firefox is hung. this may be becaus...
...efox and other applications, mozilla developers have created a number of useful javascript libraries you can use in your projects. documentation for these libraries can be found here. javascript tips javascript-dom prototypes in mozilla when a dom node is accessed from javascript in mozilla, the native c++ dom node is wrapped using xpconnect and the wrapper is exposed to javascript as the javascript representation of the dom node. when xpconnect wraps a c++ object it will create a jsobject that is unique to this c++ object. in the case where the c++ object has class info (nsiclassinfo), the jsobject is a more or less empty jsobject which is not really that special. all the methods that are supposed to show up on...
...l 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 web authoring faqs at the end of this document. mozilla web services security model (this document is being compiled from scattered documentation and source code and most of the information in it has not been verified. please do not depend on anything in it being correct for security.) ...
Index - Firefox Developer Tools
ity the network monitor shows you all the network requests firefox makes (for example, when it loads a page, or due to xmlhttprequests), how long each request takes, and details of each request. 47 inspecting web sockets javascript, network monitor, webapis, web socket inspector, web sockets since firefox 71, the network monitor has had the ability to inspect web socket connections. this article explores what functionality the web socket inspector makes available. 48 network monitor recording 110n:priority, debugging, dev tools, firefox, guide, networking, tools you can pause and resume the monitoring of network traffic using the pause button. 49 network monitor toolbar 110n:priority, debugging, dev tools, firefox, guide, networking, ...
...y, debugging, dev tools, firefox, guide, networking, tools the network monitor includes a performance analysis tool, to help show you how long the browser takes to download the different parts of your site. 53 throttling 110n:priority, debugging, dev tools, firefox, guide, networking, tools the network monitor allows you to throttle your network speed to emulate various connection speeds so you can see how your app will behave under different connection types. 54 page inspector css, dom, html, stylesheets, web development, web development:tools, l10n:priority use the page inspector to examine and modify the html and css of a page. 55 how to links for various how to's can be found here. these links describe in depth the how to t...
... the performance tool's ui consists of 4 main pieces: 94 waterfall 95 remote debugging tools, l10n:priority you can use the firefox developer tools on your desktop to debug web sites and web apps running in other browsers or runtimes. the other browser might be on the same device as the tools themselves or on a different device, such as a phone connected over usb. 96 debugging firefox desktop debugging, guide, tools this guide explains how you can use the firefox developer tools to debug a different instance of desktop firefox running on the same machine. in this guide, the instance of firefox being debugged is called the debuggee, and the instance of firefox doing the debugging is called the debugger. 101 respon...
...ole remoting debugging, reference, référence(2), web console this document describes the way web console remoting works. the web console is split between a client with its user interface, and the server which has listeners for all the things that happen in the tab. for communication between the server and the client we use the remote debugging protocol. this architecture allows you to connect a web console client instance to a server running on b2g, fennec or some other firefox instance. 155 web console keyboard shortcuts these shortcuts apply when you're in the command line interpreter. 156 working with iframes debugging, devtools, developer tools, frames, tools you can point the developer tools at a specific iframe within a document. ...
Web Audio Editor - Firefox Developer Tools
ource, such as an oscillator or a data buffer source nodes performing transformations such as delay and gain nodes representing the destination of the audio stream, such as the speakers each node has zero or more audioparam properties that configure its operation. for example, the gainnode has a single gain property, while the oscillatornode has frequency and detune properties. the developer connects the nodes in a graph, and the complete graph defines the behavior of the audio stream. the web audio editor examines an audio context constructed in the page and provides a visualization of its graph. this gives you a high-level view of its operation, and enables you to ensure that all the nodes are connected in the way you expect. you can then examine and edit the audioparam properties for eac...
...lt the violent theremin, which changes the pitch and volume of a sine wave as you move the mouse pointer visualizing the graph the web audio editor will now display the graph for the loaded audio context. here's the graph for the violent theremin demo: you can see that it uses three nodes: an oscillatornode as the source, a gainnode to control the volume, and an gainnode as the destination. ...
...the pitch and volume of a sine wave as you move the mouse pointer visualizing the graph the web audio editor will now display the graph for the loaded audio context. here's the graph for the violent theremin demo: you can see that it uses three nodes: an oscillatornode as the source, a gainnode to control the volume, and an gainnode as the destination. connections to audioparams displaying connections to audioparams is new in firefox 34. ...
... mouse pointer visualizing the graph the web audio editor will now display the graph for the loaded audio context. here's the graph for the violent theremin demo: you can see that it uses three nodes: an oscillatornode as the source, a gainnode to control the volume, and an gainnode as the destination. connections to audioparams displaying connections to audioparams is new in firefox 34. connections between nodes are displayed as solid lines. if, instead, you've connected a node to an audioparam in another node, then the connection is shown as a dashed line between the nodes, and is labeled with the name of the audioparam: inspecting and modifying audionodes if you click on a node, it's highlighted and you get a node inspector on the right hand side. this list the values of that node's...
Web Console remoting - Firefox Developer Tools
introduction this document describes the way web console remoting works. the web console is split between a client with its user interface, and the server which has listeners for all the things that happen in the tab. for communication between the server and the client we use the remote debugging protocol. this architecture allows you to connect a web console client instance to a server running on b2g, fennec or some other firefox instance. to better understand the architecture of the web console we recommend learning about the debugger architecture. the remote web console is a feature introduced in firefox 18. this document describes the latest protocol, with changes that have been made since then. the webconsoleactor and the webconsoleclient the webconsoleactor lives in dbg-webco...
...client the webconsoleactor lives in dbg-webconsole-actors.js, in the toolkit/devtools/webconsole folder. the webconsoleclient lives in webconsoleclient.jsm (in toolkit/devtools/webconsole) and it is used by the web console when working with the web console actor. ...
...these can be: page errors, window.console api messages, network activity, and file activity. ...
...aw text. starting with firefox 19: for non-text response types we send the content in base64 encoding (again, most likely a longstringactor grip). to tell the difference just check if response.content.encoding == "base64". the geteventtimings packet: { "to": "conn0.netevent15", "type": "geteventtimings" } { "from": "conn0.netevent15", "timings": { "blocked": 0, "dns": 0, "connect": 0, "send": 0, "wait": 16, "receive": 0 }, "totaltime": 16 } the fileactivity packet when a file load is observed the following fileactivity packet is sent to the client: { "from": "conn0.console9", "type": "fileactivity", "uri": "file:///home/mihai/public_html/mozilla/test2.css" } history protocol changes by firefox version: firefox 18: initial version. firefox ...
about:debugging (before Firefox 68) - Firefox Developer Tools
s.aboutdebugging.showsystemaddons preference. if you need to see system add-ons, navigate to about:config and make sure that this value is set to true. add-ons the add-ons section in about:debugging only supports restartless add-ons, including basic bootstrapped extensions, add-on sdk add-ons, and webextensions. this page enables you to do two things: load an add-on temporarily from disk connect the add-on debugger to any restartless add-ons connecting the add-on debugger the add-ons page in about:debugging lists all restartless add-ons that are currently installed (note that this list may include add-ons that came preinstalled with your firefox). next to each entry is a button labeled "debug". if the "debug" button is disabled, check the "enable add-on debugging" box. if you clic...
...he add-on debugger the add-ons page in about:debugging lists all restartless add-ons that are currently installed (note that this list may include add-ons that came preinstalled with your firefox). next to each entry is a button labeled "debug". if the "debug" button is disabled, check the "enable add-on debugging" box. if you click "debug", you'll see a dialog asking you to accept an incoming connection. click "ok", and the add-on debugger will start in a separate window. note that sometimes the debugger window is hidden by the main firefox window. see the page on the add-on debugger for all the things you can do with this tool. the "enable add-on debugging" button works by turning on the devtools.chrome.enabled and devtools.debugger.remote-enabled preferences. both preferences must be t...
...ing starts to support remote debugging, and this page can begin to list tabs available for debugging on mobile device browsers, simulators, etc. see bug 1212802 for the latest on this work. workers the workers page shows your workers, categorised as follows: all registered service workers all registered shared workers other workers, including chrome workers and dedicated workers you can connect the developer tools to each worker, and send push notifications to service workers. service worker state from firefox 52, the list of service workers shows the state of the service worker in its lifecycle. three states are distinguished: "registering": this covers all states between the service worker's initial registration, and its assuming control of pages. that is, it subsumes the "inst...
...ut has been terminated after being idle. this section uses a simple serviceworker demo, hosted at https://serviceworke.rs/push-simple/. debugging workers for a service worker, if it is already running, you'll see two buttons next to it, labeled "debug" and "push". if it's not already running, you'll see one button, labeled "start": click this to start the service worker. clicking "debug" connects the javascript debugger and console to this worker. you can set breakpoints, step through code, watch variables, evaluate code, and so on: registering workers at first, you won't see any workers listed under service workers or shared workers. as soon as a worker is registered, the listing is updated: before firefox 47, service workers were only shown when they were actually running. un...
AudioNode - Web APIs
Web › API › AudioNode
nsolas,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 its inputs are directly played back on the speakers (or whatever audio output device the audio context u...
.... source nodes are defined as nodes having a numberofinputs property with a value of 0. audionode.numberofoutputs read only returns the number of outputs coming out of the node. destination nodes — like audiodestinationnode — have a value of 0 for this attribute. audionode.channelcount represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. its usage and precise definition depend on the value of audionode.channelcountmode. audionode.channelcountmode represents an enumerated value describing the way channels must be matched between the node's inputs and outputs. audionode.channelinterpretation represents an enumerated value describing the meaning of the channels. this interpretation will define h...
...describing the way channels must be matched between the node's inputs and outputs. audionode.channelinterpretation represents an enumerated value describing the meaning of the channels. this interpretation will define how audio up-mixing and down-mixing will happen. the possible values are "speakers" or "discrete". methods also implements methods from the interface eventtarget. audionode.connect() allows us to connect the output of this node to be input into another node, either as audio data or as the value of an audioparam. audionode.disconnect() allows us to disconnect the current node from another one it is already connected to. example this simple snippet of code shows the creation of some audio nodes, and how the audionode properties and methods can be used. you can find exam...
...s simple snippet of code shows the creation of some audio nodes, and how the audionode properties and methods can be used. you can find examples of such usage on any of the examples linked to on the web audio api landing page (for example violent theremin.) const audioctx = new audiocontext(); const oscillator = new oscillatornode(audioctx); const gainnode = new gainnode(audioctx); oscillator.connect(gainnode).connect(audioctx.destination); oscillator.context; oscillator.numberofinputs; oscillator.numberofoutputs; oscillator.channelcount; specifications specification status comment web audio apithe definition of 'audionode' in that specification. working draft ...
BaseAudioContext.createDynamicsCompressor() - Web APIs
myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.desti...
... working draft ...
... working draft ...
... working draft ...
BaseAudioContext.createStereoPanner() - Web APIs
stream in a stereo image using a low-cost equal-power panning algorithm. syntax baseaudiocontext.createstereopanner(); returns a stereopannernode. example in our stereopannernode example (see source code) html we have a simple <audio> element along with a slider <input> to increase and decrease pan value. in the javascript we create a mediaelementaudiosourcenode and a stereopannernode, and connect the two together using the connect() method. we then use an oninput event handler to change the value of the stereopannernode.pan parameter and update the pan value display when the slider is moved. moving the slider left and right while the music is playing pans the music across to the left and right speakers of the output, respectively. var audioctx = new (window.audiocontext || window.webkit...
... working draft ...
... working draft ...
... working draft ...
ConstantSourceNode - Web APIs
the constantsourcenode interface—part of the web audio api—represents an audio source (based upon audioscheduledsourcenode) whose output is single unchanging value. this makes it useful for cases in which you need a constant value coming in from an audio source. in addition, it can be used like a constructible audioparam by automating the value of its offset or by connecting another node to it; see controlling multiple parameters with constantsourcenode. a constantsourcenode has no inputs and exactly one monaural (one-channel) output. the output's value is always the same as the value of the offset parameter. number of inputs 0 number of outputs 1 constructor constantsourcenode() creates and returns a new constantsourcenode instance, optionally specifying...
...rameters with constantsourcenode, a constantsourcenode is created to allow one slider control to change the gain on two gainnodes. the three nodes are set up like this: gainnode2 = context.creategain(); gainnode3 = context.creategain(); gainnode2.gain.value = gainnode3.gain.value = 0.5; volumeslidercontrol.value = gainnode2.gain.value; constantnode = context.createconstantsource(); constantnode.connect(gainnode2.gain); constantnode.connect(gainnode3.gain); constantnode.start(); gainnode2.connect(context.destination); gainnode3.connect(context.destination); this code starts by creating the gain nodes and setting them and the volume control that will adjust their value all to 0.5. then the constantsourcenode is created by calling audiocontext.createconstantsource(), and the gain parameters of ...
... now, whenever the value of constantnode.offset changes, the gain on both gainnode2 and gainnode3 will change to have that same value. ...
...code starts by creating the gain nodes and setting them and the volume control that will adjust their value all to 0.5. then the constantsourcenode is created by calling audiocontext.createconstantsource(), and the gain parameters of each of the two gain nodes are connected to the constantsourcenode. after starting the constant source by calling its start() method. finally, the two gain nodes are connected to the audio destination (typically speakers or headphones). now, whenever the value of constantnode.offset changes, the gain on both gainnode2 and gainnode3 will change to have that same value. to see this example in action, as well as to read the rest of the code from which these snippets were derived, see controlling multiple parameters with constantsourcenode. specification spe...
DynamicsCompressorNode.attack - Web APIs
myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.desti...
... working draft ...
... working draft ...
... working draft ...
DynamicsCompressorNode.knee - Web APIs
myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.desti...
... working draft ...
... working draft ...
... working draft ...
DynamicsCompressorNode.ratio - Web APIs
myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.desti...
... working draft ...
... working draft ...
... working draft ...
DynamicsCompressorNode.release - Web APIs
myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.desti...
... working draft ...
... working draft ...
... working draft ...
DynamicsCompressorNode.threshold - Web APIs
myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.desti...
... working draft ...
... working draft ...
... working draft ...
DynamicsCompressorNode - Web APIs
myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.desti...
... working draft ...
... working draft ...
... working draft ...
IDBFactory.open() - Web APIs
Web › API › IDBFactory › open
may trigger upgradeneeded, blocked or versionchange events. note: this feature is available in web workers. ...
... may trigger upgradeneeded, blocked or versionchange events. note: this feature is available in web workers. ...
... may trigger upgradeneeded, blocked or versionchange events. note: this feature is available in web workers. ...
...ed, blocked or versionchange events. note: this feature is available in web workers. syntax for the current standard: var idbopendbrequest = indexeddb.open(name); var idbopendbrequest = indexeddb.open(name, version); parameters name the name of the database. version optional optional. the version to open the database with. if the version is not provided and the database exists, then a connection to the database will be opened without changing its version. if the version is not provided and the database does not exist, then it will be created with version 1. experimental gecko options object options (version and storage) optional in gecko, since version 26, you can include a non-standard options object as a parameter of idbfactory.open that contains the version number of the da...
NetworkInformation.rtt - Web APIs
note: this feature is available in web workers. syntax rtt = networkinformation.rtt return value a number. ...
... note: this feature is available in web workers. syntax rtt = networkinformation.rtt return value a number. ...
... note: this feature is available in web workers. syntax rtt = networkinformation.rtt return value a number. ...
... note: this feature is available in web workers. syntax rtt = networkinformation.rtt return value a number. ...
NetworkInformation - Web APIs
the networkinformation interface provides information about the connection a device is using to communicate with the network and provides a means for scripts to be notified if the connection type changes. the networkinformation interfaces cannot be instantiated. it is instead accessed through the connection property of the navigator interface. note: this feature is available in web workers. properties this interface also inherits properties of its parent, eventtarget. networkinformation.downlink read only returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. ...
...web workers. properties this interface also inherits properties of its parent, eventtarget. networkinformation.downlink read only returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. ...
... networkinformation.downlink read only returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. networkinformation.downlinkmax read only returns the maximum downlink speed, in megabits per second (mbps), for the underlying connection technology. networkinformation.effectivetype read only returns the effective type of the connection meaning one of 'slow-2g', '2g', '3g', or '4g'. this value is determined using a combination of recently observed round-trip time and downlink values. networkinformation.rtt read only returns the estimated effective round-trip time of the current connection, rounded to the nearest multiple of 25 milliseconds. networkinformation.savedata read only returns true if the user has set a reduced...
... of recently observed round-trip time and downlink values. networkinformation.rtt read only returns the estimated effective round-trip time of the current connection, rounded to the nearest multiple of 25 milliseconds. networkinformation.savedata read only returns true if the user has set a reduced data usage option on the user agent. networkinformation.type read only returns the type of connection a device is using to communicate with the network. it will be one of the following values: bluetooth cellular ethernet none wifi wimax other unknown event handlers networkinformation.onchange the event that's fired when connection information changes and the change is fired on this object. methods this interface also inherits methods of its parent, eventtarget. ...
PerformanceResourceTiming.requestStart - Web APIs
there is no end property for requeststart. note: this feature is available in web workers. ...
...events are logged. ...
...d. ...
...print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status ...
RTCConfiguration.certificates - Web APIs
the rtcconfiguration dictionary's optional certificates property is an array of rtccertificate objects providing the security certificates available for use when authenticating duing the connection process. syntax let rtcconfiguration = { certificates: certificatelist }; let rtcconfiguration.certificates = [ cert1... ]; let certificates = rtcconfiguration.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...
...ote 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 found. the method by which a browser decides which certificate to use is implementation-dependent. some browsers may simply choose the fir...
...ing the chances a mutually-compatible encryption algorithm and key size may be found. the method by which a browser decides which certificate to use is implementation-dependent. some browsers may simply choose the first listed certificate and ignore the rest of the list; others may take a different approach. using certificates when you wish to provide your own certificates for use by an rtcpeerconnection instead of having the rtcpeerconnection generate them automatically, you do so by calling the static rtcpeerconnection.generatecertificate() function. the certificates property's value cannot be changed once it's first specified. if it's included in the configuration passed into a call to a connection's setconfiguration(), it is ignored. this attribute supports providing multiple certificate...
...nnection generate them automatically, you do so by calling the static rtcpeerconnection.generatecertificate() function. the certificates property's value cannot be changed once it's first specified. if it's included in the configuration passed into a call to a connection's setconfiguration(), it is ignored. this attribute supports providing multiple certificates because even though a given dtls connection uses only one certificate, providing multiple certificates allows support for multiple encryption algorithms. the implementation of rtcpeerconnection will choose which certificate to use based on the algorithms it and the remote peer support, as determined during dtls handshake. if you don't provide certificates, new ones are generated automatically. one obvious benefit to providing your own ...
RTCConfiguration.iceServers - Web APIs
vers property is an array of rtciceserver objects, each of which describes a single stun or turn server to use for negotiation purposes. syntax let rtcconfiguration = { iceservers: [ iceserver1... ] }; let rtcconfiguration.iceservers = [ iceserver1... ]; value an array of zero or more rtciceserver objects, each of which 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 implemen...
... 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 servers is changed while a connection is already active by calling the the rtcpeerconnection method setconfiguration(), no immediate effect occurs. however, the new list of servers is used for any future renegotiation, such as while handlin...
...the first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. the second server has two urls: stun:stun.example.com and stun:stun-1.example.com. ...
...d stun:stun-1.example.com. var configuration = { iceservers: [{ urls: "stun:stun.services.mozilla.com", username: "louis@mozilla.com", credential: "webrtcdemo" }, { urls: ["stun:stun.example.com", "stun:stun-1.example.com"] }] }; var pc = new rtcpeerconnection(configuration); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcconfiguration.iceservers' in that specification. candidate recommendation initial definition. ...
RTCDataChannel.send() - Web APIs
different browsers have different limitations on the size of the message you can send. ...
... different browsers have different limitations on the size of the message you can send. ...
...ations exist to define how to automatically fragment large messages, but not all browsers implement them, and those that do have various additional restrictions. this will get less complicated over time, but for now, if you have questions, see understanding message size limits in using webrtc data channels. syntax rtcdatachannel.send(data); parameters data the data to transmit across the connection. this may be a usvstring, a blob, an arraybuffer, or an arraybufferview. return value undefined. exceptions invalidstateerror since the data channel uses a separate transport channel from the media content, it must establish its own connection; if it hasn't finished doing so (that is, its readystate is "connecting"), this error occurs without sending or buffering the data. networkerro...
...of a multi-part object sent using send(). for more information about message size restrictions, see understanding message size limits in using webrtc data channels. example in this example, a routine called sendmessage() is created; it accepts an object as input and sends to the remote peer, over the rtcdatachannel, a json string with the specified object and a time stamp. var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("backchannel"); function sendmessage(msg) { let obj = { "message": msg, "timestamp": new date() } dc.send(json.stringify(obj)); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.send()' in that specification. candidate recommendatio...
RTCIceCandidate.candidate - Web APIs
e actually extracted from this string. this property can be configured by specifying the value of the candidate property when constructing the new candidate object using rtcicecandidate(). syntax var candidate = rtcicecandidate.candidate; value a domstring describing the properties of the candidate, taken directly from the sdp attribute "candidate". the candidate string specifies the network connectivity information for the candidate. if the candidate is an empty string (""), the end of the candidate list has been reached; this candidate is known as the "end-of-candidates" marker. the syntax of the candidate string is described in rfc 5245, section 15.1. for an a-line (attribute line) that looks like this: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the correspondi...
...ring; 2 becomes "rtcp") protocol = "udp" priority = 2043278322 ip = "192.168.0.56" port = 44323 type = "host" example in this example, we see a function which receives as input an sdp string containing an ice candidate received from the remote peer during the signaling process. ...
...bj = new rtcicecandidate(candidatesdp); mypeerconnection.addicecandidate(candidateobj).catch({ /* handle the error thrown by addicecandidate() */ }); } the handlenewicecandidate() function shown here passes the received candidate's sdp text into rtcicecandidate() to receive an rtcicecanddiate object in return, which represents the candidate. the new candidate is then passed into rtcpeerconnection.addicecandidate() to add the candidate to the list of candidates for webrtc to consider using for the connection being established. ...
... new candidate is then passed into rtcpeerconnection.addicecandidate() to add the candidate to the list of candidates for webrtc to consider using for the connection being established. this example could be simplified somewhat; you may more often see the code look something like this, taking advantage of more advanced ecmascript 2016 features: let handlenewicecandidate = candidatesdp => mypeerconnection.addicecandidate(new rtcicecandidate(candidatesdp)); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.candidate' in that specification. candidate recommendation initial definition. ...
RTCIceServer.credentialType - Web APIs
cicecredentialtype enumerated string type: oauth the rtciceserver requires the use of oauth 2.0 to authenticate in order to use the ice server described. this process is detailed in rfc 7635. this property was formerly called token. password the rtciceserver requires a username and password to authenticate prior to using the described ice server. ...
...the use of oauth 2.0 to authenticate in order to use the ice server described. this process is detailed in rfc 7635. this property was formerly called token. password the rtciceserver requires a username and password to authenticate prior to using the described ice server. example this example creates a new rtcpeerconnection which will use a turn server at turnserver.example.org to negotiate connections. ...
...property was formerly called token. password the rtciceserver requires a username and password to authenticate prior to using the described ice server. example this example creates a new rtcpeerconnection which will use a turn server at turnserver.example.org to negotiate connections. logging into the turn server will use the username "webrtc" and the creative password "turnpassword". ...
...lled token. password the rtciceserver requires a username and password to authenticate prior to using the described ice server. example this example creates a new rtcpeerconnection which will use a turn server at turnserver.example.org to negotiate connections. logging into the turn server will use the username "webrtc" and the creative password "turnpassword". mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: "turn:turnserver.example.org", // a turn server username: "webrtc", credential: "turnpassword", credentialtype: "password" } ] }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceserver.credential' in that specification. candidat...
RTCIceTransport.state - Web APIs
or the remote device to begin to transmit the remote candidates, or both. in this state, checking of candidates to look for those which might be acceptable has not yet begun. "checking" at least one remote candidate has been received, and the rtcicetransport has begun examining pairings of remote and local candidates in order to attempt to identify viable pairs that could be used to establish a connection. keep in mind that gathering of local candidates may still be underway, and, similarly, the remote device also may still be gathering candidates of its own. "connected" a viable candidate pair has been found and selected, and the rtcicetransport has connected the two peers together using that pair. however, there are still candidates pairings to consider, and there may still be gathering u...
... similarly, the remote device also may still be gathering candidates of its own. "connected" a viable candidate pair has been found and selected, and the rtcicetransport has connected the two peers together using that pair. however, there are still candidates pairings to consider, and there may still be gathering underway on one or both of the two devices. the transport may revert from the "connected" state to the "checking" state if either peer decides to cancel consent to use the selected candidate pair, and may revert to "disconnected" if there are no candidates left to check but one or both clients are still gathering candidates. "completed" the transport has finished gathering local candidates and has received a notification from the remote peer that no more candidates will be sent...
...lients are still gathering candidates. "completed" the transport has finished gathering local candidates and has received a notification from the remote peer that no more candidates will be sent. in addition, all candidate pairs have been considered and a pair has been selected for use. if consent checks fail on all successful candidate pairs, the transport state will change to "failed". "disconnected" the ice agent has determined that connectivity has been lost for this rtcicetransport. this is not a failure state (that's "failed"). a value of "disconnected" means that a transient issue has occurred that has broken the connection, but that should resolve itself automatically without your code having to take any action. see the disconnected state for additional details. "failed" the rtcic...
... "closed" the transport has shut down and is no longer responding to stun requests. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetransportstate' in that specification. ...
RTCRtpTransceiver.direction - Web APIs
icating the transceiver's preferred direction. the rtcrtptransceiverdirection type is an enumeration of string values. each describes how the transceiver's associated rtcrtpsender and rtcrtpreceiver behave as shown in the table below. value rtcrtpsender behavior rtcrtpreceiver behavior "sendrecv" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1. offers to receive rtp data, and does so if the other peer accepts. "sendonly" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1. does not offer to receive rtp data and will not do so. "recvonly" does not offer to send rtp data...
...nder has at least one active encoding, the user agent gets its parameters using rtcrtpsender.getparameters(), then looks at the parameters' encodings property; if any of the listed encodings has its active property set to true, the sender has an active encoding. ...
...ncodings has its active property set to true, the sender has an active encoding. exceptions when setting the value of direction, the following exceptions can occur: invalidstateerror either the receiver's rtcpeerconnection is closed or the rtcrtpreceiver is stopped. usage notes setting the direction when you change the value of direction, an invalidstateerror exception will occur if the connection is closed or the receiver is stopped. ...
...ceptions can occur: invalidstateerror either the receiver's rtcpeerconnection is closed or the rtcrtpreceiver is stopped. usage notes setting the direction when you change the value of direction, an invalidstateerror exception will occur if the connection is closed or the receiver is stopped. if the new value of direction is in fact different from the existing value, renegotiation of the connection is required, so a negotiationneeded event is sent to the rtcpeerconnection. effect on offers and answers the value of direction is used by rtcpeerconnection.createoffer() or rtcpeerconnection.createanswer() in order to generate the sdp generated by each of those methods. the sdp contains an a-line which specifies the directionality. for example, if the direction is specified as "sendrecv", t...
StereoPannerNode.pan - Web APIs
rned value an a-rate audioparam containing the panning to apply. note: though the audioparam returned is read-only, the value it represents is not. example in our stereopannernode example (see source code) html we have a simple <audio> element along with a slider <input> to increase and decrease pan value. in the javascript we create a mediaelementaudiosourcenode and a stereopannernode, and connect the two together using the connect() method. we then use an oninput event handler to change the value of the stereopannernode.pan parameter and update the pan value display when the slider is moved. moving the slider left and right while the music is playing pans the music across to the left and right speakers of the output, respectively. var audioctx = new (window.audiocontext || window.webkit...
... working draft ...
... working draft ...
... working draft ...
StereoPannerNode - Web APIs
only is an a-rate audioparam representing the amount of panning to apply. methods no specific method; inherits methods from its parent, audionode. example in our stereopannernode example (see source code) html we have a simple <audio> element along with a slider <input> to increase and decrease pan value. in the javascript we create a mediaelementaudiosourcenode and a stereopannernode, and connect the two together using the connect() method. we then use an oninput event handler to change the value of the stereopannernode.pan parameter and update the pan value display when the slider is moved. moving the slider left and right while the music is playing pans the music across to the left and right speakers of the output, respectively. var audioctx = new (window.audiocontext || window.webkit...
... working draft initial definiti...
... working draft initial definition ...
... working draft initial definition ...
Migrating from webkitAudioContext - Web APIs
cemodel = "linear"; // linear distance model panner.distancemodel = "inverse"; // inverse distance model panner.distancemodel = "exponential"; // exponential distance model gain control moved to its own node type the web audio standard now controls all gain using the gainnode. instead of setting a gain property directly on an audio source, you connect the source to a gain node and then control the gain using that node's gain parameter. audiobuffersourcenode the gain attribute of audiobuffersourcenode has been removed. the same functionality can be achieved by connecting the audiobuffersourcenode to a gain node. see the following example: // old webkitaudiocontext code: var src = context.createbuffersource(); src.buffer = somebuffer; src.g...
... node and then control the gain using that node's gain parameter. audiobuffersourcenode the gain attribute of audiobuffersourcenode has been removed. the same functionality can be achieved by connecting the audiobuffersourcenode to a gain node. ...
...achieved by connecting the audiobuffersourcenode to a gain node. see the following example: // old webkitaudiocontext code: var src = context.createbuffersource(); src.buffer = somebuffer; src.gain.value = 0.5; src.connect(context.destination); src.noteon(0); // new standard audiocontext code: var src = context.createbuffersource(); src.buffer = somebuffer; var gain = context.creategain(); src.connect(gain); gain.gain.value = 0.5; gain.connect(context.destination); src.start(0); audiobuffer the gain attribute of audiobuffer has been removed. the same functionality can be achieved by connecting the audiobuffersourcenode that owns the buffer to a gain node. see the following example: // old webkitaudiocontext code: var src = context.createbuffersource(); src.buffer = somebuffer; src.buffer...
....value = 0.5; gain.connect(context.destination); src.start(0); audiobuffer the gain attribute of audiobuffer has been removed. the same functionality can be achieved by connecting the audiobuffersourcenode that owns the buffer to a gain node. see the following example: // old webkitaudiocontext code: var src = context.createbuffersource(); src.buffer = somebuffer; src.buffer.gain = 0.5; src.connect(context.destination); src.noteon(0); // new standard audiocontext code: var src = context.createbuffersource(); src.buffer = somebuffer; var gain = context.creategain(); src.connect(gain); gain.gain.value = 0.5; gain.connect(context.destination); src.start(0); removal of audiobuffersourcenode.looping the looping attribute of audiobuffersourcenode has been removed. this attribute was an alias...
Visualizations with Web Audio API - Web APIs
es. note: you can find working examples of all the code snippets in our voice-change-o-matic demo. ...
... the analyser node will then capture audio data using a fast fourier transform (fft) in a certain frequency domain, depending on what you spe...
... the analyser node will then capture audio data using a fast fourier transform (fft) in a certain frequency domain, depending on what you specify as the analysernode.fft...
...ontext.createanalyser() method, for example: var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var analyser = audioctx.createanalyser(); this node is then connected to your audio source at some point between your source and your destination, for example: source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(audioctx.destination); note: you don't need to connect the analyser's output to another node for it to work, as long as the input is connected to the source, either directly or via another node. the analyser node will then capture audio data using a fast fourier transform (fft) in a certain frequency domain, depending on what you specify as the analysernode.fftsize property value (if no value...
Using Web Workers - Web APIs
e (see index.html and index2.html) — each one has to spin up the worker using code like the following: var myworker = new sharedworker('worker.js'); one big difference is that with a shared worker you have to communicate via a port object — an explicit port is opened that the scripts can use to communicate with the worker (this is done implicitly in the case of dedicated workers). ...
...with the worker (this is done implicitly in the case of dedicated workers). the port connection needs to be started either implicitly by use of the onmessage event handler or explicitly with the start() method before any messages can be posted. calling start() is only needed if the message event is wired up via the addeventlistener() method. note: when using the start() method to open the port connection, it needs to be called from both the parent thread and the worker thread if two-way communication is needed. sending messages to and from a shared worker now messages can be sent to the worker as before, but the postmessage() method has to be invoked through the port object (again, you'll see similar constructs in both multiply.js and square.js): squarenumber.onchange = function() { mywo...
...worker as before, but the postmessage() method has to be invoked through the port object (again, you'll see similar constructs in both multiply.js and square.js): squarenumber.onchange = function() { myworker.port.postmessage([squarenumber.value,squarenumber.value]); console.log('message posted to worker'); } now, on to the worker. there is a bit more complexity here as well (worker.js): onconnect = function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } } first, we use an onconnect handler to fire code when a connection to the port happens (i.e. when the onmessage event handler in the parent thread is setup, or when the start() method is explicitly called in the parent th...
...ent handler in the parent thread is setup, or when the start() method is explicitly called in the parent thread). we use the ports attribute of this event object to grab the port and store it in a variable. next, we add a message handler on the port to do the calculation and return the result to the main thread. setting up this message handler in the worker thread also implicitly opens the port connection back to the parent thread, so the call to port.start() is not actually needed, as noted above. finally, back in the main script, we deal with the message (again, you'll see similar constructs in both multiply.js and square.js): myworker.port.onmessage = function(e) { result2.textcontent = e.data; console.log('message received from worker'); } when a message comes back through the port f...
HTML5 - Developer guides
Web › Guide › HTML › HTML5
ding of more diverse and powerful web sites and applications. this set is sometimes called html5 & friends and often shortened to just html5. designed to be usable by all open web developers, this reference page links to numerous resources about html5 technologies, classified into several groups based on their function. semantics: allowing you to describe more precisely what your content is. connectivity: allowing you to communicate with the server in new and innovative ways. offline and storage: allowing webpages to store data on the client-side locally and operate offline more efficiently. multimedia: making video and audio first-class citizens in the open web. 2d/3d graphics and effects: allowing a much more diverse range of presentation options. performance and integration: providing...
... sheet for beginners who want to master html 5, its elements, event attributes and compatibility. html5-compliant parser the parser, which turns the bytes of an html document into a dom, has been extended and now precisely defines the behavior to use in all cases, even when faced with invalid html. this leads to far greater predictability and interoperability between html5-compliant browsers. connectivity web sockets allows creating a permanent connection between the page and the server and to exchange non-html data through that means. server-sent events allows a server to push events to a client, rather than the classical paradigm where the server could send data only in response to a client's request. webrtc this technology, where rtc stands for real-time communication, allows conne...
...eed for a plugin or an external application. offline & storage offline resources: the application cache firefox fully supports the html5 offline resource specification. most others have offline resource support at some level. online and offline events firefox 3 supports whatwg online and offline events, which let applications and extensions detect whether or not there's an active internet connection, as well as to detect when the connection goes up and down. whatwg client-side session and persistent storage (aka dom storage) client-side session and persistent storage allows web applications to store structured data on the client side. indexeddb indexeddb is a web standard for the storage of significant amounts of structured data in the browser and for high performance searches on this...
...s local files selected by the user. this includes support for selecting multiple files using the <input> of type file html element's new multiple attribute. there also is filereader. multimedia using html5 audio and video the <audio> and <video> elements embed and allow the manipulation of new multimedia content. webrtc this technology, where rtc stands for real-time communication, allows connecting to other people and controlling videoconferencing directly in the browser, without the need for a plugin or an external application. track and webvtt the <track> element allows subtitles and chapters. webvtt is a text track format. 2d/3d graphics and effects canvas tutorial learn about the new <canvas> element and how to draw graphs and other objects in firefox. html5 text api for <ca...
Web Performance
this article, we'll discuss creating a clear business case to convince decision-makers to make the investment.understanding latencylatency is the time it takes for a packet of data to travel from source to a destination. in terms of performance optimization, it's important to optimize to reduce causes of lacency and to test site performance emulating high latency to optimizer for users with lousy connections. this article explains what latency is, how it impacts performance, how to measure latency, and how to reduce it.using dns-prefetchdns-prefetch is an attempt to resolve domain names before resources get requested. this could be a file loaded later or link target a user tries to follow. beginner's tutorials the mdn web performance learning area contains modern, up-to-date tutorials co...
...e features this section provides information on how to use and understand the performance features in your developer tools, including waterfall, call tree, and flame charts. profiling with the built-in profiler learn how to profile app performance with firefox's built-in profiler. ...
...measure it, and how you can optimize applications to make the best use of available bandwidth. the role of tls in performance tls—or https as we tend to call it—is crucial in creating secure and safe user experiences. while hardware has reduced the negative impacts tls has had on server performance, it still represents a substantial slice of the time we spend waiting for browsers to connect to servers. this article explains the tls handshake process, and offers some tips for reducing this time, such as ocsp stapling, hsts preload headers, and the potential role of resource hints in masking tls latency for third parties. reading performance charts developer tools provide information on performance, memory, and network requests. knowing how to read waterfall charts, call trees, tr...
...is feature isn't available everywhere, we'll also show you how you can configure your tooling to use this feature in a widely compatible fashion. controlling resource delivery with resource hints browsers often know better than we do when it comes to resource prioritization and delivery however they're far from clairyovant. native browser features enable us to hint to the browser when it should connect to another server, or preload a resource before the browser knows it ever needs it. when used judiciously, this can make fast experience seem even faster. in this article, we cover native browser features like rel=preconnect, rel=dns-prefetch, rel=prefetch, and rel=preload, and how to use them to your advantage. performance budgets marketing, design, and sales needs, and developer experience, o...
dev/panel - Archive of obsolete content
// retrieve the port var toaddon = event.ports[0]; toaddon.start(); toaddon.postmessage("message from the panel document"); console.log(toaddon); }); communicating with the debugger server the firefox developer tools use a client/server protocol: a tool, such as a javascript debugger or style editor, is the client, and the program being debugged, such as firefox, is the server. clients connect to the server and send it messages to examine and modify the state of the program being debugged. the remote debugging protocol page describes the protocol in detail. when the user opens a panel and the panel is created, the framework calls the panel's setup method. the setup method will be passed a debuggee object, which is a messageport that the add-on can use to exchange messages with the deb...
...src="resource://sdk/dev/volcan.js"></script> </head> <body> <div id = "content"></div> </body> <script src="./my-panel.js"></script> </html> here's a script that uses volcan.js to get the selected tab and display its url: // my-panel.js var content = document.getelementbyid("content"); window.addeventlistener("message", function(event) { var debuggee = event.ports[0]; volcan.connect(debuggee). then(listtabs). then(writetablist); }); function listtabs(root) { return root.listtabs(); } function writetablist(tablist) { content.textcontent = tablist.tabs[tablist.selected].url; } we don't have detailed documentation for volcan.js, but it's coming soon. in the meantime, here's a quick guide. connecting volcan.js provides a global connect() function that takes a me...
.... then(listtabs). then(writetablist); }); function listtabs(root) { return root.listtabs(); } function writetablist(tablist) { content.textcontent = tablist.tabs[tablist.selected].url; } we don't have detailed documentation for volcan.js, but it's coming soon. in the meantime, here's a quick guide. connecting volcan.js provides a global connect() function that takes a messageport connected to the debugger server, and returns a promise which is fulfilled with an object representing the root actor: volcan.connect(debuggee).then(gotroot); function gotroot(root) { // can use root actor here } actors actors in the remote debugging protocol are volcan.js objects. the messages actors can accept are methods of those objects. the message type becomes the method name. for example, the...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
please be aware that if you attempt to open this sample directly in firefox, it will not run correctly. menus hierarchically structured dropdown menus are the part of the user interface used for frequently accessed functions in an application o...
...autocompletesearch attribute. if you want to use the location bar history, set the value for this to history; if you want it to be the search bar history, use search-history; and if you want it to be another form’s input history, use form-history; this attribute can take one value or multiple space-delimited values. also, in order to actually read in a history for autocomplete, you will need xpconnect privileges, which we will cover in chapter 4. menu list use the menulist element to create a control for making selections from a drop-down list. as shown in listing 17, this is implemented in combination with the menupopup element; it produces output as shown in figure 14. a click reveals the drop-down list; when an item is selected, the values of that item’s label and value attributes are ...
... backward and forward through pages and includes the ability to prevent scripts in embedded frames from accessing outside the frame. for building applications linked to external web pages, this is a more secure and more convenient approach. the tabbrowser element is even more capable than the browser element because it includes the basic tab-handling features from firefox. to use this requires xpconnect privileges, the same as autocomplete does; this will be covered in chapter 4. opening a page if you specify a uri value for the src attribute in the browser element, that uri will be opened by default. if the src attribute's value changes, you can dynamically open a different web page or xul document. functions like back, forward, reload can all be called using the goback(), goforward(), and r...
No Proxy For configuration - Archive of obsolete content
issues, testing and bugs. audience mozilla users, mozilla developers, mozilla testers. overview as browsers rapidly grew in popularity in the mid-90's, many network administrators added proxy servers. initially, proxy servers were used for access control and performance. many networks had limited access to the public network via proxy servers. because the public network was small in scope and connections were slow, a caching proxy could often improve the overall performance. this feature was originally designed as a "blacklist" of sites or domains that was within the intranet, and should not be accessed via the proxy server. due to various limitations, this feature should be used for only the most simple blacklist scenarios. in almost all cases, pac gives better control and flexibility. use...
...epted example domain filters with interior wildcards www.*.com ip address string prefixes 127. or 10.0.* ip addresses with wildcards in quads 10.*.*.* preferences name network.proxy.no_proxies_on default value localhost, 127.0.0.1 by default "localhost" and "127.0.0.1" are excluded, since most people assume these should connect to the local system. note: when ipv6 support is added, additional addresses will need to be added and tested. communicator used "network.proxy.none" limitations no ipv6 support - the backend stores ipv4 addresses as ipv6, but ipv6 formats are not supported. scalability - not usable for local domains with numerous hostnames. not usable for large number of filters (ad blocking). mozilla i...
...s are not supported. scalability - not usable for local domains with numerous hostnames. not usable for large number of filters (ad blocking). mozilla implements this feature with significant limitations, users may find that writing a pac file is more suitable for their needs. testing contributors can test this feature, even without a proxy server, using a "negative proxy server test". proxy connections that fail return an error "the proxy server you have configured cannot be found", so configure your browser to use a non-existent http proxy (hostname: "imaginary", port "80"). test each destination in an http: url. all proxied urls will return errors, all non-proxied connections will be attempted normally (direct connection). hostnames filter test destination result ...
Developing New Mozilla Features - Archive of obsolete content
tree only at the milestone releases is risky if you're doing significant development. something may have changed that will cause you extra work. and you'll miss the early discussion phase when you can add your perspective to the design work. if you absolutely don't have the resources to do this, then plan for extra integration time. work hard to have a developer involved in the core code who is connected to what you are doing if you can’t make this happen, let mozilla.org staff know and we will try to facilitate this. it’s possible developers may not pay much attention to you because they believe your proposed feature is not a high priority, or is not wanted at all, or that you haven’t demonstrated that you understand the codebase and mozilla coding practices well enough for them to spen...
...it’s possible developers may not pay much attention to you because they believe your proposed feature is not a high priority, or is not wanted at all, or that you haven’t demonstrated that you understand the codebase and mozilla coding practices well enough for them to spend a lot of time with you. in some cases the developers may be in error and staff will work to make this clear and get you connected. in other cases, mozilla.org staff may agree with the developers that it does not make sense for them to spend much time assisting with your project. this is a painful setting and we hope it doesn’t happen often. but our developers are a precious commodity and their time is probably the most important resource we have. it’s also possible that a developer is over-worked or on vacation or ju...
...e perfect, chances are that revisions will be requested. if you’ve got a large patch, let the likely reviewers know when they might expect to see it if your timeframe is tight, check out the mozilla roadmap for milestone dates and see if your feature will arrive at a time of furious activity. if so, and if your feature is not of general interest, prepare to be a low priority for a while. get connected with mozilla.org staff mitchell@mozilla.org is a good contact for project management discussions. let us know what you’re doing. if you can find the resources, designate someone on your team as the liaison to mozilla.org for project management issues. review and super-review take time improving the code as requested by the reviewers takes time. poor quality code also takes time. we’ve op...
XUL Events - Archive of obsolete content
es and sections describe the event handler that are valid for most xul elements. the events listeners can be attached using addeventlistener and removed using removeeventlistener. some of the events can be attached using attributes as well. when attaching event listeners using attributes, be aware that only one listener can be attached at a time. any previously attached listeners are disconnected. the attribute name is the event name with an 'on' prefix. xul event reference subpages broadcastthe 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.checkboxstatechangethe checkboxstatechange event is executed when the state of a <checkbox> element has changed.
...as been opened, much like the onload event is sent to a window when it is opened. attribute: onpopupshown syncfrompreference this event is sent when the element is being changed because a preference changed, or when an element is initialized from a preference. this event will only be sent to elements connected to a preference and in a prefwindow. this is not a real event instead it is just a function call and must use the attribute syntax. the script may return a value to set the element to a specific value rather than the value of the preference. this event is usually used to adjust the preference value so that it is more suitable for display in the user interface. attribute: onsyncfrom...
... return a value to set the element to a specific value rather than the value of the preference. this event is usually used to adjust the preference value so that it is more suitable for display in the user interface. attribute: onsyncfrompreference synctopreference this event is sent when the element connected to a preference has changed. this event will only be sent to elements connected to a preference and in a prefwindow. this is not a real event instead it is just a function call and must use the attribute syntax. the script may return a value to set the preference to a specific value rather than the value of the element. attribute: onsynctopreference ...
The Implementation of the Application Object Model - Archive of obsolete content
with this question was to say, "rdf exists now. much of it is written. to implement some sort of pluggable system that could do local/remote merging and mimic the functionality of rdf would require a month or two of engineering time that we can't afford to spend." that answer was the incorrect counter to the question. the answer itself implied a concession that some newly-architected system that connected directly into the dom apis would be preferable to rdf if only there were time to engineer it. that is simply not the case. to discover why, let's explore what this pluggable content architecture would have to look like in order to match the feature set and functionality we need. first off, let's consider how we'd figure out what kind of node to instantiate, e.g., a bookmarks folder node vs. a m...
...data is actually exposed. let's go back to the sorting problem and consider a hypothetical situation. suppose we decide we want to cache the sort relationship on our data, so that we don't have to continually resort it as the user hits the column headers in the tree. what we really need in this situation is the ability to take our intermediate representation and form an entirely different set of connections between our data objects. we need the ability to use arcs of a different type to connect our nodes, e.g., rather than chaining the nodes using a "natural order" relationship, it would be advantageous and desirable to be able to add an additional relationship to the nodes, e.g., a "sorted ascending on name" relationship. if we have something like this, then we can perform sorts without tearing...
...t are made to our aggregated intermediate representation of data must be persistent. we must have the ability to add and remove nodes from the tree by saving the changes into the equivalent of a data source that can house the permanent changes (so that they can be sucked in and aggregated like everything else). this implies a need for the ability to make "negative" and "positive" assertions about connections in our tree, i.e., so that we can delete arcs and/or add arcs to the tree. statement #5 when a change is made to aggregated data that falls outside of the domain of an existing data source, it must be possible for that change to be persistently remembered by recording the change into a new data source that can then be read in when the data is re-aggregated in future sessions of the applica...
Extentsions FAQ - Archive of obsolete content
how to customizes toolbar button to coexist in a toolbar palette and status bar? option #3 install status buttons 1.0 <https://addons.mozilla.org/firefox/1272/> "lets you put toolbar buttons at either end of the status-bar. ...
...es anyone know how write a bounce email extension? are you aware of the "mailredirect" extension? it allows bouncing to arbitrary addresses. it seems what you want is a one button access to that extension with a prefilled bounce address, right? could someone make an extension for thunderbird that preview upcomeing events and number of new messages? in our company i write this extension that connects to our groupware server (http). what server should souch extension work gainst? did you mean exchange? how to attach information using the stringproperties of an imap message with out changing the properties? string properties are implemented as imap user flags. however not all servers support user flags, in which case you get reduced functionality as follows: all flags are stored in your lo...
...d address book lacks. ...
TCP/IP Security - Archive of obsolete content
ally, the data produced by a layer is encapsulated in a larger container by the layer below it. the four tcp/ip layers, from highest to lowest, are shown below. application layer. this layer sends and receives data for particular applications, such as domain name system (dns), hypertext transfer protocol (http), and simple mail transfer protocol (smtp). transport layer. this layer provides connection-oriented or connectionless services for transporting application layer services between networks. the transport layer can optionally assure the reliability of communications. transmission control protocol (tcp) and user datagram protocol (udp) are commonly used transport layer protocols. network layer. this layer routes packets across networks. internet protocol (ip) is the fundamental ne...
...tions than transport and application layer controls. ssl tunnel vpns provide the ability to secure both tcp and udp communications including client/server and other network traffic, and therefore act as network layer vpns. data link layer. data link layer controls are applied to all communications on a specific physical link, such as a dedicated circuit between two buildings or a dial-up modem connection to an internet service provider (isp). data link layer controls for dedicated circuits are most often provided by specialized hardware devices known as data link encryptors; data link layer controls for other types of connections, such as dial-up modem communications, are usually provided through software. because the data link layer is below the network layer, controls at this layer can pro...
...he data link layer is below the network layer, controls at this layer can protect both data and ip information. compared to controls at the other layers, data link layer controls are relatively simple, which makes them easier to implement; also, they support other network layer protocols besides ip. because data link layer controls are specific to a particular physical link, they cannot protect connections with multiple links, such as establishing a vpn over the internet. an internet-based connection is typically composed of several physical links chained together; protecting such a connection with data link layer controls would require deploying a separate control to each link, which is not feasible. data link layer protocols have been used for many years primarily to provide additional prot...
WebVR — Virtual Reality for the Web - Game development
playing games. there are many devices to chose from: desktop ones like oculus rift or htc vive, through consoles with playstation vr (which admittedly doesn't support webvr at this time), to mobile experiences like gear vr or google cardboard. note: for more information, read our webvr concepts article. the webvr api the webvr api is the central api for capturing information on vr devices connected to a computer and headset position/orientation/velocity/acceleration information, and converting that into useful data you can use in your games and other applications. note: there are of course other apis useful for creating games, for example the gamepad api for control inputs, and the device orientation api for handling display orientation on mobile. browser support and spec status curr...
... to visit the mozvr.com and webvr.info websites. using the webvr api the webvr api is based on two concepts — sending stereoscopic images to both lenses in your headset and receiving positional data for your head from the sensor, and those two are handled by hmdvrdevice (head-mounted display virtual reality device) and positionsensorvrdevice. ...
...for example: function setcustomfov(up,right,down,left) { var testfov = new vrfieldofview(up,right,down,left); ghmd.setfieldofview(testfov,testfov,0.01,10000.0); } the gpositionsensor variable holds th...
How much does it cost to do something on the Web? - Learn web development
a barebones website, you only need a basic computer capable of launching an editor, and a web browser, so the entry level can be quite low. of course, you'll need a more serious computer if you want to produce complicated designs, touch up photos, or produce audio and video files. you need to upload content to a remote server (see hosting below), so you need a modem. your isp can rent internet connectivity to you for a few dollars per month, though your budget might vary, depending on your location. isp access make sure that you have sufficient bandwidth: low-bandwidth access may be adequate to support a 'simple' website: reasonably-sized images, texts, some css and javascript. that will likely cost you a few dozen dollars, including the rent for the modem. on the other hand, you'll need...
... few dollars per month, though your budget might vary, depending on your location. isp access make sure that you have sufficient bandwidth: low-bandwidth access may be adequate to support a 'simple' website: reasonably-sized images, texts, some css and javascript. that will likely cost you a few dozen dollars, including the rent for the modem. on the other hand, you'll need a high-bandwidth connection, such as dsl, cable, or fiber access, if you want a more advanced website with hundreds of files, or if you want to deliver heavy video/audio files directly from your web server. it could cost the same as low-bandwidth access, upwards to several hundred dollars per month for more professional needs. hosting understanding bandwidth hosting providers charge you according to how much bandwidt...
...on a free host service. professional website agencies and hosting if you desire a professional website, you will likely ask a web agency to do it for you. ...
How do I start to design my website? - Learn web development
you out when you have decisions to make. (should i implement these features, use these services, create these designs?) so now that you have a prioritized list of goals, let's move on to the next question. how could a website bring me to my goals? so you have a list of goals and you feel you need a website to reach those goals. are you sure? let's look back at our example. we have five goals connected to music, one goal related to personal life (finding your significant other), and the completely unrelated cat photos. is it reasonable to build a single website to cover all those goals? is it even necessary? after all, scores of existing web services might bring you to your goals without building a new website. finding a girl/boyfriend is a prime case where it makes more sense to use existin...
...ebsite rather than actually searching for a girl/boyfriend. since our goal is what matters most, we should spend our energy on leveraging existing tools rather than starting from scratch. again, there are so many web services already available for showcasing photos that it isn't worth the effort to build a new site just to spread the word about how cute our cats are. the other five goals are all connected to music. there are, of course, many web services that could handle these goals, but it makes sense in this case to build a dedicated website of our own. such a website is the best way to aggregate all the stuff we want to publish in a single place (good for goals 3, 5, and 6) and promote interaction between us and the public (good for goals 2 and 4). in short, since these goals all revolve aro...
... in this case to build a dedicated website of our own. such a website is the best way to aggregate all the stuff we want to publish in a single place (good for goals 3, 5, and 6) and promote interaction between us and the public (good for goals 2 and 4). in short, since these goals all revolve around the same topic, having everything in one place will help us meet our goals and help our followers connect with us. how can a website help me reach my goals? by answering that, you'll find the best way to reach your goals and save yourself from wasted effort. what needs to be done, and in what order, to reach my goals? now that you know what you want to accomplish, it's time to turn those goals into actionable steps. as a side note, your goals are not necessarily set in stone. they evolve over time...
How the Web works - Learn web development
previous overview: getting started with the web how the web works provides a simplified view of what happens when you view a webpage in a web browser on your computer or phone. this theory is not essential to writing web code in the short term, but before long you'll really start to benefit from understanding what's happening in the background. clients and servers computers connected to the web are called clients and servers. a simplified diagram of how they interact might look like this: clients are the typical web user's internet-connected devices (for example, your computer connected to your wi-fi, or your phone connected to your mobile network) and web-accessing software available on those devices (usually a web browser like firefox or chrome). servers are computers that st...
...d above don't tell the whole story. there are many other parts involved, and we'll describe them below. for now, let's imagine that the web is a road. on one end of the road is the client, which is like your house. on the other end of the road is the server, which is a shop you want to buy something from. in addition to the client and the server, we also need to say hello to: your internet connection: allows you to send and receive data on the web. it's basically like the street between your house and the shop. tcp/ip: transmission control protocol and internet protocol are communication protocols that define how data should travel across the internet. this is like the transport mechanisms that let you place an order, go to the shop, and buy your goods. in our example, this is like a car ...
... the browser goes to the dns server, and finds the real address of the server that the website lives on (you find the address of the shop). the browser sends an http request message to the server, asking it to send a copy of the website to the client (you go to the shop and order your goods). this message, and all other data sent between the client and the server, is sent across your internet connection using tcp/ip. if the server approves the client's request, the server sends the client a "200 ok" message, which means "of course you can look at that website! here it is", and then starts sending the website's files to the browser as a series of small chunks called data packets (the shop gives you your goods, and you bring them back to your house). the browser assembles the small chunks int...
Client-side storage - Learn web development
personalizing site preferences (e.g. showing a user's choice of custom widgets, color scheme, or font size). persisting previous site activity (e.g. storing the contents of a shopping cart from a previous session, remembering if a user was previously logged in). saving data and assets locally so a site will be quicker (and potentially less expensive) to download, or be usable without a network connection. saving web application generated documents locally for use offline often client-side and server-side storage are used together. for example, you could download a batch of music files (perhaps used by a web game or music player application), store them inside a client-side database, and play them as needed. the user would only have to download the music files once — on subsequent visits t...
...omplete sets of customer records to even complex data types like audio or video files. you'll learn more about these apis below. the future: cache api some modern browsers support the new cache api. this api is designed for storing http responses to specific requests, and is very useful for doing things like storing website assets offline so the site can subsequently be used without a network connection. cache is usually used in combination with the service worker api, although it doesn't have to be. use of cache and service workers is an advanced topic, and we won't be covering it in great detail in this article, although we will show a simple example in the offline asset storage section below. storing simple data — web storage the web storage api is very easy to use — you store simpl...
...mple already shows how to create an app that will store large assets in an indexeddb database, avoiding the need to download them more than once. this is already a great improvement to the user experience, but there is still one thing missing — the main html, css, and javascript files still need to be downloaded each time the site is accessed, meaning that it won't work when there is no network connection. this is where service workers and the closely-related cache api come in. a service worker is a javascript file that, simply put, is registered against a particular origin (web site, or part of a web site at a certain domain) when it is accessed by a browser. when registered, it can control pages available at that origin. it does this by sitting between a loaded page and the network and in...
Third-party APIs - Learn web development
saw in the introductory article is accessed using the native audiocontext object. for example: const audioctx = new audiocontext(); ... const audioelement = document.queryselector('audio'); ... const audiosource = audioctx.createmediaelementsource(audioelement); // etc. third party apis, on the other hand, are located on third party servers. to access them from javascript you first need to connect to the api functionality and make it available on your page. this typically involves first linking to a javascript library available on the server via a <script> element, as seen in our mapquest example: <script src="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.js"></script> <link type="text/css" rel="stylesheet" href="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.css"/> you ca...
...ment you want to display the map in ('map'), and an options object containing the details of the particular map we want to display. in this case we specify the coordinates of the center of the map, a map layer of type map to show (created using the mapquest.tilelayer() method), and the default zoom level. this is all the information the mapquest api needs to plot a simple map. the server you are connecting to handles all the complicated stuff, like displaying the correct map tiles for the area being shown, etc. note: some apis handle access to their functionality slightly differently, requiring the developer to make an http request to a specific url pattern to retrieve data. these are called restful apis — we'll show an example later on. they usually require api keys security for browser ...
...an find in the javascript/apis/third-party-apis/nytimes directory. initially the <script> element contains a number of variables needed for the setup of the example; below we'll fill in the required functionality. the app will end up allowing you to type in a search term and optional start and end dates, which it will then use to query the article search api and display the search results. connect the api to your app first, you'll need to make a connection between the api and your app. in the case of this api, you need to include the api key as a get parameter every time you request data from the service at the correct url. find the following line: let key = ' ... '; replace the existing api key with the actual api key you got in the previous section. add the following l...
Aprender y obtener ayuda - Learn web development
ings — focused and diffuse learning: focused learning is what you might more traditionally associate with academic subjects. you concentrate deeply on a low-level topic and solving the specific problems that it brings. you are focused on a narrow area. diffuse learning is more to do with high-level thinking around a wider area. you let your mind wander more widely, and seemingly make random connections between different things. this is more the kind of thinking you do while you are in the shower, or during a coffee break. from the studies that neuroscientists have done on brain activity, we have found out that you can't really engage in both ways of learning — or thinking — at once. so which one should you choose? you might think that focused learning is better for studying, but in re...
... where that information is stored. it isn't however very good at getting an understanding of "the big picture", and unlocking new neural pathways when you are trying to understand new subjects or solve new problems that you haven't come across before. for that, you need diffuse thinking. this is the opposite of focus — you let your brain wander around the wider landscape, searching around for connections you didn't have before, touching on new things (or new combinations of things) that you can then focus on later, to strengthen them and start to really understand what they mean. this is why it is usually good to read some introductory material first to get a high-level understanding of an area before you leap into the specific details. it is also why you can sometimes get really stuck on a...
...swer when you go for a coffee break (or a walk). you might: know how to fix problem a with tool a. know how to fix problem b with tool b. not know how to fix problem c. let's say you focus on problem c for a while and get frustrated because you can't think how to solve it. but then after going on a walk to get some fresh air, you may well find that as your mind wanders, you suddenly make a connection between tool a and tool b, and realize that you can use them together to fix problem c! it isn't always this simple, but it is also surprising how many times this does happen. this also highlights the importance of taking regular breaks when you are studying in front of the computer. different learning materials it is also worth looking at the different types of learning materials that are a...
The "why" of web performance - Learn web development
ly recognize a sluggish site. that is why we care. why care about performance? web performance—and its assocatiated best practices—are vital for your website visitors to have a good experience. in a sense, web performance can be considered a subset of web accessibility. with performance as with accessibility, you consider what device a site visitor is using to access the site and the device connection speed. as an example, consider the loading experience of cnn.com, which at the time of this writing had over 400 http requests with a file size of over 22.6mb. imagine loading this on a desktop computer connected to a fibre optic network. this would seem relatively fast, and the file size would be largely irrelevant. imagine loading that same site using tethered mobile data on a 9 year-ol...
... to load—if it loads at all—with blocking scripts possibly timing out, and adverse cpu impact causing browser crashes if it does load. a 22.6 mb site could take up to 83 seconds to load on a 3g network, with domcontentloaded (meaning the site's base html structure) at 31.86 seconds. and it isn't just the time taken to download that is a major problem. a lot of countries still have internet connections that bill per megabyte. our example 22.6 mb cnn.com experience would cost about 11% of the average indian's daily wage to download. from a mobile device in northwest africa, it might cost two days of an average salary. and if this site were loaded on a us carrier's international roaming plan? the costs would make anyone cry. (see how much your site costs to download.) improve conversion r...
... mobile (where it generally takes longer). these same site visitors begin abandoning slow sites at 3 seconds. the speed at which a site loads is one factor. if the site is slow to react to user interaction, or appears janky, this causes site visitors to lose interest and trust. here's some real-world examples of performance improvements: tokopedia reduced render time from 14s to 2s for 3g connections and saw a 19% increase in visitors, 35% increase in total sessions, 7% increase in new users, 17% increase in active users and 16% increase in sessions per user. rebuilding pinterest pages for performance resulted in a 40% decrease in wait time, a 15% increase in seo traffic and a 15% increase in conversion rate to signup. to build websites and applications people want to use; to at...
Command line crash course - Learn web development
’d strongly recommend trying to install the wsl. you could stick with the default command prompt (cmd), and many tools will work ok, but you’ll find everything easier if you have better parity with unix tools. side note: what's the difference between a command line and a terminal? generally you'll find these two terms used interchangeably. technically, a terminal is software that starts and connects to a shell. a shell is your session and session environment (where things like the prompt and shortcuts might be customised). the command line is the literal line where you enter commands and the cursor blinks. do you have to use the terminal? although there's a great wealth of tools available from the command line, if you're using tools like visual studio code there's also a mass of extension...
...un all these commands directly in that terminal, safe in the knowledge that you won’t break your own machine. a great resource for getting a quick overview of specific terminal commands is tldr.sh. this is a community-driven documentation service, similar to mdn, but specific to terminal commands. in the next section let’s step it up a notch (or several notches in fact) and see how we can connect tools together on the command line to really see how the terminal can be advantageous over the regular desktop user interface. connecting commands together with pipes the terminal really comes into its own when you start to chain commands together using the | (pipe) symbol. let’s look at a very quick example of what this means. we’ve already looked at ls, which outputs the contents of the ...
...s each file or directory on its own line, that effectively gives us a directory and file count. so what is going on here? a general philosophy of (unix) command line tools is that they print text to the terminal (also referred to "printing to standard output" or stdout). a good deal of commands can also read content from streamed input (known as "standard input" or stdin). the pipe operator can connect these inputs and outputs together, allowing us to build up increasingly more complex operations to suit our needs — the output from one command can become the input to the next command. in this case, ls would normally print its output to stdout, but instead ls’s output is being piped into wc, which takes that output as an input, counting the number of lines it contains, and prints that count ...
Command line options
ards compatible. adding this option bypasses downgrade protection. -createprofile profile_name create a new profile in the default directory, but do not start the application. the profile will be named profile_name in the profile manager, the profile_name must not contain spaces ( ). do not run profile_name while running an instance of the application, you can use the -no-remote option to avoid connecting to a running instance. firefox -createprofile joeluser -createprofile "profile_name profile_dir" creates a new profile in the profile_dir directory, but do not start the application. the profile will be named profile_name in the profile manager. note profile_name and profile_dir are quoted together, and are separated by exactly 1 space (as with the previous syntax, profile_name must not co...
...n the profile_dir directory, but do not start the application. the profile will be named profile_name in the profile manager. note profile_name and profile_dir are quoted together, and are separated by exactly 1 space (as with the previous syntax, profile_name must not contain spaces). do not run profile_dir while running an instance of the application. you can use the -no-remote option to avoid connecting to a running instance. firefox -createprofile "joeluser c:\internet\joelusers-moz-profile" note: profile_dir must not exist and you must not already have a profile called profile_name. -migration start with import wizard. -new-instance open new instance, not a new window in running instance, which allows multiple copies of application to be open at a time. firefox -new-instance -p "a...
... debugger). that is different to venkman debugger (see option -venkman). -jsconsole start application with the error console, or, in firefox, the browser console. -purgecaches gecko (layout engine) has a javascript cache, which is not reset on startup, this clears it. -start-debugger-server port firefox only. start the debugger server on port. this will enable another instance of firefox to connect the firefox developer tools to this firefox instance. see the article on remotely debugging firefox desktop. the port argument is optional, and if it is omitted, the server will listen on port 6000. -venkman start with the javascript debugger, venkman, if installed. xulrunner -app /path/to/application.ini start a new process running the xulrunner application at path/to. also works with fire...
Displaying Places information using views
//browser/content/places/places.css" ?> <?xul-overlay href="chrome://browser/content/places/placesoverlay.xul" ?> it's this stylesheet that binds elements with the special type attribute to one of the views. the overlay contains javascript required by the views. it also contains the built-in places context menu and commands, which you may want to take advantage of in your own uses of the views. connecting a view to its data to hook up a built-in view to its data, use the view's special place attribute. note: starting in gecko 2.0, you can't use the place attribute with menus. see menu view for details. you may specify the attribute directly in the xul or set its corresponding property via javascript. its value is the uri of a query, and the data shown in the view are the results of this qu...
...ur view. a caller would pass in a result or a query, and you would execute the query and add your view as an observing client using addobserver(). (that's how the load method of the built-in tree view works.) when you let your view observe the result, the result will in turn set the result property on the given nsinavhistoryresultobserver. you should not set the result property explicitly. to disconnect a viewer from its result, call removeobserver(view) on your result. be careful about reference cycles. the viewer and the result both hold owning references to each other. for these objects to be freed during javascript garbage collection, you must clear this cycle by calling result.removeobserver(view). (for example, the built-in tree view does this automatically. when the tree is destroyed or ...
... collection, you must clear this cycle by calling result.removeobserver(view). (for example, the built-in tree view does this automatically. when the tree is destroyed or a different nsitreeview is associated with the tree, the tree will set the tree property of the old nsitreeview to null. because the object implementing nsitreeview also implements nsinavhistoryresultobserver, the viewer then disconnects itself from the result by calling removeobserver().) is this still right when using nsinavhistoryresultobserver? creating custom tree views custom places tree views can be a lot of work. take a look at using the tree view above to get an idea of what's required. custom nsitreeviews in general are a lot of work, and if you are not familiar with creating custom nsitreeviews, see the custom tree...
PBackground
his is the foundation of how chrome and content processes talk to each other in e10s. the actor tree all live actors exist in a tree. the root of the tree is known as the top-level actor, an instance of one of a small number of top-level protocols. all actors in a tree "live" on the same thread, and can only be used safely from that thread. the top-level actor for most things is pcontent, which connects the main thread of the chrome process to the main thread of a child process. for most purposes this is great, because the dom is already bound to the main thread. but in some cases we don't necessarily want to talk to the main thread. what if i want to talk to a different thread? not every communication between the chrome and content processes necessarily wants to go through the main threads ...
... every communication between the chrome and content processes necessarily wants to go through the main threads of both (or even either) processes. for example, when we are uploading textures from the content process we don't need to go through the main thread of the parent process. instead we can go directly to the compositor thread in the parent process by creating a new top-level protocol that connects the compositor thread in the parent process to the main thread of a child process. this protocol is called pcompositor, and allows us to bypass the main thread of the parent process, which trims the latency of texture uploads since they will not get bogged down if that thread is busy. writing code that works in both chrome and content processes a lot of code "just works" in the content process...
...d pattern seen in some parts of the gecko codebase, looking something like this (try searching for geckoprocesstype_default in dxr): if (xre_getprocesstype() == geckoprocesstype_default) { dothething(arguments); } else { mipdlprotocol->senddothething(arguments); } this can get unwieldy very quickly, so a better solution was needed. pbackground pbackground exists to solve such problems. it connects a designated "background" thread in the chrome process to any other thread in any other process. pbackground allows us to bypass the chrome process's main thread if used from the content process' main thread. bypass both main threads if used from a non-main thread in a content process write process-agnostic code because it can be used even from another thread in the parent process the par...
IPDL Tutorial
amplechild* toplevelchild::allocpexample() { refptr<examplechild*> actor = new examplechild(); return actor.forget(); } virtual bool toplevelchild::deallocpexample(pexamplechild* actor) { ns_release(static_cast<examplechild*>(actor)); return true; } if an object that implements a protocol can't be constructed inside allocpfoo, has been previously constructed and doesn't require an ipdl connection throughout its lifetime, or implements a refcounted protocol where the first form of constructor is not available, there is a second form of sendpfooconstructor which can be used: class examplechild { public: void dosomething() { amanagerchild->sendpexampleconstructor(this, ...); } }; internally, the first constructor form simply calls pexample(parent|child)* actor = allocp...
...ich implement ipdl messages return bool: true for success, and false for catastrophic failure. message implementations should return false from a message implementation if the data is corrupted or otherwise malformed. any time a message implementation returns false, ipdl will immediately begin catastrophic error handling: the communication channels for the child process (tab or plugin) will be disconnected, and the process will be terminated. do not return false from message handlers for "normal" error conditions such as inability to load a network request! normal errors should be signaled with a message or return value. note: the following paragraphs are not yet implemented. ipdl tracks all active protocols between two endpoints. if if the child side crashes or becomes hung: any synchronous ...
...e called on each manager protocol to deallocate any active subprotocols. when a manager protocol is destroyed, any subprotocols will be notified: no further messages will be accepted deallocpsubprotocol will be called on the manager protocol to deallocate any active subprotocols when the toplevel protocol is destroyed, this is equivalent to shutting down the entire ipdl machinery for that connection, because no more messages can be sent and all subprotocols are destroyed. ...
Release phase
re two different protocols you can use to connet with your mercurial repository: http and ssh. be advised that there's an important distinction between them. you can pull using both, but you can only push through ssh. consequently, if you already have a local clone that you pulled using http, you'll need to modify a config file to tell mercurial to push through ssh. let's go over configuring your connection protocols. configuration before you try pushing, you need to tell ssh which username you wish to use for connecting with hg.mozilla.org. this should be your mozilla ldap account name. add the following lines to your ~/.ssh/config file, replacing user@host.domain with your mozilla ldap account name: host hg.mozilla.org user user@host.domain if you have already cloned the remote repositor...
...esting searching for changes changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings make sure this output is accurate before continuing. once you've made sure the outgoing output is accurate, push this changeset to hg.mozilla.org by running the hg push command. mercurial will connect to the remote repository, authenticate through ssh and send the changesets. the output should look something like this: pushing to ssh://hg.mozilla.org/releases/l10n-central/x-testing searching for changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files congratulations! your changeset has been successfully pushed to hg.mozilla.org! you can now ...
...ng in your browser to see the new changeset in the remote repository. troubleshooting ssh if pushing fails, make sure your ~/.ssh/config has the correct user set under the hg.mozilla.org host. this should be your mozilla ldap account name. next, try issuing the following command: $ ssh hg.mozilla.org if ssh is working fine, you should see the following message: no interactive shells allowed here! connection to hg.mozilla.org closed. if you don't see this message, try running the same command in a more verbose mode (with the debugging information): $ ssh -vvv hg.mozilla.org this should tell you why your connection is not succeeding. if you can't figure it out on your own, copy the output of the above command, paste it on http://pastebin.mozilla.org and ask in #l10n on the irc.mozilla.org server. ...
PRIOMethods
the table of i/o methods used in a file descriptor. ...
... the table of i/o methods used in a file descriptor. ...
...number of bytes available for reading. available64 same as previous field, except 64-bit. fsync flush all in-memory buffers of file to permanent store. seek position the file pointer to the desired place. seek64 same as previous field, except 64-bit. fileinfo get information about an open file. fileinfo64 same as previous field, except 64-bit. writev write from a vector of buffers. connect connect to the specified network address. accept accept a connection from a network peer. bind associate a network address with the file descriptor. listen prepare to listen for network connections. shutdown shut down a network connection. recv receive up to the specified number of bytes. send send all the bytes specified. recvfrom receive up to the specified number of bytes and re...
PR_AcceptRead
this parameter is valid only if the function return does not indicate failure. peeraddr a pointer a pointer to a prnetaddr object. ...
...rint32 amount, printervaltime timeout); parameters the function has the following parameters: listensock a pointer to a prfiledesc object representing a socket descriptor that has been called with the pr_listen function, also known as the rendezvous socket. acceptedsock a pointer to a pointer to a prfiledesc object. on return, *acceptedsock points to the prfiledesc object for the newly connected socket. this parameter is valid only if the function return does not indicate failure. peeraddr a pointer a pointer to a prnetaddr object. on return, peeraddr points to the address of the remote socket. the prnetaddr object that peeraddr points to will be in the buffer pointed to by buf. this parameter is valid only if the function return does not indicate failure. buf a pointer to a buffer...
...ough to receive amount bytes of data and two prnetaddr structures (thus allowing the runtime to align the addresses as needed). amount the number of bytes of data to receive. does not include the size of the prnetaddr structures. if 0, no data will be read from the 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. ...
JSS FAQ
Mozilla › Projects › NSS › JSS › JSS FAQ
jss frequently asked questions newsgroup: mozilla.dev.tech.crypto content: what versions of jdk and jce do you suggest? does jss have 64 bit support? is jss fips compliant? is there any sample code and documentation? if i don't call setcipherpolicy, is the domestic policy used by default? my ssl connection is hanging on windows? how can i tell which ssl/tls ciphers jss supports? how can i debug my ssl connection? can you explain jss ssl certificate approval callbacks? can i have multiple jss instances reading separate db's? once jss initialized, i can't get anymore instances with certificatefactory.getinstance(x.509)? is it possible to sign data in java with jss? how do i convert org.mozilla.js...
...nputstream.java jss/samples/pqggen.java jss/samples/pkcs12.java if i don't call setcipherpolicy, is the domestic policy used by default? yes, domestic is the default because we call nss_setdomesticpolicy() during cryptomanager.initialize(). setcipherpolicy does not need to be called by a jss app unless that app wants to limit itself to export-allowed cipher suites. my ssl connection is hanging on windows? nspr makes use of nt vs. windows distinction and provides different nt and windows builds. many netscape products, including nss, have nt and windows builds that are essentially the same except one difference: one is linked with the nt version of nspr and the other is linked with the windows version of nspr. the nt fiber problem affects applications that call blo...
...mponents (essentially all non-fiber builds) or set the environment variable nspr_native_threads_only=1. you can find more information in bugzilla bug 102251 ssl session cache locking issue with nt fibers how can i tell which ssl/tls ciphers jss supports? check http://lxr.mozilla.org/mozilla/source/security/jss/org/mozilla/jss/ssl/sslsocket.java#730 how can i debug my ssl connection? by using the nss tool ssltap can you explain jss ssl certificate approval callbacks? nss has three callbacks related to certificates. jss has two. but jss combines two of the nss callbacks into one. nss's three ssl cert callbacks are: ssl_authcertificatehook sets a callback to authenticate the peer's certificate. it is called instead of nss's routin...
NSS 3.12.6 release notes
which nss 3.12.6 requires. nspr 4.8.4 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.4/. new in nss 3.12.6 ssl3 & tls renegotiation indication extension (rfc 5746) by default, nss 3.12.6 uses the new tls renegotiation indication extension for tls renegotiation but allows simple ssl/tls connections (without renegotiation) with peers that don't support the tls renegotiation indication extension. the behavior of nss for renegotiation can be changed through api function calls, or with the following environment variables: nss_ssl_enable_renegotiation values: [0|n|n]: ssl_renegotiate_never ...
... nss_ssl_require_safe_negotiation values: 1: requiresafenegotiation = true unset: requiresafenegotiation = false controls whether safe renegotiation indication is required for initial handshake. if true, a connection will be dropped at initial handshake if the peer server or client does not support safe renegotiation. the default setting for this option is false. these options can also be set with the following ssl options: ssloptions.enablerenegotiation ssloptions.requiresafenegotiation new pseudo cipher sui...
... new environment variables sqlite_force_proxy_locking 1 means force always use proxy, 0 means never use proxy, null means use proxy for non-local files only. sslkeylogfile key log file. if set, nss logs rsa pre-master secrets to this file. this allows packet sniffers to decrypt tls connections. see documentation. note: the code must be built with trace defined to use this functionality. bugs fixed the following bugs have been fixed in nss 3.12.6. bug 275744: support for tls compression rfc 3749 bug 494603: update nss's copy of sqlite3 to 3.6.22 to...
NSS Tools sslstrength
the hostname argument must be present. however, the port number is an optional argument, and if not given, will default to the https port (443). ...
...ssl-server, and reports back the encryption cipher and strength used. synopsis 1) sslstrength ciphers 2) sslstrength hostname[:port] [ciphers=xyz] [debug] [verbose] [policy=export|domestic] description the first form simple lists out the possible ciphers. 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. the hostname argument must be present. however, the port number is an optional argument, and if not given, will default to the https port (443). restricting ciphers by default, sslstrength assumes that all the preferences are on, so it will use any preferences in your policy. the enabled ciphersuites will always be printed out before the connection is made. if you want to ...
...rs, where each single character represents a cipher. you can obtain this list of character->cipher mappings by doing 'sslstrength ciphers'. for example, ciphers=bfi will turn on these cipher preferences and turn off all others. policy=export or policy=domestic will set your policies appropriately. policy will default to domestic if not specified. step-up step up is a mode where the connection starts out with 40-bit encryption, but due to a 'change-cipher-spec' handshake, changes to 128-bit encryption. this is only done in 'export mode', with servers with a special certificate. you can tell if you stepped-up, because the output will says 'using export policy', and you'll find the secret key size was 128-bits. prerequisites you should have a cert7.db in the directory in which you ru...
Python binding for NSS
the following module functions were added: ssl.get_ssl_version_from_major_minor ssl.get_default_ssl_version_range ssl.get_supported_ssl_version_range ssl.set_default_ssl_version_range ssl.ssl_library_version_from_name ssl.ssl_library_version_name ssl.get_cipher_suite_info ssl.ssl_cipher_suite_name ssl.ssl_cipher_...
... the following classes were added: sslciphersuiteinfo sslchannelinfo the following class methods were added: certificate.trust_flags certificate.set_trust_attributes sslsocket.set_ssl_version_range sslsocket.get_ssl_version_range sslsocket.get_ssl_channel_info sslsocket.get_negotiated_host sslsocket.connection_info_format_lines sslsocket.connection_info_format sslsocket.connection_info_str sslciphersuiteinfo.format_lines sslciphersuiteinfo.format sslchannelinfo.format_lines sslchannelinfo.format the following class properties were added: certificate.ssl_trust_flags certificate.email_trust_flags certificate.signin...
...view all ref counting, numerous ref counting fixes implement cyclic garbage collection support by adding object traversal and clear methods identify static variables, move to thread local storage remove python-nss specific httplib.py, no longer needed python-nss now compatible with standard library rewrite httplib_example.py to use standard library and illustrate ssl, non-ssl, connection class, http class usage the following classes were added: authkeyid basicconstraints crldistributionpoint crldistributionpts certificateextension generalname signedcrl dn rdn ava certificaterequest the following module functions were added: nss.nss.nss_is_initialized() nss.nss.cert_crl_reason_from_...
NSS Tools sslstrength
the hostname argument must be present. however, the port number is an optional argument, and if not given, will default to the https port (443). ...
...n ssl-server, and reports back the encryption cipher and strength used. synopsis 1) sslstrength ciphers 2) sslstrength hostname[:port] [ciphers=xyz] [debug] [verbose] [policy=export|domestic] description the first form simple lists out the possible ciphers. 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. the hostname argument must be present. however, the port number is an optional argument, and if not given, will default to the https port (443). restricting ciphers by default, sslstrength assumes that all the preferences are on, so it will use any preferences in your policy. the enabled ciphersuites will always be printed out before the connection is made. if you want to t...
...s, where each single character represents a cipher. you can obtain this list of character->cipher mappings by doing 'sslstrength ciphers'. for example, ciphers=bfi will turn on these cipher preferences and turn off all others. policy=export or policy=domestic will set your policies appropriately. policy will default to domestic if not specified. step-up step up is a mode where the connection starts out with 40-bit encryption, but due to a 'change-cipher-spec' handshake, changes to 128-bit encryption. this is only done in 'export mode', with servers with a special certificate. you can tell if you stepped-up, because the output will says 'using export policy', and you'll find the secret key size was 128-bits. prerequisites you should have a cert7.db in the directory in which you run...
Rhino Examples
the jsdoc.js script is a javascript analog to java's javadoc. it makes heavy use of regular expressions. ...
...the jsdoc.js script is a javascript analog to java's javadoc. it makes heavy use of regular expressions. ...
...the jsdoc.js script is a javascript analog to java's javadoc. it makes heavy use of regular expressions. ...
Components.lastResult
most interfaces only return one success code -- ns_ok -- so components.lastresult is rarely necessary. ...
...most interfaces only return one success code -- ns_ok -- so components.lastresult is rarely necessary. ...
...ly return one success code -- ns_ok -- so components.lastresult is rarely necessary. in cases where components.lastresult is used, it is best to get it right away after the target call is made and save it in a local variable to test its value rather than doing multiple tests against components.lastresult. this is because many 'components' properties and methods are themselves implemented using xpconnect and subsequent calls to components.lastresult might reflect the result of 'implicit' xpconnect calls rather than the result of the target call. example in the following example, the local variable i contains the actual result returned by bar() (assuming that bar() is called via xpconnect), and components.lastresult contains the success code returned by bar(). // given that foo.bar is a method ...
Components object
re. warning: this object is only intended for code running with chrome privileges. exposing the object to regular web code was a mistake. if you use this object on your web page, your site might break at any time! in current versions of firefox only a few interfaces required for compatibility are still accessible. don't use components! the components object is the object through which xpconnect functionality is reflected into javascript. the components object is actually a native instance of the nsixpccomponents interface which is reflected into javascript as a top level object using xpconnect. some properties of components require advanced privileges and may not work in web pages. the components object has the following members: classes array of classes by contractid class...
...ich is reflected into javascript as a top level object using xpconnect. some properties of components require advanced privileges and may not work in web pages. ...
... utils.cre...
nsIBadCertListener2
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) replaces the obsolete nsibadcertlistener interface. ...
...(in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite); methods notifycertproblem() called in case of a broken ssl status. boolean notifycertproblem( in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection. this object usually supports nsisslsocketcontrol, nsitransportsecurityinfo, nsiidentityinfo, nsisslstatusprovider, nsiclientauthuserdecision and possibly other interfaces. status the ssl status object that describes the problem(s). targetsite the site name that was used to open the current connection. return value the consumer shall return true if it wants to suppress the error message relat...
... supports nsisslsocketcontrol, nsitransportsecurityinfo, nsiidentityinfo, nsisslstatusprovider, nsiclientauthuserdecision and possibly other interfaces. status the ssl status object that describes the problem(s). targetsite the site name that was used to open the current connection. return value the consumer shall return true if it wants to suppress the error message related to the bad cert (the connection will still get canceled). see also nsisockettransport ...
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 and migration code...
...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 and migration code. read only. gro...
...oid removeobserver(in astring aname, in nsicontentprefobserver aobserver); void removepref(in nsivariant agroup, in astring aname); void removeprefsbyname(in astring aname); void setpref(in nsivariant agroup, in astring aname, in nsivariant avalue); attributes attribute type description dbconnection mozistorageconnection the database connection to the content preferences database. 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 and migration code. read only. grouper nsicontenturigroupe...
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 pair exists ...
...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 pair exists in the form history. b...
...read only. ...
nsISocketProvider
afiledesc, out nsisupports asecurityinfo); native code only! constants constant value description proxy_resolves_host 1 << 0 this flag is set if the proxy is to perform hostname resolution instead of the client. 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. for example, an ssl connection would not send any client-certificates if this flag is set. methods native code only!addtosocket this function is called to allow the socket provider to layer a prfiledesc (a file descriptor) on top of another prfiledesc. for example, ssl via a socks...
...ception of afiledesc, which is an input parameter instead. void addtosocket( in long afamily, in string ahost, in long aport, in string aproxyhost, in long aproxyport, in unsigned long aflags, in prfiledescstar afiledesc, out nsisupports asecurityinfo ); parameters afamily the address family for this socket (pr_af_inet or pr_af_inet6). ahost the hostname for this connection. aport the port for this connection. aproxyhost if non-null, the proxy hostname for this connection. aproxyport the proxy port for this connection. aflags control flags that govern this connection (see constants). afiledesc the existing prfiledesc. asecurityinfo any security info that should be associated with afiledesc. this object typically imp...
...rityinfo. native code only!newsocket creates a new socket. void newsocket( in long afamily, in string ahost, in long aport, in string aproxyhost, in long aproxyport, in unsigned long aflags, out prfiledescstar afiledesc, out nsisupports asecurityinfo ); parameters afamily the address family for this socket (pr_af_inet or pr_af_inet6). ahost the hostname for this connection. aport the port for this connection. aproxyhost if non-null, the proxy hostname for this connection. aproxyport the proxy port for this connection. aflags control flags that govern this connection (see constants) afiledesc the resulting prfiledesc. asecurityinfo any security info that should be associated with afiledesc. this object typically imp...
XPCOM Interface Reference
verimgiencoderimgiloaderimgirequestinidomutilsjsdistackframemoziasyncfaviconsmoziasynchistorymozicoloranalyzermozijssubscriptloadermozipersonaldictionarymoziplaceinfomoziplacesautocompletemoziregistrymozirepresentativecolorcallbackmozispellcheckingenginemozistorageaggregatefunctionmozistorageasyncstatementmozistoragebindingparamsmozistoragebindingparamsarraymozistoragecompletioncallbackmozistorageconnectionmozistorageerrormozistoragefunctionmozistoragependingstatementmozistorageprogresshandlermozistorageresultsetmozistoragerowmozistorageservicemozistoragestatementmozistoragestatementcallbackmozistoragestatementparamsmozistoragestatementrowmozistoragestatementwrappermozistoragevacuumparticipantmozistoragevaluearraymozitxttohtmlconvmozithirdpartyutilmozivisitinfomozivisitinfocallbackmozivisitstatus...
...eckedcomponentnsiseekablestreamnsiselectionnsiselection2nsiselection3nsiselectioncontrollernsiselectionimageservicensiselectionprivatensiserversocketnsiserversocketlistenernsiservicemanagernsisessionstartupnsisessionstorensisimpleenumeratornsismsdatabaseservicensismsrequestmanagernsismsservicensisocketprovidernsisocketproviderservicensisockettransportnsisockettransportservicensisoundnsispeculativeconnectnsistackframensistandardurlnsistreamconverternsistreamlistenernsistringbundlensistringbundleoverridensistringbundleservicensistringenumeratornsistructuredclonecontainernsistylesheetservicensisupportsnsisupports proxiesnsisupportsarraynsisupportscstringnsisupportscharnsisupportsdoublensisupportsfloatnsisupportsidnsisupportsinterfacepointernsisupportsprboolnsisupportsprint16nsisupportsprint32nsisupp...
...dowcreatornsiwindowmediatornsiwindowwatchernsiwindowsregkeynsiwindowsshellservicensiworkernsiworkerfactorynsiworkerglobalscopensiworkermessageeventnsiworkermessageportnsiworkerscopensiwritablepropertybagnsiwritablepropertybag2nsixformsmodelelementnsixformsnsinstanceelementnsixformsnsmodelelementnsixmlhttprequestnsixmlhttprequesteventtargetnsixmlhttprequestuploadnsixpcexceptionnsixpcscriptablensixpconnectnsixsltexceptionnsixsltprocessornsixsltprocessorobsoletensixulappinfonsixulbrowserwindownsixulbuilderlistenernsixulruntimensixulsortservicensixultemplatebuildernsixultemplatequeryprocessornsixultemplateresultnsixulwindownsixmlrpcclientnsixmlrpcfaultnsizipentrynsizipreadernsizipreadercachensizipwriternsmsgfilterfileattribvaluensmsgfolderflagtypensmsgjunkstatusnsmsgkeynsmsglabelvaluensmsgpriorityval...
Performance
current version if you are having problems. caching sqlite has a cache of database pages in memory. it keeps pages associated with the current transaction so it can roll them back, and it also keeps recently used ones so it can run faster. in the past, it flushed the cache at the end of a transaction (by default). in order to keep the cache active between transactions, you needed to have a second connection with a 'dummy' (and schema changing) transaction. that is not needed now. you can control the size of the memory cache using the cache_size pragma. this value controls the number of pages of the file that can be kept in memory at once. the page size can be set using the page_size pragma before any operations have been done on the file. you can see an example of setting the maximum cache size t...
...he cache_size pragma. this value controls the number of pages of the file that can be kept in memory at once. the page size can be set using the page_size pragma before any operations have been done on the file. you can see an example of setting the maximum cache size to be a percentage of memory in nsnavhistory::initdb in toolkit/components/places/src/nsnavhistory.cpp. sharding the cache between connections by default, storage enables the sqlite shared-cache mode which makes multiple connections to the same database share the same cache. the cache is threadsafe. all you need to do is use services.storage.opendatabase(file). some features (virtual tables, full text indexes) are not compatible with shared cache - then you need to use services.storage.openunshareddatabase(file), which doesn't share...
...t writing 0s to disk in an "aci" database is still slow. this made shutdown very slow because the asyncio thread would block shutdown (bug 328598). shutdown times of more than 30 seconds were seen. as a result, this bug introduced incremental history expiration eliminating the need to write many 0s to disk on shutdown. unfortunately, this operation cannot be controlled on a per-transaction or per-connection basis. some operations will benefit, while others will be hurt. ...
xptcall FAQ
ssembly language code. it is used to facilitate cross language and cross thread method calls. porting this code is required in order to make mozilla run on any given platform. why does xptcall exist? xptcall exists for two reasons: to support invoking arbitrary methods on xpcom interfaces. to support dynamically impersonating any xpcom interface. both of these facilities are required by xpconnect. these facilities are also used by xpcom/proxy. it may also be used by other subsystems in the future. the xptcall approach was chosen over an approach that would have required generating stub code for calling and implementing all interfaces. though the chosen approach requires some core platform specific code, it has minimal footprint and is extendable to work with any valid xpcom interface wit...
...s* that, pruint32 methodindex, pruint32 paramcount, nsxptcvariant* params); nsxptcvariant is a discriminated union of the types that can be passed as parameters to the target function (including void* to represent arbitrary pointer types). given the correct set of parameters, this function can call any method on any xpcom interface. xpconnect uses information from typelib files to reflect arbitrary xpcom interfaces into javascript and to make calls from javascript to xpcom using xptc_invokebyindex. the information in the typelibs allows xpconnect to convert function parameters and build the nsxptcvariant array required to make this call. the stubs (or impersonation) facility of xptcall allows for implementing a class which can, at ru...
...edible ideas about how to get the required functionality in a cross platform way and/or without resorting to assembly code i'd love to hear about it. is xptcall a platform requirement for mozilla? yes. mozilla will not run properly without a functioning port of xptcall. non-functional stub code exists to allow building xptcall on non-supported platforms. but any browser feature that relies on xpconnect will fail. any platform that does not do xptcall is in trouble. we need to get moving on getting xptcall working everywhere! what platforms are supported? the growing list: porting status where can i find other resources? the code is at: xpcom/reflect/xptcall a new porting guide is at: https://developer.mozilla.org/en/xptcall_porting_guide pre-implementation proposals are here and here...
Xptcall Porting Guide
porters of this functionality implement the platform specific code for the stub methods that fill the vtbl for ...
...red rather than battle the compiler over what would happen to the stack before my asm code began running. i believe that the non-assembly parts of these files can be copied and reused with minimal (but not zero) platform specific tweaks. feel free to copy and paste as necessary. please remember that safety and reliability are more important than speed optimizations. this code is primarily used to connect xpcom components with javascript; function call overhead is a tiny part of the time involved. i put together xptcall/src/md/test as a place to evolve the basic functionality as a port is coming together. not all of the functionality is exercised, but it is a place to get started. xptcall/tests has an api level test for ns_invokebyindex, but no tests for the stubs functionality. such a test ought ...
...md/test as a place to evolve the basic functionality as a port is coming together. not all of the functionality is exercised, but it is a place to get started. xptcall/tests has an api level test for ns_invokebyindex, but no tests for the stubs functionality. such a test ought to be written, but this has not yet been done. a full 'test' at this point requires building the client and running the xpconnect test called testxpc in mozilla/js/src/xpconnect/tests. getting these ports done is very important. please let me know if you are interested in doing one. i'll answer any questions as i get them. porting status original author: john bandhauer, 31 may 1999. ...
xpidl
Mozilla › Tech › XPIDL › xpidl
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. ...
...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. ...
...yi) -t create a typelib of a specific version number -i add entry to start of include path for ``#include "nsithing.idl" -o use basename (e.g. ...
Inspecting web sockets - Firefox Developer Tools
clicking on a web socket request opens the usual sidebar to reveal additional details. ...
... clicking on a web socket request opens the usual sidebar to reveal additional details. ...
...y to inspect web socket connections. this article explores what functionality the web socket inspector makes available. accessing the inspector when you are inspecting a web app that utilizes a web socket connection, the web socket requests are listed in the list of requests in the network monitor along with all other requests. you can use the ws button to filter the list for just web socket connections. only requests with the 101 status code (websocket protocol handshake) are visible, which indicates that the server is switching to a web socket connection. clicking on a web socket request opens the usual sidebar to reveal additional details. choose the reponse tab to inspect web socket frames sent and received through the selected connection. the live-updated table shows data for sent (...
Firefox Developer Tools
style editor view and edit css styles for the current page. taking screenshots take a screenshot of the entire page or of a single element. measure a portion of the page measure a specific area of a web page. rulers overlay horizontal and vertical rulers on a web page for the latest developer tools and features, try firefox developer edition. download firefox developer edition connecting the developer tools if you open the developer tools using keyboard shortcuts or the equivalent menu items, they'll target the document hosted by the currently active tab. but you can attach the tools to a variety of other targets, too, both within the current browser and in different browsers or even different devices. about:debugging debug add-ons, content tabs, and workers running in t...
...oper tools if you open the developer tools using keyboard shortcuts or the equivalent menu items, they'll target the document hosted by the currently active tab. but you can attach the tools to a variety of other targets, too, both within the current browser and in different browsers or even different devices. about:debugging debug add-ons, content tabs, and workers running in the browser. connecting to firefox for android connect the developer tools to an instance of firefox running on an android device. connecting to iframes connect the developer tools to a specific iframe in the current page. connecting to other browsers connect the developer tools to chrome on android and safari on ios. debugging the browser by default, the developer tools are attached to a web page or web app...
...this is useful for browser and add-on development. browser console see messages logged by the browser itself and by add-ons, and run javascript code in the browser's scope. browser toolbox attach the developer tools to the browser itself. ...
AudioContext.createMediaElementSource() - Web APIs
so playi...
...so playing/pausing the media can still be done through the media element api and the player controls. specifications specification status comment web a...
... cury = (window.event) ? e.pagey : event.clienty + (document.documentelement.scrolltop ? document.documentelement.scrolltop : document.body.scrolltop); gainnode.gain.value = cury/height; } // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(gainnode); gainnode.connect(audioctx.destination); note: as a consequence of calling createmediaelementsource(), audio playback from the htmlmediaelement will be re-routed into the processing graph of the audiocontext. so playing/pausing the media can still be done through the media element api and the player controls. specifications specification status comment web audio apithe definition of 'c...
AudioWorkletNode.port - Web APIs
the read-only port property of the audioworkletnode interface returns the associated messageport. it can be used to communicate between the node and its associated audioworkletprocessor. note: the port at the other end of the channel is available under the port property of the processor. syntax audioworkletnodeinstance.port; value the messageport object that is connecting the audioworkletnode and its associated audioworkletprocessor. examples to demonstrate bidirectional communication capabilities, we'll create an audioworkletprocessor, which will output silence and respond to ping requests from its audioworkletnode. first, we need to define a custom audioworkletprocessor, and register it. note that that this should be done in a separate file. // ping-pong-processor.js class...
... const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) ping...
... specifications specification status comment web audio apithe definition of 'port' in that specification. working draft ...
AudioWorkletProcessor.port - Web APIs
the read-only port property of the audioworkletprocessor interface returns the associated messageport. it can be used to communicate between the processor and the audioworkletnode to which it belongs. note: the port at the other end of the channel is available under the port property of the node. syntax audioworkletprocessorinstance.port; value the messageport object that is connecting the audioworkletprocessor and the associated audioworkletnode. examples to demonstrate bidirectional communication capabilities, we'll create an audioworkletprocessor, which will output silence and respond to ping requests from its audioworkletnode. first, we need to define a custom audioworkletprocessor, and register it. note that that this should be done in a separate file. // ping-pong-proc...
... const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) ping...
... specifications specification status comment web audio apithe definition of 'port' in that specification. working draft ...
AudioWorkletProcessor.process - Web APIs
therefore, you must always check the size of the sample array rather than assuming a particular size. this size may even be allowed to change over time, so you mustn't look at just the first block and assume the sample buffers will always be the same size. syntax var isactivelyprocessing = audioworkletprocessor.process(inputs, outputs, parameters); parameters inputs an array of inputs connected to the node, each item of which is, in turn, an array of channels. each channel is a float32array containing 128 samples. for example, inputs[n][m][i] will access n-th input, m-th channel of that input, and i-th sample of that channel. each sample value is in range of [-1 .. 1]. the number of inputs and thus the length of that array is fixed at the construction of the node (see audioworklet...
... turn, an array of channels. each channel is a float32array containing 128 samples. for example, inputs[n][m][i] will access n-th input, m-th channel of that input, and i-th sample of that channel. each sample value is in range of [-1 .. 1]. the number of inputs and thus the length of that array is fixed at the construction of the node (see audioworkletnodeoptions). if there is no active node connected to the n-th input of the node, inputs[n] will be an empty array (zero input channels available). the number of channels in each input may vary, depending on channelcount and channelcountmode properties. outputs an array of outputs that is similar to the inputs parameter in structure. it is intended to be filled during the execution of the process() method. each of the output channels is f...
...ed (there's no way to call play on the same audiobuffersourcenode again). a node that transforms its input. a processor implementing such a node should return false from the process method to allow the presence of active input nodes and references to the node to determine whether it can be garbage-collected. an example of a node with this behaviour is the gainnode. as soon as there are no inputs connected and references retained, gain can no longer be applied to anything, so it can be safely garbage-collected. a node that transforms its input, but has a so-called tail-time — this means that it will produce an output for some time even after its inputs are disconnected or are inactive (producing zero-channels). a processor implementing such a node should return true from the process method for...
BaseAudioContext.createGain() - Web APIs
gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute";...
... gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute"; } else { gainnode.gai...
... callback function(err) { console.log('the following gum error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } source.connect(gainnode); gainnode.connect(audioctx.destination); ... mute.onclick = voicemute; function voicemute() { if(mute.id == "") { // 0 means mute. if you still hear something, make sure you haven't // connected your source into the output in addition to using the gainnode. gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute"; } else { gainnode.gain.setvalueattime(1, audioctx.currenttime); mute.id = ""; mute.innerhtml = "mute"; } } specifications specification status comment web audio apithe definit...
Broadcast Channel API - Web APIs
they can “subscribe” to a particular channel by constructing their own broadcastchannel with the same name, and have bi-directional communication between all of them. broadcast channel interface creating or joining a channel a client joins a broadcast channel by creating a broadcastchannel object. its constructor takes one single parameter: the name of the channel. if it is the first to connect to that broadcast channel name, the underlying channel is created. // connection to a broadcast channel const bc = new broadcastchannel('test_channel'); sending a message it is enough to call the postmessage() method on the created broadcastchannel object, which takes any object as an argument. an example string message: // example of sending of a very simple message bc.postmessage('this is ...
...// example of sending of a very simple message bc.postmessage('this is a test message.'); any kind of object can be sent, not just a domstring. the api doesn't associate any semantics to messages, so it is up to the code to know what kind of messages to expect and what to do with them. ...
... up to the code to know what kind of messages to expect and what to do with them. receiving a message when a message is posted, a message event is dispatched to each broadcastchannel object connected to this channel. a function can be run for this event with the onmessage event handler: // a handler that only logs the event to the console: bc.onmessage = function (ev) { console.log(ev); } disconnecting a channel to leave a channel, call the close() method on the object. this disconnects the object from the underlying channel, allowing garbage collection. // disconnect the channel bc.close(); conclusion the broadcast channel api's self-contained interface allows cross-context communication. it can be used to detect user actions in other tabs within a same origin, like when the user logs ...
CanvasRenderingContext2D.arcTo() - Web APIs
the canvasrenderingcontext2d.arcto() method of the canvas 2d api adds a circular arc to the current sub-path, using the given control points and radius. the arc is automatically connected to the path's latest point with a straight line, if necessary for the specified parameters. this method is commonly used for making rounded corners. note: be aware that you may get unexpected results when using a relatively large radius: the arc's connecting line will go in whatever direction it must to meet the specified radius. syntax void ctx.arcto(x1, y1, x2, y2, radius); parameters x1 the x-axis coordinate of the first control point. y1 the y-axis coordinate of the first control point. x2 the x-axis coordinate of the second control point. y2 the y-axis coordinate of the second control poi...
...ontrol points are red, and the start point is blue. creating a rounded corner this example creates a rounded corner using arcto(). this is one of the method's most common uses. html <canvas id="canvas"></canvas> javascript the arc begins at the point specified by moveto(): (230, 20). it is shaped to fit control points at (90, 130) and (20, 20), and has a radius of 50. the lineto() method connects the arc to (20, 20) with a straight line. note that the arc's second control point and the point specified by lineto() are the same, which produces a totally smooth corner. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const p0 = { x: 230, y: 20 } const p1 = { x: 90, y: 130 } const p2 = { x: 20, y: 20 } const labelpoint = function (p) { const offs...
...5; ctx.filltext('(' + p.x + ',' + p.y + ')', p.x + offset, p.y + offset); } ctx.beginpath(); ctx.moveto(p0.x, p0.y); ctx.arcto(p1.x, p1.y, p2.x, p2.y, 50); ctx.lineto(p2.x, p2.y); labelpoint(p0); labelpoint(p1); labelpoint(p2); ctx.stroke(); result result of a large radius if you use a relatively large radius, the arc may appear in a place you didn't expect. in this example, the arc's connecting line goes above, instead of below, the coordinate specified by moveto(). this happens because the radius is too large for the arc to fit entirely below the starting point. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(180, 90); ctx.arcto(180,130, 110,130, 130); ctx.lineto(11...
CanvasRenderingContext2D.lineJoin - Web APIs
the canvasrenderingcontext2d.linejoin property of the canvas 2d api determines the shape used to join two line segments where they meet. this property has no effect wherever two connected segments have the same direction, because no joining area will be added in this case. degenerate segments with a length of zero (i.e., with all endpoints and control points at the exact same position) are also ignored. note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods. ...
...are also ignored. note: lines can be drawn with the stroke(), strokerect(), and stroketext() methods. syntax ctx.linejoin = "bevel" || "round" || "miter"; options there are three possible values for this property: "round", "bevel", and "miter". the default is "miter". ...
...options there are three possible values for this property: "round", "bevel", and "miter". the default is "miter". "round" rounds off the corners of a shape by filling an additional sector of disc centered at the common endpoint of connected segments. the radius for these rounded corners is equal to the line width. "bevel" fills an additional triangular area between the common endpoint of connected segments, and the separate outside rectangular corners of each segment. "miter" connected segments are joined by extending their outside edges to connect at a single point, with the effect of filling an additional lozenge-shaped area. this setting is affected by the miterlimit property. default value. examples changing the joins in a path this example applies rounded line joins to a path.
GainNode.gain - Web APIs
Web › API › GainNode › gain
gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute";...
... gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute"; } else { gainnode.gai...
... callback function(err) { console.log('the following gum error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } source.connect(gainnode); gainnode.connect(audioctx.destination); ... mute.onclick = voicemute; function voicemute() { if(mute.id == "") { // 0 means mute. if you still hear something, make sure you haven't // connected your source into the output in addition to using the gainnode. gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute"; } else { gainnode.gain.setvalueattime(1, audioctx.currenttime); mute.id = ""; mute.innerhtml = "mute"; } } specifications specification status comment web audio apithe definit...
GainNode - Web APIs
Web › API › GainNode
gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute";...
... gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute"; } else { gainnode.gai...
... callback function(err) { console.log('the following gum error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } source.connect(gainnode); gainnode.connect(audioctx.destination); ... mute.onclick = voicemute; function voicemute() { if(mute.id == "") { // 0 means mute. if you still hear something, make sure you haven't // connected your source into the output in addition to using the gainnode. gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute"; } else { gainnode.gain.setvalueattime(1, audioctx.currenttime); mute.id = ""; mute.innerhtml = "mute"; } } specifications specification status comment web audio apithe definit...
Gamepad - Web APIs
Web › API › Gamepad
the gamepad interface of the gamepad api defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id. a gamepad object can be returned in one of two ways: via the gamepad property of the gamepadconnected and gamepaddisconnected events, or by grabbing any position in the array returned by the navigator.getgamepads() method. properties gamepad.axes read only an array representing the controls with axes present on the device (e.g. analog thumb sticks). gamepad.buttons read only an array of gamepadbutton objects representing the buttons present on the device. gamepad.connected read only a boolean indicating whether the gamepad is still connected to the system. gamepad.id read only a domstring containing identifying ...
... gamepad.mapping read only a string indicating whether the browser has remapped the controls on the device to a known layout. gamepad.timestamp read only a domhighrestimestamp representing the last time the data for this gamepad was updated. ...
...features like haptic feedback and webvr controller pose information. gamepad.hand read only an enum defining what hand the controller is being held in, or is most likely to be held in. gamepad.hapticactuators read only an array containing gamepadhapticactuator objects, each of which represents haptic feedback hardware available on the controller. example window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at index %d: %s. %d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); specifications specification status comment gamepadthe definition of 'gamepad' in that specification. working draft initial definition gamepad extensionsthe definition of 'gamepa...
IDBDatabase: close event - Web APIs
the close event is fired on idbdatabase when the database connection is unexpectedly closed. this could happen, for example, if the underlying storage is removed or if the user clears the database in the browser's history preferences. note that it is not fired if the database connection is closed normally using idbdatabase.close(). bubbles no cancelable no interface event event handler property onerror examples this example opens a database and listens for the close event: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypa...
...; objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.addeventlistener('close', () => { console.log('database connection closed'); }); }; the same example, using the onclose property instead of addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // de...
...unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.onclose = () => { console.log('database connection closed'); }; }; ...
IDBDatabase.name - Web APIs
Web › API › IDBDatabase › name
for a full example, see our to-do notifications app (view example live). ...
...for a full example, see our to-do notifications app (view example live). ...
...for a full example, see our to-do notifications app (view example live). ...
IDBObjectStoreSync - Web APIs
-populated, or if no record exists with a key corresponding to the value parameter in the index's referenced object store. data_err if this object store uses out-of-line keys, and the key parameter was not passed. serial_err if the data being stored could not be serialized by the internal structured cloning algorithm. createindex() creates and returns a new index with the given name in the connected database. idbindexsync createindex ( in domstring name, in domstring keypath, in optional boolean unique ); parameters name the name of a new index. keypath the key path used by the new index. unique if true, keys in the index must be unique; if false, duplicate keys are allowed. returns idbindexsync an object to access the newly created index. get() retrieves ...
...ame, using the mode of the current transaction. idbindexsync openindex ( in domstring name ) raises (idbdatabaseexception); parameters name the name of the index to open. returns idbindexsync an object to access the index. exceptions this method can raise an idbdatabaseexception with the following code: not_found_err if the index with the given name does not exist in the connected database. put() stores the given value in this object store and returns the key for the stored record. if a record already exists with the given key, it is overwritten. any put ( in any value, in optional any key ) raises (idbdatabaseexception); parameters value the value to be stored in the record. key the key to be used to identify the record. returns any the key for the...
...in this index with the given key. removeindex() destroys an index with the given name. void removeindex ( in domstring indexname ) raises (idbdatabaseexception); parameters indexname the name of the existing index to remove. exceptions this method can raise an idbdatabaseexception with the following code: not_found_err if an index with the given name does not exist in the connected database. ...
IndexedDB API - Web APIs
and usage indexeddb is a transactional database system, like an sql-based rdbms. however, unlike sql-based rdbmses, which use fixed-column tables, indexeddb is a javascript-based object-oriented database. indexeddb lets you store and retrieve objects that are indexed with a key; any objects supported by the structured clone algorithm can be stored. you need to specify the database schema, open a connection to your database, and then retrieve and update data within a series of transactions. read more about the concepts behind indexeddb. learn to use indexeddb asynchronously from first principles with our using indexeddb guide. combine indexeddb for storing data offline with service workers for storing assets offline, as outlined in making pwas work offline with service workers. note: like...
... simple, and differs between browsers. browser storage limits and eviction criteria attempts to explain how this works, at least in the case of firefox. interfaces to get access to a database, call open() on the indexeddb attribute of a window object. this method returns an idbrequest object; asynchronous operations communicate to the calling application by firing events on idbrequest objects. connecting to a database idbenvironment provides access to indexeddb functionality. it is implemented by the window and worker objects. this interface isn't part of the 2.0 specification. idbfactory provides access to a database. this is the interface implemented by the global object indexeddb and is therefore the entry point for the api. idbopendbrequest represents a request to open a database. ...
...ironment provides access to indexeddb functionality. it is implemented by the window and worker objects. this interface isn't part of the 2.0 specification. idbfactory provides access to a database. this is the interface implemented by the global object indexeddb and is therefore the entry point for the api. idbopendbrequest represents a request to open a database. idbdatabase represents a connection to a database. it's the only way to get a transaction on the database. retrieving and modifying data idbtransaction represents a transaction. you create a transaction on a database, specify the scope (such as which object stores you want to access), and determine the kind of access (read only or readwrite) that you want. idbrequest generic interface that handles database requests and p...
MediaElementAudioSourceNode - Web APIs
so playi...
...so playing/pausing the media can still be done through the media element api and the player controls. specification specification status comment web au...
... cury = (window.event) ? e.pagey : event.clienty + (document.documentelement.scrolltop ? document.documentelement.scrolltop : document.body.scrolltop); gainnode.gain.value = cury/height; } // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(gainnode); gainnode.connect(audioctx.destination); note: as a consequence of calling createmediaelementsource(), audio playback from the htmlmediaelement will be re-routed into the processing graph of the audiocontext. so playing/pausing the media can still be done through the media element api and the player controls. specification specification status comment web audio apithe definition of 'me...
MediaStreamTrack - Web APIs
d by the web application to provide a hint as to what type of content the track contains to guide how it should be treated by api consumers. mediastreamtrack.enabled a boolean whose value of true if the track is enabled, that is allowed to render the media source stream; or false if it is disabled, that is not rendering the media source stream but silence and blackness. if the track has been disconnected, this value can be changed but has no more effect. note: you can implement standard "mute" functionality by setting enabled to false. the muted property refers to a condition in which there's no media because of a technical issue. mediastreamtrack.id read only returns a domstring containing a unique identifier (guid) for the track; it is generated by the browser. mediastreamtrack.isolate...
...returns a domstring set to "audio" if the track is an audio track and to "video", if it is a video track. it doesn't change if the track is deassociated from its source. mediastreamtrack.label read only returns a domstring containing a user agent-assigned label that identifies the track source, as in "internal microphone". the string may be left empty and is empty as long as no source has been connected. when the track is deassociated from its source, the label is not changed. mediastreamtrack.muted read only returns a boolean value indicating whether the track is unable to provide media data due to a technical issue. note: you can implement standard "mute" functionality by setting enabled to false, and unmute the media by setting it back to true again. mediastreamtrack.readonly read on...
... true again. mediastreamtrack.readonly read only returns a boolean value with a value of true if the track is readonly (such a video file source or a camera that settings can't be modified), false otherwise. mediastreamtrack.readystate read only returns an enumerated value giving the status of the track. this will be one of the following values: "live" which indicates that an input is connected and does its best-effort in providing real-time data. in that case, the output of data can be switched on or off using the enabled attribute. "ended" which indicates that the input is not giving any more data and will never provide new data. mediastreamtrack.remote read only returns a boolean with a value of true if the track is sourced by a rtcpeerconnection, false otherwise. meth...
MutationObserver.observe() - Web APIs
method observe() configures the mutationobserver callback to begin receiving notifications of changes to the dom that match the given options. depending on the configuration, the observer may watch a single node in the dom tree, or that node and some or all of its descendant nodes. to stop the mutationobserver (so that none of its callbacks will be triggered any longer), call mutationobserver.disconnect(). syntax mutationobserver.observe(target, options) parameters target a dom node (which may be an element) within the dom tree to watch for changes, or to be the root of a subtree of nodes to be watched. options a mutationobserverinit object providing options that describe which dom mutations should be reported to mutationobserver’s callback. return value undefined. exceptions ...
...eats to note: if you call observe() on a node that's already being observed by the same mutationobserver, all existing observers are automatically removed from all targets being observed before the new observer is activated. if the same mutationobserver is not already in use on the target, then the existing observers are left alone and the new one is added. observation follows nodes when disconnected mutation observers are intended to let you be able to watch the desired set of nodes over time, even if the direct connections between those nodes are severed. if you begin watching a subtree of nodes, and a portion of that subtree is detached and moved elsewhere in the dom, you continue to watch the detached segment of nodes, receiving the same callbacks as before the nodes were detached from...
...ere in the dom, you continue to watch the detached segment of nodes, receiving the same callbacks as before the nodes were detached from the original subtree. in other words, until you've been notified that nodes are being split off from your monitored subtree, you'll get notifications of changes to that split-off subtree and its nodes. this prevents you from missing changes that occur after the connection is severed and before you have a chance to specifically begin monitoring the moved node or subtree for changes. theoretically, this means that if you keep track of the mutationrecord objects describing the changes that occur, you should be able to "undo" the changes, rewinding the dom back to its initial state. example in this example, we demonstrate how to call the method observe() on an i...
MutationObserver.takeRecords() - Web APIs
the mutationobserver method takerecords() returns a list of all matching dom changes that have been detected but not yet processed by the observer's callback function, leaving the mutation queue empty. the most common use case for this is to immediately fetch all pending mutation records immediately prior to disconnecting the observer, so that any pending mutations can be processed when stopping down the observer. syntax const mutationrecords = mutationobserver.takerecords() parameters none. return value an array mutationrecord objects, each describing one change applied to the observed portion of the document's dom tree. note: the queue of mutations which have occurred, but not been delivered to the observer's callback is left empty after calling takerecords(). example in this examp...
...alue an array mutationrecord objects, each describing one change applied to the observed portion of the document's dom tree. note: the queue of mutations which have occurred, but not been delivered to the observer's callback is left empty after calling takerecords(). ...
...disconnecting the observer. const targetnode = document.queryselector("#someelement"); const observeroptions = { childlist: true, attributes: true } const observer = new mutationobserver(callback); observer.observe(targetnode, observeroptions); /* ...later, when it's time to stop observing... */ /* handle any still-pending mutations */ let mutations = observer.takerecords(); observer.disconnect(); if (mutations) { callback(mutations); } the code in lines 12–17 fetches any unprocessed mutation records, then invokes the callback with the records so that they can be processed. this is done immediately prior to calling disconnect() to stop observing the dom. specifications specification status comment domthe definition of 'mutationobserver.takerecords()'...
Online and offline events - Web APIs
nline/offline events help to simplify. api navigator.online navigator.online is a property that maintains a true/false value (true for online, false for offline). this property is updated whenever the user switches into "offline mode" by selecting the corresponding menu item (file -> work offline in firefox). additionally, this property should update whenever a browser is no longer capable of connecting to the network. according to the specification: the navigator.online attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)... firefox 2 updates this property when switching to/from the browser's offline mode. firefox 41 updates this property when the os reports ...
...according to the specification: the navigator.online attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)... firefox 2 updates this property when switching to/from the browser's offline mode. firefox 41 updates this property when the os reports a change in network connectivity on windows, linux, and os x. this property existed in older versions of firefox and internet explorer (the specification based itself off of these prior implementations), so you can begin using it immediately. network status autodetection was implemented in firefox 2. "online" and "offline" events firefox 3 introduces two new events: "online" and "offline". these two events are fired on t...
...vents: "online" and "offline". these two events are fired on the <body> of each page when the browser switches between online and offline mode. additionally, the events bubble up from document.body, to document, ending at window. both events are non-cancellable (you can't prevent the user from coming online, or going offline). firefox 41 fires these events when the os reports a change in network connectivity on windows, linux, and os x. you can register listeners for these events in a few familiar ways: using addeventlistener on the window, document, or document.body by setting the .ononline or .onoffline properties on document or document.body to a javascript function object. (note: using window.ononline or window.onoffline will not work for compatibility reasons.) by specifying ononline=...
Navigator.onLine - Web APIs
returns the online status of the browser. the property returns a boolean value, with true meaning online and false meaning offline. the property sends updates whenever the browser's ability to connect to the network changes. the update occurs when the user follows links or when a script requests a remote page. for example, the property should return false when users click links soon after they lose internet connection. browsers implement this property differently. in chrome and safari, if the browser is not able to connect to a local area network (lan) or a router, it is offline; all other conditions return true. so while you can assume that the browser is offline when it returns a false value, you cannot assume that a true value necessarily means that the browser can access the internet. you ...
... router, it is offline; all other conditions return true. so while you can assume that the browser is offline when it returns a false value, you cannot assume that a true value necessarily means that the browser can access the internet. you could be getting false positives, such as in cases where the computer is running a virtualization software that has virtual ethernet adapters that are always "connected." therefore, if you really want to determine the online status of the browser, you should develop additional means for checking. to learn more, see the html5 rocks article, working off the grid. in firefox and internet explorer, switching the browser to offline mode sends a false value. until firefox 41, all other conditions return a true value; testing actual behavior on nightly 68 on window...
...to determine the online status of the browser, you should develop additional means for checking. to learn more, see the html5 rocks article, working off the grid. in firefox and internet explorer, switching the browser to offline mode sends a false value. until firefox 41, all other conditions return a true value; testing actual behavior on nightly 68 on windows shows that it only looks for lan connection like chrome and safari giving false positives. you can see changes in the network state by listening for the events on window.ononline and window.onoffline. syntax online = window.navigator.online; value online is a boolean true or false. example view a live example. to check if you are online, query window.navigator.online, as in the following example: if (navigator.online) { con...
PannerNode.coneInnerAngle - Web APIs
working draft ...
... working draft ...
... working draft ...
PannerNode.coneOuterAngle - Web APIs
working draft ...
... working draft ...
... working draft ...
PannerNode.coneOuterGain - Web APIs
working draft ...
... working draft ...
... working draft ...
PannerNode.orientationX - Web APIs
working draft ...
... working draft ...
... working draft ...
PannerNode.orientationY - Web APIs
working draft ...
... working draft ...
... working draft ...
PannerNode.orientationZ - Web APIs
working draft ...
... working draft ...
... working draft ...
PerformanceResourceTiming.domainLookupEnd - Web APIs
"resource" type events are logged. ...
... events are logged. ...
...; } } function print_start_and_end_properties(perfentry) { // print timestamps of the *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status ...
PerformanceResourceTiming.domainLookupStart - Web APIs
events are logged. ...
...d. ...
...print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status ...
PerformanceResourceTiming.fetchStart - Web APIs
events are logged. ...
...d. ...
...print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status ...
PerformanceResourceTiming.redirectEnd - Web APIs
events are logged. ...
...d. ...
...print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status ...
PerformanceResourceTiming.redirectStart - Web APIs
events are logged. ...
...d. ...
...print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status ...
PerformanceResourceTiming.responseStart - Web APIs
events are logged. ...
...d. ...
...print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specification status ...
PerformanceResourceTiming.workerStart - Web APIs
events are logged. ...
...d. ...
...print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart", "workerstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("... " + properties[i] + " = " + value); } else { console.log("... " + properties[i] + " = not supported"); } } } specifications specifica...
PerformanceResourceTiming - Web APIs
browser starts to fetch the resource. performanceresourcetiming.domainlookupstartread only a domhighrestimestamp immediately before the browser starts the domain name lookup for the resource. performanceresourcetiming.domainlookupendread only a domhighrestimestamp representing the time immediately after the browser finishes the domain name lookup for the resource. ...
...ghrestimestamp immediately before the browser starts the domain name lookup for the resource. performanceresourcetiming.domainlookupendread only a domhighrestimestamp representing the time immediately after the browser finishes the domain name lookup for the resource. performanceresourcetiming.connectstartread only a domhighrestimestamp immediately before the browser starts to establish the connection to the server to retrieve the resource. performanceresourcetiming.connectendread only a domhighrestimestamp immediately after the browser finishes establishing the connection to the server to retrieve the resource. performanceresourcetiming.secureconnectionstartread only a domhighrestimestamp immediately before the browser starts the handshake process to secure the current connection. p...
...e the browser starts requesting the resource from the server. performanceresourcetiming.responsestartread only a domhighrestimestamp immediately after the browser receives the first byte of the response from the server. performanceresourcetiming.responseendread only a domhighrestimestamp immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first. performanceresourcetiming.transfersizeread only a number representing the size (in octets) of the fetched resource. the size includes the response header fields plus the response payload body. performanceresourcetiming.encodedbodysizeread only a number representing the size (in octets) received from the fetch (http or cache), of the payload body, before ...
RTCConfiguration.iceTransportPolicy - Web APIs
its value must come from the rtcicetransportpolicy enumerated type. if this property isn't included in the rtcconfiguration, the default value, all, is used. ...
...ndidates relayed by a stun or turn server. this can be used to prevent the remote endpoint from receiving the user's ip addresses, which may be important in some security situations. for example, in a video calling application, the app may want to prevent unknown callers from learning the callee's ip addresses until the callee has agreed to receive the call. ...
... video calling application, the app may want to prevent unknown callers from learning the callee's ip addresses until the callee has agreed to receive the call. examples in this example, a new connection is configured to only accept relay candidates. let config = { iceservers: [ { urls: [ "stun:stun.example.com" ] }, ], icetransportpolicy: "relay" }; let pc = new rtcpeerconnection(config); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtccandidate.icetransportpolicy' in that specification. candidate recommendation initial definition. ...
RTCDataChannel.onopen - Web APIs
ta channel's underlying data transport—the link over which the rtcdatachannel's messages flow—is established or re-established. syntax rtcdatachannel.onopen = function; value a function which the browser will call to handle the open event. the function receives as its only input parameter the event itself, of type event. ...
...lying data transport—the link over which the rtcdatachannel's messages flow—is established or re-established. syntax rtcdatachannel.onopen = function; value a function which the browser will call to handle the open event. the function receives as its only input parameter the event itself, of type event. example this example adds a new data channel to an existing rtcpeerconnection, mypeerconnection. ...
...e browser will call to handle the open event. the function receives as its only input parameter the event itself, of type event. example this example adds a new data channel to an existing rtcpeerconnection, mypeerconnection. it then establishes an open event handler which updates some user interface elements to prepare them for being used to send messages over the data channel. ...
RTCIceCandidate.usernameFragment - Web APIs
rnamefragment and password both change every time an ice restart occurs. example although the webrtc infrastructure will filter out obsolete candidates for you after an ice restart, you can do it yourself if you're trying to absolutely minimize the number of messages going back and forth. to do so, you can compare the value of usernamefragment to the current usernamefragment being used for the connection after receiving the candidate from the signaling server and before caling addicecandidate() to add it to the set of possible candidates. when the web app receives a message from the signaling server that includes a candidate to be added to the rtcpeerconnection, you can (and generally should) simply call addicecandidate(). there's not typically a need to manually worry about filtering the can...
...added to the rtcpeerconnection, you can (and generally should) simply call addicecandidate(). there's not typically a need to manually worry about filtering the candidates. however, let's imagine that we do need to minimize traffic. the function below, ssnewcandidate(), is called when a message, signalmsg, arrives from the signaling server that contains an ice candidate to be added to the rtcpeerconnection. to avoid including candidates obsoleted by an ice restart, we can use code like this: const ssnewcandidate = signalmsg => { let candidate = new rtcicecandidate(signalmsg.candidate); let receivers = pc.getreceivers(); receivers.foreach(receiver => { let parameters = receiver.transport.getparameters(); if (parameters.usernamefragment === candidate.usernamefragment) { retu...
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.usernamefragment' in that specification. candidate recommendation initial definition. ...
RTCIceCandidatePairStats.requestsSent - Web APIs
note: the reported number of requests does not include retransmissions. if a request had to be repeated due to network issues, it will be counted multiple times here. this differs from requestsreceived, which does include retransmisions. ...
... note: the reported number of requests does not include retransmissions. if a request had to be repeated due to network issues, it will be counted multiple times here. this differs from requestsreceived, which does include retransmisions. ...
... note: the reported number of requests does not include retransmissions. if a request had to be repeated due to network issues, it will be counted multiple times here. this differs from requestsreceived, which does include retransmisions. ...
RTCIceServer.username - Web APIs
specifies the username to use when authenticating with the ice server being described. this value is used when the rtciceserver describes a turn server. syntax var iceserver = { ... username = username, ... ...
...cribed. this value is used when the rtciceserver describes a turn server. syntax var iceserver = { ... username = username, ... }; var username = iceserver.username; iceserver.username = newusername; example this example creates a new rtcpeerconnection which will use a turn server at turnserver.example.org to negotiate connections. ...
...... username = username, ... }; var username = iceserver.username; iceserver.username = newusername; example this example creates a new rtcpeerconnection which will use a turn server at turnserver.example.org to negotiate connections. logging into the turn server will use the username "webrtc" and the creative password "turnpassword". mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: "turn:turnserver.example.org", // a turn server username: "webrtc", credential: "turnpassword" } ] }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceserver.username' in that specification. candidate recommenda...
RTCIdentityErrorEvent - Web APIs
properties a rtcidentityerrorevent being an event, this event also implements these properties. ...
... properties a rtcidentityerrorevent being an event, this event also implements these properties. ...
... properties a rtcidentityerrorevent being an event, this event also implements these properties. ...
RTCIdentityEvent - Web APIs
properties a rtcidentityevent being an event, this event also implements these properties. rtcidentityevent.assertion read only returns the domstring containing a blob being the assertion generated. ...
... properties a rtcidentityevent being an event, this event also implements these properties. rtcidentityevent.assertion read only returns the domstring containing a blob being the assertion generated. ...
... properties a rtcidentityevent being an event, this event also implements these properties. rtcidentityevent.assertion read only returns the domstring containing a blob being the assertion generated. ...
RTCNetworkType - Web APIs
the webrtc rtcnetworktype enumerated type defines a set of strings used to identify the type of network used by a connection between two peers. this type is used as the value or the following properties: rtcicecandidate's networktype rtcstunserverconnectionstats's networktype values bluetooth a bluetooth connection is used by the described connection. cellular the connection uses a cellular data service to connect. this includes all cellular data services including edge (2g), hspa (3g), lte (4g), and nr (5g). ethernet the described connection uses an ethernet network. wifi the described connection uses wifi. wimax the described connection uses a wimax network. vpn the connection uses a virtual private network (vpn). the vpn obscures the underlying network type, which is not d...
... (3g), lte (4g), and nr (5g). ethernet the described connection uses an ethernet network. wifi the described connection uses wifi. wimax the described connection uses a wimax network. vpn the connection uses a virtual private network (vpn). the vpn obscures the underlying network type, which is not discernible. unknown the user's browser is unable or unwilling to identify the underlying connection technology used by the described connection. this may be because the browser isn't able to determine the network type for some reason or it may be intentionally getting obscured for security reasons, such as to avoid device fingerprinting. ...
...known the user's browser is unable or unwilling to identify the underlying connection technology used by the described connection. this may be because the browser isn't able to determine the network type for some reason or it may be intentionally getting obscured for security reasons, such as to avoid device fingerprinting. note: keep in mind that the specified value only reflects the initial connection between the local peer and the next hop along the network toward reaching the remote peer. for example, if the networktype is wifi but the user is connected using a cellular hotspot, the connection will be bottlenecked by the underlying cellular network (and any other networks between the two peers). specifications specification status comment webrtc 1.0: real-time c...
RTCRtpSender.setStreams() - Web APIs
tream); rtcrtpsender.setstreams([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. ...
...ciated 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 belongs. example this example adds all of an rtcpeerconnection's tracks to the specified stream. ...
..., renegotiation of the connection will be triggered by the negotiationneeded event being dispatched to the rtcpeerconnection to which the sender belongs. example this example adds all of an rtcpeerconnection's tracks to the specified stream. function addtrackstostream(stream) { let senders = pc.getsenders(); senders.foreach((sender) => { if (sender.track && (sender.transport.state === connected)) { sender.setstreams(stream); } }); } after calling the rtcpeerconnection method getsenders() to get the list of the connection's senders, the addtrackstostream() function iterates over the list. for each sender, if the sender's track is non-null and its transport's state is connected, we call setstreams() to add the track to the stream specified. specifications specif...
Resource Timing API - Web APIs
s accurate to a millisecond. resource loading timestamps an application can get timestamps for the various stages used to load a resource. the first property in the processing model is starttime which returns the timestamp immediately before the resource loading process begins. the fetchstart timestamps follows and redirect processing (if applicable) and preceeds dns lookup. the next stages are connectstart and connectend which are the timestamps immediately before and after connecting to the server, respectively. the last three timestamps are, in order: requeststart - the timestamp before the browser starts requesting the resource from the server; responsestart - the timestamp after the browser receives the first byte of the response from the server; and responseend - the timestamp after the b...
...to the server, respectively. the last three timestamps are, in order: requeststart - the timestamp before the browser starts requesting the resource from the server; responsestart - the timestamp after the browser receives the first byte of the response from the server; and responseend - the timestamp after the browser receives the last byte of the resource. if the resource is loaded via a secure connection a secureconnectionstart timestamp will be available between the connection start and end events. when cors is in effect, many of these values are returned as zero unless the server's access policy permits these values to be shared. this requires the server providing the resource to send the timing-allow-origin http response header with a value specifying the origin or origins which are allow...
...his requires the server providing the resource to send the timing-allow-origin http response header with a value specifying the origin or origins which are allowed to get the restricted timestamp values. the properties which are returned as 0 by default when loading a resource from a domain other than the one of the web page itself: redirectstart, redirectend, domainlookupstart, domainlookupend, connectstart, connectend, secureconnectionstart, requeststart, and responsestart. the performanceresourcetiming interface also includes several network timing properties. the redirectstart and redirectend properties return timestamps for redirect start and end times, respectively. likewise, the the domainlookupstart and domainlookupend properties return timestamps for dns lookup start and end times, re...
WebSocket.close() - Web APIs
Web › API › WebSocket › close
this string must be no longer than 123 bytes of utf-8 text (not characters). exceptions thrown invalid_access_err an invalid code was specified. syntax_err the reason string is too long or contains unpaired surrogates. ...
...this string must be no longer than 123 bytes of utf-8 text (not characters). exceptions thrown invalid_access_err an invalid code was specified. syntax_err the reason string is too long or contains unpaired surrogates. ...
...this string must be no longer than 123 bytes of utf-8 text (not characters). exceptions thrown invalid_access_err an invalid code was specified. ...
The WebSocket API (WebSockets) - Web APIs
the websocket api is an advanced technology that makes it possible to open a two-way interactive communication session between the user's browser and a server. with this api, you can send messages to a server and receive event-driven responses without having to poll the server for a reply. note: while a websocket connection is functionally somewhat similar to standard unix-style sockets, they are not related. interfaces websocket the primary interface for connecting to a websocket server and then sending and receiving data on the connection. closeevent the event sent by the websocket object when the connection closes. messageevent the event sent by the websocket object when a message is received from the server. guides writing websocket client applications writing websocket ser...
...et implementation for node.js (uwebsockets v0.14 fork) socket.io: a long polling/websocket based third party transfer protocol for node.js. socketcluster: a pub/sub websocket framework for node.js with a focus on scalability. websocket-node: a websocket server api implementation for node.js. total.js: web application framework for node.js (example: websocket chat) faye: a websocket (two-ways connections) and eventsource (one-way connections) for node.js server and client. signalr: signalr will use websockets under the covers when it's available, and gracefully fallback to other techniques and technologies when it isn't, while your application code stays the same. caddy: a web server capable of proxying arbitrary commands (stdin/stdout) as a websocket. ws: a popular websocket client & serv...
... signalr will use websockets under the covers when it's available, and gracefully fallback to other techniques and technologies when it isn't, while your application code stays the same. caddy: a web server capable of proxying arbitrary commands (stdin/stdout) as a websocket. ws: a popular websocket client & server library for node.js. jsonrpc-bidirectional: asynchronous rpc which, on a single connection, may have functions exported on the server and, and the same time, on the client (client may call server, server may also call client). cowboy: cowboy is a small, fast and modern http server for erlang/otp with websocket support. related topics ajax javascript specifications specification status comments html living standardthe definition of 'websocket api...
Background audio processing using AudioWorklet - Web APIs
rklet's domxref("worklet.addmodule", "addmodule()")}} method to install the audio worklet processor module. as needed, create audio processing nodes by passing the processor's name (which is defined by the module) to the audioworkletnode() constructor. set up any audio parameters the audioworkletnode needs, or that you wish to configure. these are defined in the audio worklet processor module. connect the created audioworkletnodes into your audio processing pipeline as you would any other node, then use your audio pipeline as usual. throughout the remainder of this article, we'll look at these steps in more detail, with examples (including working examples you can try out on your own). the example code found on this page is derived from this working example which is available on glitch. the...
... to change this behavior if possible as it may have a slight negative impact on performance. creating an audio processor worklet node to create an audio node that pumps blocks of audio data through an audioworkletprocessor, you need to follow these simple steps: load and install the audio processor module create an audioworkletnode, specifying the audio processor module to use by its name connect inputs to the audioworkletnode and its outputs to appropriate destinations (either other nodes or to the audiocontext object's destination property. to use an audio worklet processor, you can use code similar to the following: let audiocontext = null; async function createmyaudioprocessor() { if (!audiocontext) { try { audiocontext = new audiocontext(); await audiocontext.re...
...orkletnode configured to use your audio processor. it also handles creating the audio context if it hasn't already been done. in order to ensure the context is usable, this starts by creating the context if it's not already available, then adds the module containing the processor to the worklet. once that's done, it instantiates and returns a new audioworkletnode. once you have that in hand, you connect it to other nodes and otherwise use it just like any other node. you can then create a new audio processor node by simply doing this: let newprocessornode = createmyaudioprocessor(); if the returned value, newprocessornode, is non-null, we have a valid audio context with its hiss processor node in place and ready to use. supporting audio parameters just like any other web audio node, audiowo...
Using the application cache - HTML: Hypertext Markup Language
tions: cache, network, and fallback. cache: this is the default section for entries in a cache manifest file. files listed under the cache: section header (or immediately after the cache manifest line) are explicitly cached after they're downloaded for the first time. network: files listed under the network: section header in the cache manifest file are white-listed resources that require a connection to the server. all requests to such resources bypass the cache, even if the user is offline. the wildcard character * can be used once. most sites need *. fallback: the fallback: section specifies fallback pages the browser should use if a resource is inaccessible. each entry in this section lists two uris—the first is the resource, the second is the fallback. both uris must be relative an...
...011-08-14 # this is another comment index.html cache.html style.css image1.png # use from network if available network: network.html # fallback content fallback: . fallback.html this example uses network and fallback sections to specify that the network.html page must always be retrieved from the network, and that the fallback.html page should be served as a fallback resource (e.g., in case a connection to the server cannot be established). structure of a cache manifest file cache manifest files must be served with the text/cache-manifest mime type. all resources served using this mime type must follow the syntax for an application cache manifest, as defined in this section. cache manifests are utf-8 format text files, and may optionally include a bom character. newlines may be represented...
...a varies from section to section. in the explicit (cache:) section, each line is a valid uri or iri reference to a resource to cache (no wildcard characters are allowed in this sections). whitespace is allowed before and after the uri or iri on each line. in the fallback section each line is a valid uri or iri reference to a resource, followed by a fallback resource that is to be served up when a connection with the server cannot be made. in the network section, each line is a valid uri or iri reference to a resource to fetch from the network (or the wildcard character * can be used in this section). note: relative uris are relative to the cache manifest's uri, not to the uri of the document referencing the manifest. cache manifest files can switch from section to section at will (each secti...
Strict-Transport-Security - HTTP
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 secure version of the original si...
...ure version of the original site. the http strict transport security header informs the browser that it should never load a site using http and should automatically convert all attempts to access the site using http to https requests instead. note: the strict-transport-security header is ignored by the browser when your site is accessed using http; this is because an attacker may intercept http connections and inject the header or remove it. when your site is accessed over https with no certificate errors, the browser knows your site is https capable and will honor the strict-transport-security header. an example scenario you log into a free wifi access point at an airport and start surfing the web, visiting your online banking service to check your balance and pay a couple of bills. unfortun...
...t attempt to load the site via http will proceed as normal instead of automatically using https. whenever the strict-transport-security header is delivered to the browser, it will update the expiration time for that site, so sites can refresh this information and prevent the timeout from expiring. should it be necessary to disable strict transport security, setting the max-age to 0 (over a https connection) will immediately expire the strict-transport-security header, allowing access via http. preloading strict transport security google maintains an hsts preload service. by following the guidelines and successfully submitting your domain, browsers will never connect to your domain using an insecure connection. while the service is hosted by google, all browsers have stated an intent to use (or...
Proxy servers and tunneling - HTTP
tion-dependent content. a common way to disclose this information is by using the following http headers: the standardized header: forwarded contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the path of the request. ...
...ins information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the path of the request. or the de-facto standard versions: x-forwarded-for identifies the originating ip addresses of a client connecting to a web server through an http proxy or a load balancer. x-forwarded-host identifies the original host requested that a client used to connect to your proxy or load balancer. x-forwarded-proto identifies the protocol (http or https) that a client used to connect to your proxy or load balancer. to provide information about the proxy itself (not about the client connecting to it), the via header can be used. via added by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers. ...
...d by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers. http tunneling tunneling transmits private network data and protocol information through public network by encapsulating the data. http tunneling is using a protocol of higher level (http) to transport a lower level protocol (tcp). the http protocol specifies a request method called connect. it starts two-way communications with the requested resource and can be used to open a tunnel. this is how a client behind an http proxy can access websites using ssl (i.e. https, port 443). note, however, that not all proxy servers support the connect method or limit it to port 443 only. see also the http tunnel article on wikipedia. proxy auto-configuration (pac) a proxy auto-configuration ...
HTTP Public Key Pinning (HPKP) - HTTP
ed. to ensure the authenticity of a server's public key used in tls sessions, this public key is wrapped into a x.509 certificate which is usually signed by a certificate authority (ca). web clients such as browsers trust a lot of these cas, which can all create certificates for arbitrary domain names. if an attacker is able to compromise a single ca, they can perform mitm attacks on various tls connections. hpkp can circumvent this threat for the https protocol by telling the client which public key belongs to a certain web server. hpkp is a trust on first use (tofu) technique. the first time a web server tells a client via a special http header which public keys belong to it, the client stores this information for a given period of time. when the client visits the server again, it expects at ...
... -in my-signing-request.csr -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 openssl x509 -in my-certificate.crt -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 the following command will extract the base64 encoded information for a website. ...
...all subdomains, which is told by the includesubdomains declaration. finally, report-uri="https://www.example.net/hpkp-report" explains where to report pin validation failures. report-only header instead of using a public-key-pins header you can also use a public-key-pins-report-only header. this header only sends reports to the report-uri specified in the header and does still allow browsers to connect to the webserver even if the pinning is violated. setting up your webserver to include the hpkp header the concrete steps necessary to deliver the hpkp header depend on the web server you use. note: these examples use a max-age of two months and include all subdomains. it is advised to verify that this setup will work for your server. hpkp has the potential to lock out users for a long tim...
Web video codec guide - Web media technologies
andard. while in general, mpeg-4 part 2 video is not used by anyone because of its lack of compelling value related to other codecs, mp4v-es does have some usage on mobile. mp4v is essentially h.263 encoding in an mpeg-4 container. its primary purpose is to be used to stream mpeg-4 audio and video over an rtp session. however, mp4v-es is also used to transmit mpeg-4 audio and video over a mobile connection using 3gp. you almost certainly don't want to use this format, since it isn't supported in a meaningful way by any major browsers, and is quite obsolete. files of this type should have the extension .mp4v, but sometimes are inaccurately labeled .mp4. supported bit rates 5 kbps to 1 gbps and more supported frame rates no specific limit; restricted only by the data rate...
... 3gp, ogg, webm rtp / webrtc compatible yes; vp8 is one of the spec-required codecs for webrtc supporting/maintaining organization google specification rfc 6386 licensing open and free of royalties and any other licensing requirements [1] edge support for vp8 requires the use of media source extensions. [2] safari only supports vp8 in webrtc connections. [3] firefox only supports vp8 in mse when no h.264 hardware decoder is available. use mediasource.istypesupported() to check for availability. vp9 video processor 9 (vp9) is the successor to the older vp8 standard developed by google. like vp8, vp9 is entirely open and royalty-free. its encoding and decoding performance is comparable to or slightly faster than that of avc, but with better...
... compression is by definition less effective than lossy compression. for example, uncompressed 1080p video (1920 by 1080 pixels) with 4:2:0 chroma subsampling needs at least 1.5 gbps. using lossless compression such as ffv1 (which is not supported by web browsers) could perhaps reduce that to somewhere around 600 mbps, depending on the content. that's still a huge number of bits to pump through a connection every second, and is not currently practical for any real-world use. this is the case even though some of the lossy codecs have a lossless mode available; the lossless modes are not implemented in any current web browsers. the best you can do is to select a high-quality codec that uses lossy compression and configure it to perform as little compression as possible. one way to do this is to co...
Introduction to progressive web apps - Progressive web apps (PWAs)
nly a rough indicator. there are some key principles a web app should try to observe to be identified as a pwa. it should be: discoverable, so the contents can be found through search engines. installable, so it can be available on the device's home screen or app launcher. linkable, so you can share it by simply sending a url. ...
... offering these features and making use of all the advantages offered by web applications can create a compelling, highly flexible offering for your users and customers. ...
...x installation process. this is how it has always been. network independence modern web apps can work when the network is unreliable, or even non-existent. the basic ideas behind network independence are to be able to: revisit a site and get its contents even if no network is available. browse any kind of content the user has previously visited at least once, even under situations of poor connectivity. control what is shown to the user in situations where there is no connectivity. this is achieved using a combination of technologies: service workers to control page requests (for example storing them offline), the cache api for storing responses to network requests offline (very useful for storing site assets), and client-side data storage technologies such as web storage and indexeddb ...
Paths - SVG: Scalable Vector Graphics
Web › SVG › Tutorial › Paths
lways unitless and hence in the user coordinate system. later, we will learn how paths can be transformed to suit other needs. line commands there are five line commands for <path> nodes. the first command is the "move to" or m, which was described above. it takes two parameters, a coordinate (x) and coordinate (y) to move to. if the cursor was already somewhere on the page, no line is drawn to connect the two positions. the "move to" command appears at the beginning of paths to specify where the drawing should start. for example: m x y (or) m dx dy in the following example there's only a point at (10,10). note, though, that it wouldn't show up if a path was just drawn normally. for example: <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <path d="m10 10"/> <!-- po...
...lts, although the cubic one allows greater freedom in exactly what the curve looks like. deciding which curve to use is situational and depends on the amount of symmetry the line has. arcs the other type of curved line that can be created using svg is the arc, called with the a command. arcs are sections of circles or ellipses. for a given x-radius and y-radius, there are two ellipses that can connect any two points (as long as they're within the radius of the circle). along either of those circles, there are two possible paths that can be taken to connect the points—so in any situation, there are four possible arcs available. because of that, arcs require quite a few parameters: a rx ry x-axis-rotation large-arc-flag sweep-flag x y a rx ry x-axis-rotation large-arc-flag sweep-flag dx dy...
...lso much more powerful. complete circles and ellipses are the only shapes that svg arcs have trouble drawing. because the start and end points for any path going around a circle are the same point, there are an infinite number of circles that could be chosen, and the actual path is undefined. it's possible to approximate them by making the start and end points of the path slightly askew, and then connecting them with another path segment. for example, it's possible to make a circle with an arc for each semi-circle. at that point, it's often easier to use a real <circle> or <ellipse> node instead. this interactive demo might help understand the concepts behind svg arcs: http://codepen.io/lingtalfi/pen/yalwjg (tested in chrome and firefox only, might not work in your browser) « previousnext ...
remote/parent - Archive of obsolete content
ocesses created in the future. this is a shortcut for enumerating existing processes and then listening for attach events. properties port an event emitter that sends messages to and receives messages from all processes. events attach event emitted when a new process is started. the event handler is called with a process representing the new process. detach event emitted when a process disconnects from the application. it may have been closed normally or it may have crashed. the event handler is called with the process that detached. frames a list of the content frames across all processes. each element in this list is a frame. listen to attach and detach events to hear as frames are created and destroyed. const { frames } = require("sdk/remote/parent"); frames.on("attach", function(f...
...at detached. process a process provides a way to communicate with code running in one of the application's processes. properties port an event emitter that can be used to send and receive events to and from code running in the process. isremote a boolean property that indicates whether the attached process is remote from the main process. events detach event emitted when this process disconnects from the application. it may have been closed normally or it may have crashed. frame a frame provides a way to pass frame specific messages to code in other processes. the frame this relates to may be in any of the application's processes. properties port an event emitter that can be used to send and receive frame specific events to and from code running in any process. frameelement the d...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
information, and view resources listed as references on that page. html and web standards have evolved and now offer flexible and fine-grained control to layout as well supporting dhtml, powerful programming languages like javascript, and additional media through embeddable third-party resources like flash, java, vrml, etc. additionally, server-side technologies have also evolved, supporting and connecting different resources to different browsers. despite all the evolution, we still see the underpinnings of the original model in modern web sites. we still connect through a set of links that mostly drive us to a new page, and we still occasionally lose track of where we are. also, on the server side, the server often has to rebuild all of the context of the user interface with each new request. ...
...on the flexibility to easily access and manage all message headers in mail applications (like netscape mail or eudora) is probably one of the useful features when compared with web-based mail applications. in general, when a webmail account has more than a few messages, clicking 'next page' sends a request to the server. you receive a new page with the next block of message headers. on slow speed connections, this process can be slow and frustrating. with inner browsing, a simple request to retrieve the next set of message headers that replace the currently viewed message headers can dramatically improve user experience. implementing inner-browsing on top of html pages modern browsers have good support for the w3c dom and javascript allowing fine-grained control over page content. instead of forc...
List of Mozilla-Based Applications - Archive of obsolete content
aol instant messenger im client uses nss apache web server doesn't use nss by default, but can be configured to use nss with mod_nss ssl module apicawatch site performance monitoring tool uses firefox as part of its monitoring package astyle css editor editing tool atmail webmail client aviva for java mainframe connectivity product uses mozilla rhino babelgum internet tv service basilisk pre-servo xul-based web browser uses most of the firefox 55 source code batik java-based toolkit uses mozilla rhino bitbox security focused browser seemingly based on firefox blackbird browser for african american community bluegriffon w...
... management tool automatic uploader is a xulrunner application that runs headless in xvfb wikipediaondvd and wikimedia by moulin offline versions of wikipedia blog post about projects wine implementation of the windows api uses mozilla spidermonkey and the gecko activex control worksmart.net suite of web-based workplace apps uses prism wxwebconnect web browser control library wyzo browser xb browser anonymous web browser xbusiness create and send branded invoices, quotes or estimates xdf billing and quotes software xiphos bible study software xmldbeditor database editor xpud linux desktop xpud: linux with an xul interface, 1...
HTTP Class Overview - Archive of obsolete content
guide to developers wishing to understand or extend the mozilla http implementation. ...
... cache holds references to frequently used services nshttpchannel implements nsihttpchannel talks to the cache initiates http transactions processes http response codes intercepts progress notifications nshttpconnection implements nsistreamlistener & nsistreamprovider talks to the socket transport service feeds data to its transaction object routes progress notifications nshttpconnectioninfo identifies a connection nshttptransaction implements nsirequest encapsulates a http request and response parses incoming data nshttpchunkeddecoder owned by a transaction strips chunked transfer encoding nshttprequesthead owns a nshttpheaderarray knows how to fill a request buffer nshttpresponsehead owns a nshttpheaderarray knows how to parse response lines perf...
Running Tamarin acceptance tests - Archive of obsolete content
our android device and can run both direct and shell-type commands. if you've correctly edited and run the android-vars.sh script mentioned on the tamarin build documentation page you should already be pathed to the adb executable in the public sdk/ndk, but if not it exists at /android-public/android-sdk-mac_86/platform-tools. adb supports ssh-like commands to an android device. adb automatically connects to a phone if connected by usb. adb shell "ls /" is a good test to see if connected. the command: $ adb devices lists the device id of each phone. if you have more than 1 phone connected to usb, use "adb -s " for each phone. if this fails, do you have a dev os installed? under settings->applications->development, is usb debugging enabled? testsuite setup example commands: copy avmshell to /d...
...lel and reduces running times dramatically. you must, in any case, at least use --androidthreads or --threads=1 (or will fail due to multiple tests running). $ cd tamarin-redux/test/acceptance $ ./runtests.py --androidthreads note on using an emulator: the emulator does seem to support hardware floating point but gives a buserror when running avmshell -darm_vfp. it's unreliable, losing its adb connection frequently. an emulator is ok for testing a few abc files but for any consistency a real device is better. ...
Running Tamarin performance tests - Archive of obsolete content
our android device and can run both direct and shell-type commands. if you've correctly edited and run the android-vars.sh script mentioned on the tamarin build documentation page you should already be pathed to the adb executable in the public sdk/ndk, but if not it exists at /android-public/android-sdk-mac_86/platform-tools. adb supports ssh-like commands to an android device. adb automatically connects to a phone if connected by usb. adb shell "ls /" is a good test to see if connected. the command: $ adb devices lists the device id of each phone. if this fails, do you have a dev os installed? under settings->applications->development, is usb debugging enabled? testsuite setup example commands: root the phone $ adb root copy avmshell to /data/app. the shell can be named variously in the build b...
...threads or --threads=1 as with the acceptance tests; in fact, a usage error will result. just type the following commands after making sure you've set the environment variables correctly. $ cd /test/performance $ ./runtests.py note on using an emulator: the emulator does seem to support hardware floating point but gives a buserror when running avmshell -darm_vfp. it's unreliable, losing its adb connection frequently. an emulator is ok for testing a few abc files but for any consistency a real device is better. ...
Tamarin build documentation - Archive of obsolete content
run the application: $ avmshell hello.abc hello, world use the -help options of asc.jar and avmshell for more details. ...
...tamarin performance tests building tamarin windows mobile utilities the tamarin windows mobile utilities allows the existing acceptance and performance testsuites to be run on a windows mobile device connected to a windows desktop machine by activesync or windows mobile device center (for windows vista and windows 7). setup and run activesync or windows mobile device center. ...
The life of an HTML HTTP request - Archive of obsolete content
the webshell as nsicontentviewercontainer to the docloader.] (2) the document loader calls ns_openuri with the url to begin transfering the requested file. necko (the network library) checks the url scheme (the first part of the url, http: in this case) and locates the correct nsiprotocolhandler (in this case nshttphandler) and asks it for a nsichannel (nshttpchannel). the channel represents the connection to the server, and is the source of the html data stream. (3) when data is starting to come from the webserver the nsichannel calls the onstartrequest in the documenloader. now the channel knows the content type of the incoming data, so the documentloader can find an nsidocumentloaderfactory for the "text/html" content type (in this case an nslayoutdlf). this factory is then told to create a ...
...ases (including this) it also creates a nsidocument (nshtmldocument) and binds it to the contentviewer. the contentviewer is then embed():ed into the contentviewercontainer (the webshell). (4) the document then creates a nsiparser for parsing the input stream. for html document this is an nsparser, which also implements nsistreamlistener. this streamlistener is returned to the documentloader and connected to the nsichannel of the request. (5) the document (nshtmldocument) also creates a nsicontentsink (nshtmlcontentsink) and connects it to the parser and the document. the parser then parses the stream it gets via its streamlistener interface and converts it to nsiparsernodes which it places in the contentsink. the parser typically gets data from the stream in 8kb blocks and parses these blocks...
A XUL Bestiary - Archive of obsolete content
on object model in the hierarchy of xul widgets: browser, menu, menuitem, and so on. the dom and the aom form a kind of continuum, the whole of which is manipulable from the standards upon which xul is based. near synonyms for xul there is much confusion about the words that begin with "x" in the mozilla open source project. the mozilla xparchitecture section below describes xpcom, xpidl, and xpconnect, three somewhat related technologies for getting access to application code from the interface. this section describes xul, xptoolkit, and xpfe, which are in some respects synonymous and in others quite different. in briefest terms, xul is the xml-based language used for creating interfaces, xptoolkit is the set of xul widgets (menus, toolbar, etc.) actually assembed for this purpose -- the buil...
...s rules for design and compilation that make it possible to use the services of an object without knowing anything about implementation. xpidl, the cross-platform interface definition language, is a language in which these interfaces insisted upon by xpcom can be described. when xpidl is used to describe the xpcom interfaces, it makes those interfaces available in special header files. finally, xpconnect is the technology that connects these xpcom/xpidl interfaces to javascript, the scripting language xul uses. these three cross-platform glue technologies fit in the middle of an architecture that looks something like this: author: ian oeschger other documents: mozilla jargon file and introduction to xul original document information author(s): ian oeschger last updated date: april 16, 2...
statustext - Archive of obsolete content
used to set the text that appears on the status bar when the user moves the mouse over the element. mozilla doesn't adjust the status bar automatically however. this attribute serves only as a place to keep the text. in firefox, this text is automatically placed in the statusbar for menuitems on the menu bar. ...
...t that appears on the status bar when the user moves the mouse over the element. mozilla doesn't adjust the status bar automatically however. this attribute serves only as a place to keep the text. in firefox, this text is automatically placed in the statusbar for menuitems on the menu bar. ...
XPCOM Interfaces - Archive of obsolete content
object model), which is the object system that mozilla uses. calling native objects by using xul we can build a complex user interface. we can attach scripts which modify the interface and perform tasks. however, there are quite a number of things that cannot be performed directly with javascript. for example, if we wanted to create a mail application, we would need to write scripts which would connect to mail servers to retrieve and send mail. javascript does not have the capability to do such things. the only way to handle this would be to write native code that would get mail. we also need to have a way for our scripts to call the native code easily. mozilla provides such a method which involves using xpcom (cross-platform component object model). mozilla provides many xpcom components and...
...ings that javascript cannot do itself. however, there is a way in which you can call them, which we will see shortly. we can call any of the functions provided by the component as described by the interfaces it implements. for example, once we have a component, we can check if it implements nsisound, and, if so, we can play sound through it. the process of calling xpcom from a script is called xpconnect, which is a layer which translates script objects into native objects. creating xpcom objects there are three steps to calling an xpcom component. get a component get the part of the component that implements the interface that we want to use. call the function we need once you've done the first two steps, you can repeat the last step as often as necessary. let's say we want to rename a ...
preference - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] declares a preference that may be adjusted in a prefpane. this element must be placed inside a preferences element. each preference element corresponds to a preference which is stored in the user's preferences file. you can connect a user interface element such as a checkbox to a preference element using the user interface element's preference attribute. more information is available in the preferences system article. attributes disabled, instantapply, inverted, name, onchange, readonly, tabindex, type properties defaultvalue, disabled, hasuservalue, inverted, locked, name, preferences, readonly, tabindex, type, value, valuefrompreferences methods reset examples <preferences> <prefer...
... tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. type type: one of the values below the preference type which should be one of the following values. bool a boolean set to either true or false. usually a checkbox would be connected to these preferences. int an integer string a string unichar a unicode string wstring a localized string. in this situation the preference will save the path to a property file which contains the actual value of the preference. file a file. the file path will be stored in the preferences. properties defaultvalue (readonly) returns the default value of the prefer...
Introduction to Public-Key Cryptography - Archive of obsolete content
steps shown in figure 4: in response to an authentication request from the server, the client displays a dialog box requesting the user's name and password for that server. the user must supply a name and password separately for each new server the user wishes to use during a work session. the client sends the name and password across the network, either in the clear or over an encrypted ssl connection. the server looks up the name and password in its local password database and, if they match, accepts them as evidence authenticating the user's identity. the server determines whether the identified user is permitted to access the requested resource, and if so allows the client to access it. with this arrangement, the user must supply a new password for each server, and the administrator ...
...ificate chain, starting with the certificate being presented for authentication: the certificate validity period is checked against the current time provided by the verifier's system clock. the issuer's certificate is located. the source can be either the verifier's local certificate database (on that client or server) or the certificate chain provided by the subject (for example, over an ssl connection). the certificate signature is verified using the public key in the issuer's certificate. if the issuer's certificate is trusted by the verifier in the verifier's certificate database, verification stops successfully here. otherwise, the issuer's certificate is checked to make sure it contains the appropriate subordinate ca indication in the red hat certificate type extension, and chain veri...
RDF in Mozilla FAQ - Archive of obsolete content
tasource is a locally-installed component that implements nsirdfdatasource. for example, the bookmarks service. first, check here to make sure you will be allowed to access a built-in datasource. there are several security restrictions on accessing built-in datasources from "untrusted" xul and js. since a built-in datasource is just an xpcom component, you can instantiate it directly using the xpconnect component manager. // use the component manager to get the bookmarks service var bookmarks = components. classes["@mozilla.org/rdf/datasource;1?name=bookmarks"]. getservice(components.interfaces.nsirdfdatasource); // now do something interesting with it... if (bookmarks.hasassertion( rdf.getresource("http://home.netscape.com/nc-rdf#bookmarksroot"), rdf.getresource("http://home.n...
...ngside duplicates.xul. note that for these to work, you have to relax mozilla's security model. to do this, add the following line to your preferences file. (shut down mozilla first since it overwrites your preferences file when you quit.) user_pref("signed.applets.codebase_principal_support", true); mozilla will ask you if you want to grant the scripts in duplicates.xul permission to access xpconnect; respond in the affirmative. currently, mozilla does not allow unprivileged access to the rdf interfaces and services; see bug 122846 for details. please mail danbri, mozilla-rdf or waterson with urls if you are aware of other examples to which we ought to link! notes see also w3c rdf and semantic web pages for more information on rdf and related technologies. contributors examples sec...
Archive of obsolete content
e distributed and modified freely. no guarantee of factuality in this faq is made, and it is maintained by pat gunn, who is not affiliated with netscape. various other people have contributed to this faq. newsgroup summaries obsolete: xpcom-based scripting for npapi plugins plugins that used to take advantage of being scriptable via liveconnect in 4.x netscape browsers lost this possibility in the new world. the main reason for this is that there is no guarantee of java compatibility on a binary level due to the jri/jni switch. the new mozilla xpcom architecture allows xpcom components be scriptable via a different mechanism called xpconnect. we leverage some of these ideas to help you make your netscape communicator 4...
...blog/hacking-digg-w...ug-and-jquery/ using io timeout and interrupt on nt this technical memo is a cautionary note on using netscape portable runtime's (nspr) io timeout and interrupt on windows nt 3.51 and 4.0. due to a limitation of the present implementation of nspr io on nt, programs must follow the following guideline: using ssh to connect to cvs using web standards in your web pages using workers in extensions this article shows you how to use worker threads in extensions to perform tasks in the background without blocking the user interface. web standards the web standards project windows media in netscape netscape 7.1 has the a...
Introduction to game development for the Web - Game development
fects and music. if your needs are more involved, check out the web audio api for real audio processing power! indexeddb a powerful data storage api for maintaining user data on their own computer or device. a great way to save game state and other information locally so it doesn't have to be downloaded every time it's needed. also useful to help make your game playable even when the user isn't connected to the web (such as when they're stuck on an airplane for hours on end). javascript javascript, the programming language used on the web, is blazing fast in modern browsers and getting faster all the time. use its power to write the code for your game, or look at using technologies like emscripten or asm.js to easily port your existing games. pointer lock api the pointer lock api lets you l...
...is a web-supported implementation of opengl es 2.0. webrtc the webrtc (real-time communications) api gives you the power to control audio and video data, including teleconferencing and transmitting other application data back and forth between two users. want your players to be able to talk to each other while blowing up monsters? this is the api for you. websockets the websocket api lets you connect your app or site to a server to transmit data back and forth in real-time. perfect for multiplayer gaming action, chat services, and so forth. web workers workers give you the ability to spawn background threads running their own javascript code, to take advantage of modern, multi-core processors. xmlhttprequest and file api the combination of xmlhttprequest and the file api lets you send and...
Explaining basic 3D theory - Game development
tex can use to decorate the surface it is part of instead of a simple color. you can build geometry using this information — here is an example of a cube: a face of the given shape is a plane between vertices. for example, a cube has 8 different vertices (points in space) and 6 different faces, each constructed out of 4 vertices. a normal defines which way the face is directed in. also, by connecting the points we're creating the edges of the cube. the geometry is built from a vertex and the face, while material is a texture, which uses a color or an image. if we connect the geometry with the material we will get a mesh. rendering pipeline the rendering pipeline is the process by which images are prepared and output onto the screen. the graphics rendering pipeline takes the 3d objects bu...
...ngs. it sets up what can be seen by the camera — the configuration includes field of view, aspect ratio and optional near and far planes. read the camera paragraph in the three.js article to learn about those. the last step is viewport transformation, which involves outputting everything for the next step in the rendering pipeline. rasterization rasterization converts primitives (which are connected vertices) to a set of fragments. those fragments — which are 3d projections of the 2d pixels — are aligned to the pixel grid, so eventually they can be printed out as pixels on a 2d screen display during the output merging stage. fragment processing fragment processing focuses on textures and lighting — it calculates final colors based on the given parameters. textures textures a...
WebRTC data channels - Game development
the webrtc (web real-time communications) api is primarily known for its support for audio and video communications; however, it also offers peer-to-peer data channels. this article explains more about this, and shows you how to use libraries to implement data channels in your game. what is a data channel? a webrtc data channel lets you send text or binary data over an active connection to a peer. in the context of a game, this lets players send data to each other, whether text chat or game status information. data channels come in two flavors. reliable channels guarantee that messages you send arrive at the other peer and in the same order in which they're sent. this is analogous to a tcp socket. unreliable channels make no such guarantees; messages aren't guaranteed to arrive in a...
...using webrtc. this article, however, will take advantage of some libraries that can help trivialize the work, and will demonstrate ways to use abstraction to work around implementation differences between browsers. hopefully, of course, those differences will fade away in time. using the p2p library one library you can use is the p2p library. this library provides a simple api for creating peer connections and setting up streams and data channels. there's also a broker server component and a hosted broker you can use instead of having to set one up for yourself. note: we will continue to add content here soon; there are some organizational issues to sort out. original document information author(s): alan kligman source article: webrtc data channels for great multiplayer other contribu...
Plug-in Development Overview - Gecko Plugin API Reference
see the wikipedia article for historical information. both technologies are now obsolete for the purposes of plug-in scriptability, and the cross-browser npruntime api should be used instead. see the scripting plugins section of this reference for the details. building plug-ins once you have added the special code and additional files ...
...see the wikipedia article for historical information. both technologies are now obsolete for the purposes of plug-in scriptability, and the cross-browser npruntime api should be used instead. see the scripting plugins section of this reference for the details. building plug-ins once you have added the special code and additional files to make your plug-in...
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
et security. ...
...ergency readiness team (us-cert) defines symptoms of denial-of-service attacks to include: unusually slow network performance (opening files or accessing websites) unavailability of a particular website inability to access any website dramatic increase in the number of spam emails received—(this type of dos attack is considered an email bomb) disconnection of a wireless or wired internet connection longterm denial of access to the web or any internet services learn more general knowledge denial-of-service attack on wikipedia ...
Domain sharding - MDN Web Docs Glossary: Definitions of Web-related terms
browsers limit the number of active connections for each domain. to enable concurrent downloads of assets exceeding that limit, domain sharding splits content across multiple subdomains. when multiple domains are used to serve multiple assets, browsers are able to download more resources simultaneously, resulting in a faster page load time and improved user experience. the problem with domain sharding, in terms of performance, is the cost of extra dns lookups for each domain and the overhead of establishing each tcp connection. the initial response from an http request is generally an html file listing other resources such as javascript, css, images and other media files that need to be downloaded. ...
...roved user experience. the problem with domain sharding, in terms of performance, is the cost of extra dns lookups for each domain and the overhead of establishing each tcp connection. the initial response from an http request is generally an html file listing other resources such as javascript, css, images and other media files that need to be downloaded. as browsers limit the number of active connections per domain, serving all the required resources from a single domain could be slow as assets need to be downloaded sequentially. with domain sharding, the required downloads are served from more than one domain, enabling the browser to simultaneously download needed resources. multiple domains, however, is an anti-pattern, as dns lookups slow initial load times. http2 supports unlimited concu...
MitM - MDN Web Docs Glossary: Definitions of Web-related terms
back, and the mailman would again open the letter, read it, eventually modify it, repackage it, and give it to you. you wouldn't know there's a man in the middle in your communication channel – the mailman is invisible to you and to your recipient. in physical mail and in online communication, mitm attacks are tough to defend. a few tips: don't just ignore certificate warnings. you could be connecting to a phishing server or an imposter server. sensitive sites without https encryption on public wi-fi networks aren't trustworthy. check for https in your address bar and ensure encryption is in-place before logging in. learn more owasp article: man-in-the-middle attack wikipedia: man-in-the-middle attack the public-key-pins header (hpkp) can significantly decrease the risk of mitm by...
... encryption on public wi-fi networks aren't trustworthy. check for https in your address bar and ensure encryption is in-place before logging in. learn more owasp article: man-in-the-middle attack wikipedia: man-in-the-middle attack the public-key-pins header (hpkp) can significantly decrease the risk of mitm by instructing browsers to require a whitelisted certificate for all subsequent connections to that website. ...
QUIC - MDN Web Docs Glossary: Definitions of Web-related terms
quick udp internet connection, or quic, is an experimental multiplexed transport protocol implemented on udp. it was developed by google as a way to experiment with ways to improve tcp and web application delivery. as tcp is built into the kernel of many operating systems being able to experiment with changes, test them and implement modifications is an extremely slow process. the creation of quic allows developers to conduct experiments and try new things faster. quic was designed to support the semantics of http/2. it provides multiplexing, flow control, security and congestion control. key features of quic include: reduction in connection establishment time. improved congestion control. multiplexing without head-of-line blocking. ...
.... the creation of quic allows developers to conduct experiments and try new things faster. quic was designed to support the semantics of http/2. it provides multiplexing, flow control, security and congestion control. key features of quic include: reduction in connection establishment time. improved congestion control. multiplexing without head-of-line blocking. forward error correction. connection migration. there is limited browser and server support for quic today. resources chromium projects documentation ietf draft see also http/2 ...
Server - MDN Web Docs Glossary: Definitions of Web-related terms
a hardware server is a shared computer on a network, usually powerful and housed in a data center. a software server (often running on a hardware server) is a program that provides services to client programs or a user interface to human clients. services are provided generally over local area networks or wide area networks such as the internet. ...
...er. a software server (often running on a hardware server) is a program that provides services to client programs or a user interface to human clients. services are provided generally over local area networks or wide area networks such as the internet. a client program and server program traditionally connect by passing messages encoded using a protocol over an api. ...
Session Hijacking - MDN Web Docs Glossary: Definitions of Web-related terms
ause no account lockout for invalid session ids weak session-id generation algorithm insecure handling indefinite session expiration time short session ids transmission in plain text session hijacking process sniff, that is perform a man-in-the-middle (mitm) attack, place yourself between victim and server. monitor packets flowing between server and user. ...
...in-the-middle (mitm) attack, place yourself between victim and server. monitor packets flowing between server and user. break the victim machine's connection. take control of the session. inject new packets to the server using the victim's session id. ...
TCP handshake - MDN Web Docs Glossary: Definitions of Web-related terms
tcp (transmission control protocol) is a transport layer host-to-host protocol for connection-oriented communication between two computers on an ip network. tcp uses a three-way handshake (aka tcp-handshake, three message handshake, and/or syn-syn-ack) to set up a tcp/ip connection over an ip based network. the three messages transmitted by tcp to negotiate and start a tcp session are nicknamed syn, syn-ack, and ack for synchronize, synchronize-acknowledgement, and acknowledge respectively. the three message mechanism is designed so that two computers that want to pass information back and forth to each other can negotiate the parameters of the connection before transmitting data such as http browser requests. the host, generally the browser, sends a tcp synchronize packet to the server.
...ation back and forth to each other can negotiate the parameters of the connection before transmitting data such as http browser requests. the host, generally the browser, sends a tcp synchronize packet to the server. the server receives the syn and sends back a synchronize-acknowledgement. the host receives the server's syn-ack and sends an acknowledge. the server receives ack and the tcp socket connection is established. this handshake step happens after a dns lookup and before the tls handshake, when creating a secure connection. the connection can be terminated independently by each side of the connection via a four-way handshake. ...
TCP slow start - MDN Web Docs Glossary: Definitions of Web-related terms
tcp slow start helps buildup transmission speeds to the network's capabilities. it does this without initially knowing what those capabilities are and without creating congestion. tcp slow start is an algorithm used to detect the available bandwidth for packet transmission, and balances the speed of a network connection. it prevents the appearance of network congestion whose capabilities are initially unknown, and slowly increases the volume of information diffused until the network's maximum capacity is found. to implement tcp slow start, the congestion window (cwnd) sets an upper limit on the amount of data a source can transmit over the network before receiving an acknowledgment (ack). the slow start threshold (ssthresh) determines the (de)activation of slow start. when a new conne...
...window is incremented until the cwnd is less than ssthresh. slow start also terminates when congestion is experienced. congestion control congestion itself is a state that happens within a network layer when the message traffic is too busy it slows the network response time. the server sends data in tcp packets, the user's client then confirms delivery by returning acknoledgements, or acks. the connection has a limited capacity depending on hardware and network conditions. if the server sends too many packets too quickly, they will be dropped. meaning, there will be no acknowledgement. the server registers this as missing acks. congestion control algorithms use this flow of sent packets and acks to determine a send rate. see also populating the page: how browsers work http overview ...
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
ver protocols that ensure communication privacy by using cryptographic protocols to provide security over a network. when a server and client communicate using tls, it ensures that no third party can eavesdrop or tamper with any message. ...
...tablish a secure connection. it is possible for both the client and server to mutually authenticate each other, if both parties provide their own individual digital certificates. note: tls 1.0 and 1.1 support will be removed from all major browsers in early 2020; you'll need to make sure your web server supports tls 1.2 or 1.3 going forward. from version 74 onwards, firefox will return a secure connection failed error when connecting to servers using the older tls versions (bug 1606734). ...
Transmission Control Protocol (TCP) - MDN Web Docs Glossary: Definitions of Web-related terms
tcp (transmission control protocol) is a transport layer host-to-host protocol for connection-oriented communication between two computers on an ip network. tcp uses virtual ports to create a virtual end-to-end connection that can reuse the physical connections between two computers. tcp encapsulates higher level protocol data such as http and, smtp (email) . tcp handshake the tcp three-way handshake, also called the tcp-handshake, three message handshake, and/or syn-syn-ack, is the method used by tcp to set up a tcp/ip connection over an ip-based network. the three messages transmitted by tcp to negotiate and start a tcp session are nicknamed syn, syn-ack, ack for synchronize, synchronize-acknowledgement, and acknowledge. the three message mechanism is designed for the two computers th...
... is the method used by tcp to set up a tcp/ip connection over an ip-based network. the three messages transmitted by tcp to negotiate and start a tcp session are nicknamed syn, syn-ack, ack for synchronize, synchronize-acknowledgement, and acknowledge. the three message mechanism is designed for the two computers that want to pass information back and forth and can negotiate the parameters of the connection before transmitting data such as http browser requests. ...
World Wide Web - MDN Web Docs Glossary: Definitions of Web-related terms
the web is not the same as the internet: the web is one of many applications built on top of the internet. tim berners-lee proposed the architecture of what became known as the world wide web. he created the first web server, web browser, and webpage on his computer at the cern physics research lab in 1990. in 1991, he announced his creation on the alt.hypertext newsgroup, marking the moment the web was first made public. ...
...components: the http protocol governs data transfer between a server and a client. to access a web component, a client supplies a unique universal identifier, called a url (uniform resource location) or uri (uniform resource identifier) (formally called universal document identifier (udi)). html (hypertext markup language) is the most common format for publishing web documents. linking, or connecting resources through hyperlinks, is a defining concept of the web, aiding its identity as a collection of connected documents. soon after inventing the web, tim berners-lee founded the w3c (world wide web consortium) to standardize and develop the web further. this consortium consists of core web interest groups, such as web browser developers, government entities, researchers, and universities.
What is accessibility? - Learn web development
y, including what it is, and how it affects you as a web developer. so what is accessibility? accessibility is the practice of making your websites usable by as many people as possible. we traditionally think of this as being about people with disabilities, but the practice of making sites accessible also benefits other groups such as those using mobile devices, or those with slow network connections. you might also think of accessibility as treating everyone the same, and giving them equal opportunities, no matter what their ability or circumstances. just as it is wrong to exclude someone from a physical building because they are in a wheelchair (modern public buildings generally have wheelchair ramps or elevators), it is also not right to exclude someone from a website because they hav...
...t like any other bug, an accessibility problem becomes more expensive to fix the later it is discovered. bear in mind that a lot of accessibility best practices benefit everyone, not just users with disabilities. for example, lean semantic markup is not only good for screen readers, but it is also fast to load and performant. this benefits everyone, especially those on mobile devices and/or slow connections. publish an accessibility statement on your site and engage with people having problems. accessibility guidelines and the law there are numerous checklists and sets of guidelines available for basing accessibility tests on, which might seem overwhelming at first glance. our advice is to familiarize yourself with the basic areas in which you need to take care, as well as understanding the ...
What is a Domain Name? - Learn web development
prerequisites: first you need to know how the internet works and understand what urls are. objective: learn what domain names are, how they work, and why they are important. summary domain names are a key part of the internet infrastructure. they provide a human-readable address for any web server available on the internet. any internet-connected computer can be reached through a public ip address, either an ipv4 address (e.g. 173.194.121.32) or an ipv6 address (e.g., 2027:0da8:8b73:0000:0000:8a2e:0370:1337). computers can handle such addresses easily, but people have a hard time finding out who's running the server or what service the website offers. ip addresses are hard to remember and might change over time. to solve all those problems we use human...
...ly fill up with unused domain names that were locked and couldn't be used by anyone. instead, you pay for the right to use a domain name for one or more years. you can renew your right, and your renewal has priority over other people's applications. but you never own the domain name. companies called registrars use domain name registries to keep track of technical and administrative information connecting you to your domain name. note : for some domain name, it might not be a registrar which is in charge of keeping track. for instance, every domain name under .fire is managed by amazon. finding an available domain name to find out whether a given domain name is available, go to a domain name registrar's website. most of them provide a “whois” service that tells you whether a domain ...
What is a web server? - Learn web development
you will learn what a web server is and gain a general understanding of how it works. summary the term web server can refer to hardware or software, or both of them working together. on the hardware side, a web server is a computer that stores web server software and a website's component files. (for example, html documents, images, css stylesheets, and javascript files) a web server connects to the internet and supports physical data interchange with other devices connected to the web. on the software side, a web server includes several parts that control how web users access hosted files. at a minimum, this is an http server. an http server is software that understands urls (web addresses) and http (the protocol your browser uses to view webpages). an http server can be accessed t...
...uments and their related assets, including images, css stylesheets, javascript files, fonts, and video. technically, you could host all those files on your own computer, but it's far more convenient to store files all on a dedicated web server because: a dedicated web server is typically more available. (up and running) excusing downtime and systems troubles, a dedicated web server is always connected to the internet. a dedicated web server can have the same ip address all the time. this is known as a dedicated ip address. (not all isps provide a fixed ip address for home lines) a dedicated web server is typically maintained by a third-party. for all these reasons, finding a good hosting provider is a key part of building your website. examine the various services companies offer. choose...
Tips for authoring fast-loading HTML pages - Learn web development
these tips are based on common knowledge and experimentation. an optimized web page not only provides for a more responsive site for your visitors but also reduces the load on your web servers and internet connection. this can be crucial for high volume sites or sites which have a spike in traffic due to unusual circumstances such as breaking news stories. optimizing page load performance is not just for content which will be viewed by narrowband dial-up or mobile device visitors. it is just as important for broadband content and can lead to dramatic improvements even for your visitors with the fastest connections. tips reduce page weight page weight is by far the most important factor in page-load performance. reducing page weight through the elimination of unnecessary whitespace a...
...ges in the page structure. tools such as html tidy can automatically strip leading whitespace and extra blank lines from valid html source. other tools can "compress" javascript by reformatting the source or by obfuscating the source and replacing long identifiers with shorter versions. minimize the number of files reducing the number of files referenced in a web page lowers the number of http connections required to download a page, thereby reducing the time for these requests to be sent, and for their responses to be received. depending on a browser's cache settings, it may send a request with the if-modified-since header for each referenced file, asking whether the file has been modified since the last time it was downloaded. too much time spent querying the last modified time of the refer...
Graceful asynchronous programming with Promises - Learn web development
which is resolved with the mediastream once it's available. the code that the video chat application would use might look something like this: function handlecallbutton(evt) { setstatusmessage("calling..."); navigator.mediadevices.getusermedia({video: true, audio: true}) .then(chatstream => { selfviewelem.srcobject = chatstream; chatstream.gettracks().foreach(track => mypeerconnection.addtrack(track, chatstream)); setstatusmessage("connected"); }).catch(err => { setstatusmessage("failed to connect"); }); } this function starts by using a function called setstatusmessage() to update a status display with the message "calling...", indicating that a call is being attempted. it then calls getusermedia(), asking for a stream that has both video and audio tr...
...d setstatusmessage() to update a status display with the message "calling...", indicating that a call is being attempted. it then calls getusermedia(), asking for a stream that has both video and audio tracks, then once that's been obtained, sets up a video element to show the stream coming from the camera as a "self view," then takes each of the stream's tracks and adds them to the webrtc rtcpeerconnection representing a connection to another user. after that, the status display is updated to say "connected". if getusermedia() fails, the catch block runs. this uses setstatusmessage() to update the status box to indicate that an error occurred. the important thing here is that the getusermedia() call returns almost immediately, even if the camera stream hasn't been obtained yet. even if the han...
What is web performance? - Learn web development
ontent to load. how content is rendered to effectively understand web performance, the issues behind it, and the major topic areas we mentioned above, you really should understand some specifics about how browsers work. this includes: how the browser works. when you request a url and hit enter / return, the browser finds out where the server is that holds that website's files, establishes a connection to it, and requests the files. see populating the page: how the browser works for a detailed overview. source order. your html index file's source order can significantly affect performance. the download of additional assets linked to from the index file is generally sequential, based on source order, but this can be manipulated and should definitely be optimized, realizing that some resource...
...ng, deleting, or moving of nodes) can affect performance, so it is worth understanding how to dom works, and how such issues can be mitigated. find out more at document object model. latency. we mention this briefly earlier on, but in brief, latency is the time it takes for your website assets to travel from the server to a user's computer. there is overhead involved in establishing tcp and http connections, and some unavoidable latency in pushing the request and response bytes back and forth across the network, but there are certain ways to reduce latency (e.g. reducing the number of http request you make by downloading less files, using a cdn to make your site more universally performant across thw world, and using http/2 to serve file more efficiently from the server). you can read all about ...
A bird's-eye view of the Mozilla framework
n interface defined in xpidl (cross-platform idl), derived from the corba idl. the xpidl interface description is independent of the 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 xulelement as a single rdf graph. var tocds = toctree.database; nsirdfcompositedatasource inherits from nsirdfdatasource. help.js declares an nsirdfservice as a compile time constant at the beginning of the file. const rdf = components.classes["@mozilla.org/rdf/rdf-service;1"].getservice(components.interfaces.nsirdfservice); the components object is made available to javascript via xpconnect; it serves as a bridge connecting javascript and xpcom. getlink() uses the nsirdfservice to obtain an nsirdfresource for the requested link. var resource = rdf.getresource(rdfid); nsirdfcompositedatasource inherits from nsirdfdatasource, which supports a gettarget() method for obtaining the nsirdfnode for a given resource and property. var link = tocds.gettarget(resource, nc_link, true); ...
Debugging on Windows
riable moz_no_remote: set moz_no_remote=1 or, starting with firefox 2 and other gecko 1.8.1-based applications, you can use the -no-remote command-line switch instead (implemented in bug 325509). you can also specify the profile to use with the -p profile_name command-line argument. debugging javascript use venkman, the javascript debugger for mozilla. you can use helper functions from nsxpconnect.cpp to inspect and modify the state of javascript code from the msvs debugger. for example, to print curent javascript stack to stdout, evaluate this in quickwatch window: {,,xul}dumpjsstack() note: visual c++ will show you something in the quick watch window, but not the stack, you have to look in the os console for the output. also this magical command only works when the vc++ stack is in...
...t() in the newest stackframe debugging minidumps see debugging a minidump. debugging tinderbox builds see running windows debug builds problems loading debug symbols if both your application and visual c++ hang shortly after launching the application under the debugger, you may be hitting a known deadlock in the way visual studio downloads debug symbols for the system libraries; see https://connect.microsoft.com/visualstudio/feedback/details/422970/hang-loading-rasapi32-pdb-when-using-symbol-server. there are two ways to work around this problem: turn off automatic symbol downloading for system libraries: in tools > options > debugging > symbols, uncheck the microsoft symbol server. pre-load all the windows debug symbols. these instructions apply to visual studio 10 on windows 7; other...
Old Thunderbird build
e basic steps needed to build a thunderbird up to version 59. for thunderbird 60 and later, see the new build instructions. for additional information, see the build documentation. hardware requirements at least 4 gb of ram. 8 gb or more is recommended. while you can build thunderbird on older hardware it can take quite a bit of time to compile on slower machines with less ram. good internet connection for the initial source download. build prerequisites depending on your operating system you will need to carry out a different process to prepare your machine. so firstly complete the instructions for your os and then continue following these build instructions. to build on windows, please read the prerequisites so you don't skip preparing the mapi headers needed to compile thunderbird. ...
...curial code repository: hg clone https://hg.mozilla.org/comm-central then, get all the repositories it depends on. the comm-central repository includes a script to do just that. this may take a while, it's a lot of code! first, cd into the comm-central subdirectory (created automatically by the previous command): cd comm-central then run: python client.py checkout on some types of network connections, "hg clone" might fail because it gets interrupted. it is faster and more efficient to use mercurial bundles instead the first time you fetch the complete repo. in this case, you need a bundle for comm-central, and a bundle for mozilla-central. unbundle mozilla-central into a "mozilla" subdirectory of your comm-central repo after unbundling comm-central. (make sure the unbundled folder's name...
Simple Instantbird build
see the build documentation. this should be kept in sync with simple thunderbird build, you might want to take a look at that page too. build prerequisites hardware requirements: while you can build instantbird on older hardware it can take quite a bit of time to compile on slower machines, and having 8gb of ram is recommended (though you can probably still get away with 4gb). good internet connection for the initial source download. setup: depending on your operating system you will need to carry out a different process to prepare your machine. so firstly complete the instructions for your os and then continue following these build instructions. windows build prerequisites gnu/linux build prerequisites mac os x build prerequisites tip: after completing setup for your os, and befo...
...sitory: hg clone http://hg.mozilla.org/comm-central then, get all the repositories it depends on. the comm-central repository includes a script to do just that. this may take a while, it's a lot of code! first, cd into the comm-central subdirectory (created automatically by the previous command): cd comm-central then run: python client.py checkout note: unless you have a very good network connection, "hg clone" might fail because it gets interrupted. it is faster and more efficient to use mercurial bundles instead the first time you fetch the complete repo. in this case, you need a bundle for comm-central, and a bundle for mozilla-central. unbundle mozilla-central into a "mozilla" subdirectory of your comm-central repo after unbundling comm-central. then run python client.py checkout to e...
mozbrowsererror
cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. detail the detail property returns an anonymous javascript object with the following properties: type a domstring representing the type of error that occurred. ...
...tring representing the type of error that occurred. ...
JavaScript Tips
xul tips when inserting code with an xul overlay, wrap functions and variables inside an object with a unique name to avoid conflicting with existing or future function and variable names. var uniquename = { _privatemember: 3, publicmember: "a string", init: function() { this.dosomething(this.anothermember); }, dosomething: function(aparam) { alert(aparam); } }; xpconnect don't use object methods and properties more than you have to. it is often faster to store the result in a temporary variable. don't call methods that you don't have to. for instance, windowmanager.getenumerator(atype).hasmoreelements() may be replaced with windowmanager.getmostrecentwindow(atype) != null for a single window. don't query interfaces unless you need to access methods and prope...
...rfaces in both cases). don't call queryinterface unless you expect to succeed. instead, use instanceof, e,g,: if (target instanceof components.interfaces.nsirdfresource) return target.value; if (target instanceof components.interfaces.nsirdfliteral) return target.value; return null; don't test the return value of queryinterface, it always returns the original variable if it succeeds. xpconnect knows all about tearoffs and modifies the object that you queryinterface or instanceof to cache all its known interfaces. when passing an object to an xpcom method it is helpful if the object you pass is an xpcom object, so that the c++ method access a c++ object. however, this is not always necessary or desirable. for instance the offline observer declared above is a javascript object that is r...
about:memory
this "explicit" value at the root of the tree represents all the memory allocated via explicit calls to allocation functions. the "window-objects" sub-tree represents all javascript window objects, which includes the browser tabs and ui windows. for example, the "top(http://editio...
...sents heap-allocated memory that is not measured by any memory reporter. this is typically 10--20% of "explicit". if it gets higher, it indicates that additional memory reporters should be added. dmd can be used to determine where these memory reporters should be added. there are measurements for other content such as images and workers, and for browser subsystems such as the startup cache and xpconnect. some add-on memory usage is identified, as the following example shows. ├───40,214,384 b (04.17%) -- add-ons │ ├──21,184,320 b (02.20%) ++ {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/js-non-window/zones/zone(0x100496800)/compartment([system principal], jar:file:///users/njn/library/application%20support/firefox/profiles/puna0zr8.new/extensions/%7bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08...
Nonblocking IO In NSPR
on port. i have seen some strange problems with using a nonblocking socket associated with an i/o completion port. so the first constraint is: the blocking/nonblocking io mode of a new socket is committed the first time a potentially-blocking io function is invoked on the socket. once the io mode of a socket is committed, it cannot be changed. the potentially-blocking io functions include <tt>pr_connect()</tt>, <tt>pr_accept()</tt>, <tt>pr_acceptread()</tt>, <tt>pr_read()</tt>, <tt>pr_write()</tt>, <tt>pr_writev()</tt>, <tt>pr_recv()</tt>, <tt>pr_send()</tt>, <tt>pr_recvfrom()</tt>, <tt>pr_sendto()</tt>, and <tt>pr_transmitfile(),</tt> and do not include <tt>pr_bind()</tt> and <tt>pr_listen()</tt>. in blocking mode, any of these potentially-blocking functions requires the use of the nt i/o compl...
... to <tt>pr_fd_set</tt>, i.e., the functions <tt>pr_fd_nset</tt>, <tt>pr_fd_nclr</tt>, <tt>pr_fd_nisset</tt> do not work. pr_available() when <tt>pr_available()</tt> returns 0, it may mean one of two things: there is no data available for reading on that socket. i.e., <tt>pr_recv()</tt> would block (a blocking socket) or fail with <tt>pr_would_block_error</tt> (a nonblocking socket). the tcp connection on that socket has been closed (end of stream). these two cases can be distinguished by <tt>pr_poll()</tt>. if <tt>pr_poll()</tt> reports that the socket is readable (i.e., <tt>pr_poll_read</tt> is set in <tt>out_flags</tt>), and <tt>pr_available()</tt> returns 0, this means that the socket connection is closed. current status implemented across all supported platforms. original document...
Optimizing Applications For NSPR
acintosh' asynchronous i/o capability to perform scheduling during i/o. still, there is no enforceable mechanism to guarantee thread scheduling fairness. calendar time facilities are limited on macintosh. one can only determine the immediate setting of daylight savings time, not what it would be at some arbitrary time in the past or the future. initialization of nspr may fail if the host is not connected to a network of some kind. win-16 http://www.sybase.com/products/languages/watccpl.html the win-16 port is unique in the nspr world in that it uses the watcom development environment. this environment does bring along some of its own special trappings. win16 uses co-operative non-preemptive dispatching for its own processes. this means that when the application using nspr is dispatched, a...
..., and cannot be changed. a file descriptor is not usable after an io operation on it fails with either <tt>pr_io_timeout_error</tt> or <tt>pr_io_interrupt_error</tt>. the only thing you can do is to close the file descriptor. see the faq article for more info. there is no current workaround. you must write your program with this restriction in mind. pr_interrupt is implemented except for <tt>pr_connect()</tt>. irix the irix (classic) implementation has a known race condition in creating new threads. if the spawned thread establishes and exits before the parent thread is resumed, the parent will be left with an invalid pointer to the child. the problem has a solution that will be available soon. digital unix digital unix (aka, osf1) requires the latest patches for the pthreads library. t...
PR_GetPeerName
returns if successful, pr_success. if unsuccessful, pr_failure. ...
... returns if successful, pr_success. if unsuccessful, pr_failure. ...
PR_Listen
listens for connections on a specified socket. syntax #include <prio.h> prstatus pr_listen( prfiledesc *fd, printn backlog); parameters the function has the following parameters: 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 conne...
...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_Recv
the value -1 indicates a failure. ...
... buf a pointer to a buffer to hold the data received. amount the size of buf (in bytes). flags must be zero or pr_msg_peek. 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. ...
NSS 3.28.1 release notes
a program linked with older nss 3.x shared libraries will work with nss 3.28.1 shared librar...
...1a:4e:9b:18:de:dc:ea:08:e7:da:aa:07:81:5f:f0 the version number of the updated root ca list has been set to 2.11 a misleading assertion/alert has been removed, when nss tries to flush data to the peer but the connection was already reset. bugs fixed in nss 3.28.1 bug 1296697 - december 2016 batch of root ca changes bug 1322496 - internal error assert when the other side closes connection before reading eoed compatibility nss 3.28.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.28.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with...
NSS environment variables
[2|r|r]: ssl_renegotiate_requires_xtn (default) only allows renegotiation if the peer's hello bears the tls renegotiation_info extension. this is the safe renegotiation. 3.12.5 modified in 3.12.6 nss_ssl_require_safe_negotiation boolean (1 to enable) it controls whether safe renegotiation indication is required for initial handshake. in other words a connection will be dropped at initial handshake if a server or client do not support safe renegotiation. the default setting for this option is false. 3.12.5 nss_ssl_server_cache_mutex_timeout integer (seconds) timeout time to detect dead or hung process in multi-process ssl server. default is 30 seconds. 3.4 nss_strict_nofork string ("1", "disabled", or a...
... note: ssldebug or ssltrace have to be set to use this functionality. 3.12 sslforcelocks boolean (1 to enable) forces nss to use locks for protection. overrides the effect of ssl_no_locks (see ssl.h). 3.11 sslkeylogfile string (file name) key log file. if set, nss logs rsa pre-master secrets to this file. this allows packet sniffers to 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 introd...
Necko Interfaces Overview
creating uri objects from uri strings maps uri scheme to appropriate nsiprotocolhandler impl nsiuri (nsiurl, nsifileurl, nsistandardurl) represents an uri, with getters and setters for various uri parts (eg. scheme, host, path, ...) per protocol implementation necko provides uri impl's for common uri formats (see nsstandardurl, nssimpleuri) nsichannel : nsirequest represents a logical connection to the resource identified by a nsiuri per protocol implementation single use (ie. channel is used to download the resource once) download initiated via nsichannel::asyncopen method can be canceled via nsirequest::cancel method at anytime after invocation of asyncopen method nsiprotocolhandler a service that manages a protocol, identified by it's uri scheme (eg. http) maps uri string ...
...quest channel impl adds itself to its load group during invocation of asyncopen channel impl removes itself from its load group when download completes load groups in gecko own all channels used to load a particular page (until the channels complete) all channels owned by a load group can be canceled at once via the load group's nsirequest::cancel method nsitransport represents a physical connection, such as a file descriptor or a socket used directly by protocol handler implementations (as well as by mailnews and chatzilla) synchronous i/o methods: openinputstream, openoutputstream asynchronous i/o methods: asyncread, asyncwrite nsitransport::asyncread takes a nsistreamlistener parameter original document information author(s): darin fisher last updated date: december 10, 200...
SpiderMonkey compartments
at all times what objects from a compartment are kept alive by outside references (through cross-compartment wrappers). this allows the garbage collecting of individual compartments, in addition to global collection. spidermonkey simply assumes that all objects referenced from outside the compartment are live, and then walks the object graph inside the compartment. objects that are found to be disconnected from the graph are discarded. with this new per-compartment garbage collection we shortcut having to walk unrelated heap areas of a window or tab that triggered a garbage collection. ​see also js_newcompartmentandglobalobject() js_entercrosscompartmentcall() js_leavecrosscompartmentcall() jsautocompartment invariants spidermonkey internals: thread safety andreas gal blog po...
...bage collection we shortcut having to walk unrelated heap areas of a window or tab that triggered a garbage collection. ​see also js_newcompartmentandglobalobject() js_entercrosscompartmentcall() js_leavecrosscompartmentcall() jsautocompartment invariants spidermonkey internals: thread safety andreas gal blog post bobby holley blog post sfink/contexts_and_compartments xpconnect security membranes ...
GCIntegration - SpiderMonkey Redirect 1
the first slice of the gc. therefore, it's not possible for code to modify them between when the initial snapshot is taken and when the pointer is marked, so no write barrier is needed. many pointers in gecko are traced via ns_decl_cycle_collection_script_holder_class and its related macros. these pointers are always traced in the first slice, and so they don't need a write barrier. many other xpconnect pointers are also traced in this way. see xpcjsruntime::traceblackjs and xpcjsruntime::tracegrayjs. if a pointer doesn't fit one of these categories, then it probably requires a write barrier. before the pointer is modified (except initializing writes, which don't need a barrier), you should call incrementalreferencebarrier() or incrementalvaluebarrier(), passing it the value the pointer held b...
...lackjs and xpcjsruntime::tracegrayjs. if a pointer doesn't fit one of these categories, then it probably requires a write barrier. before the pointer is modified (except initializing writes, which don't need a barrier), you should call incrementalreferencebarrier() or incrementalvaluebarrier(), passing it the value the pointer held before the write. there are several examples of this usage in xpconnect. the js::objectptr class is intended to serve as a drop-in replacement for jsobject *. it has an assignment operator that automatically invokes a write barrier. so far, though, there hasn't been much use for this class—there aren't many places outside of spidermonkey where a write barrier is required. read barriers "weak pointers" are a major complication to the scheme described above. for t...
Redis Tips
n't made from whale meat but that are also very unlike ice cream -- it just gives the whaling industry a way to lump together people who don't use their products. so rather than thinking about redis as a database with some kind of non-existent relationship to sql, think of it as a data structure server with a rich set of commands for querying and manipulating those data structures over a network connection. redis data types include: strings hashes lists sets ordered sets (called zsets in redis) transactions publishers and subscribers this table lists some common programming tasks and data structures, and suggests some redis functions or data structures for them: dictionary lookup set, get, setnx, etc. counters set, incr, incrby list manipulation l...
...ntially as a single atomic operation. here's a stupid node script to show how this works: #!/usr/bin/env node var r = require('redis').createclient(); r.multi() .set("foo", 42) .set("bar", "ice cream") .set("baz", 6.28) .get("foo") .get("bar") .get("baz") .exec(function(err, resultlist) { console.log(json.stringify(resultlist, null, 2)); r.end(); // terminate the redis connection; node can quit }); when run, this prints: [ "ok", "ok", "ok", "42", "ice cream", "6.28" ] the result list includes one value per each command executed. awesome. note that if one of your commands crashes, the others still all execute! (try this by breaking one of the set statements by leaving out the value argument.) you'll get one return value for each operation that did...
Pinning violation reports
the error page displayed by firefox when you encounter a pin violation gives you the option of reporting this error. ...
... the error page displayed by firefox when you encounter a pin violation gives you the option of reporting this error. doing this can help us to make the web safer. ...
Places Developer Guide
pen = false; querying history for redirects and from_visit results of type result_type_full_visit have information about the visit, such as the referring visit, and how the transition happened (typed, redirect, link, etc). the problem is that it is not yet implemented -- see bug 320831. so the only solution for now seems to do one own sql queries to the places database. ...
...redirect, link, etc). the problem is that it is not yet implemented -- see bug 320831. so the only solution for now seems to do one own sql queries to the places database. here is how one can get a connection to the places database: function getplacesdbconn() { return components.classes['@mozilla.org/browser/nav-history-service;1']. ...
Components.Constructor
t is the contract id of the xpcom component to create. the component is then returned immediately, with only the base interface nsisupports available on it; you must call nsisupports.queryinterface() on it to call methods on the object. ...
...the arguments used with the initialization method are the arguments passed to the components.constructor()-c...
Using components
commonly, we start our scripts like so: var cc = components.classes; var ci = components.interfaces; if we want to get a hold of a component, we then do something like: var rc = cc["@mozilla.org/registry;1"]; var rs = rc.getservice(ci.nsiregistry); see also: xpcshell -- how to get a command line interface to javascript more info as was already stated, it is common to start addon scripts like: var cc = components.classes; var ci = components.interfaces; there is also another way to start, which is exactly equivalent to the above. var {cc: classes, ci: interfaces} = components; there are many more than just classes and interfaces. ...
...ect nsxpccomponents_classes] results=[object nsxpccomponents_results] issuccesscode=function issuccesscode() { [native code] } constructor=[object nsxpccomponents_constructor] queryinterface=function queryinterface() { [native code] } interfacesbyid=[object nsxpccomponents_interfacesbyid] classesbyid=[object nsxpccomponents_classesbyid] stack=js frame :: scratchpad/4 :: cdump :: line 8 manager=[xpconnect wrapped nsicomponentmanager] id=[object nsxpccomponents_id] exception=[object nsxpccomponents_exception] reporterror=function reporterror() { [native code] } cancreatewrapper=function cancreatewrapper() { [native code] } cancallmethod=function cancallmethod() { [native code] } cangetproperty=function cangetproperty() { [native code] } cansetproperty=function cansetproperty() { [native code] } ...
HOWTO
async network requests problem you want to make network requests or do other asynchronous work in xpcshell. however, when you start your script, it exits immediately, before the network request returns. solution 1. put the following at the end of your script: // do async processing // from <https://developer.mozilla.org/en/xpconnect/xpcshell/howto> print("doing async work"); gscriptdone = false; var gthreadmanager = cc["@mozilla.org/thread-manager;1"] .getservice(ci.nsithreadmanager); var mainthread = gthreadmanager.currentthread; while (!gscriptdone) mainthread.processnextevent(true); while (mainthread.haspendingevents()) mainthread.processnextevent(true); 2. in all callbacks where your script is finished, i.e. both success and error callbacks, put: gscriptdone = true; if you f...
... solution 1 var loader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); loader.loadsubscript("chrome://myall/content/file.jsm"); see: http://mxr.mozilla.org/comm-central/...figutils.js#54 solution 2 append the following at the top of your js file which you want to run in xpcshell { // <https://developer.mozilla.org/en/xpconnect/xpcshell/howto> // <https://bugzilla.mozilla.org/show_bug.cgi?id=546628> let cc = components.classes; let ci = components.interfaces; // register resource://app/ uri let ios = cc["@mozilla.org/network/io-service;1"] .getservice(ci.nsiioservice); let reshandler = ios.getprotocolhandler("resource") .queryinterface(ci.nsiresprotocolhandler); let mozdir = cc["@mozilla.org/fil...
xpcshell
it is a console application that lets you run javascript code. unlike the ordinary js shell (js), xpcshell lets the scripts running in it access xpcom functionality. prerequisites you need your own build of mozilla to use xpcshell. running xpcshell ./run-mozilla.sh ./xpcshell xpcshell is almost always in the same directory as run-mozilla.sh. $ locate run-mozilla.sh /usr/lib/firefox-0.10.1/run-mozilla.sh /usr/lib/thunderbird-0.9/run-mozilla.sh /usr/local/mozilla/run-mozilla.sh /opt/mozilla/run-mozilla.sh /root/.trash/mozilla/run-mozilla.sh just pick one, cd over there, and run-mozilla.sh xpcshell, if it's present. ...
...fy this, run xpcshell with the -v 180 command-line option, which tells xpcshell to use javascript 1.8. example you can input javascript, straight to mozilla. js> 5+7 12 js> print("hello, world!") hello, world! js> see also howto for common problems in writing xpcshell scripts, e.g., doing async network calls or using js modules. pretty much all mozilla programs use xpcom components via xpconnect. read xpconnect:using components to get started with that. see the xpcshell reference for information on command line arguments and extension functions. learn how to write xpcshell-based unit tests. read xpcshell:profiling for information on how to profile scripts. ...
nsIFile
pecific path string or by using cross-platform locations retrieved from the directory service. all methods with string parameters have two forms. the preferred form operates on utf-16 encoded characters strings. an alternate form operates on characters strings encoded in the "native" charset. a string containing characters encoded in the native charset cannot be safely passed to javascript via xpconnect. therefore, the utf-16 forms are scriptable, but the "native methods" are not. in addition, the native form cannot deal with files whose name contains characters outside the default system code page on windows. using the native form limits the ability of your code to deal with the full unicode support on windows 2000 or later where the os itself does not have such a limitation. therefore, you mus...
...onment variables (with the precedence the same as the order they're enumerated). on win32 platforms, it is the currently selected ansi codepage (specified by cp_acp). the word "native" appears in the name of methods that operate on or return strings encoded in the native character set. a string containing characters encoded in the native character set cannot be safely passed to javascript via xpconnect. therefore, the "native" methods and attributes are not scriptable. xpcom provides the string conversion functions ns_cstringtoutf16 and ns_utf16tocstring, which can be used to convert a string between utf-16 and the native character encoding. this interface was frozen for gecko 1.0. see bug 129279 for details. from gecko 2.0 interfaces are no longer frozen. see also nsilocalfile ns_cstrin...
nsIMsgIncomingServer
nsimsgincomingserver mailnews/base/public/nsimsgincomingserver.idlscriptable ??? add brief description of interface ??? ...
...thrown missing exception missing description cleartemporaryreturnreceiptsfilter() if sent folder pref is changed we need to clear the temporary return receipt filter so that the new return receipt filter can be recreated (by configuretemporaryreturnreceiptsfilter()). void cleartemporaryreturnreceiptsfilter(); parameters none. exceptions thrown missing exception missing description closecachedconnections() void closecachedconnections(); parameters none. exceptions thrown missing exception missing description configuretemporaryfilters() for mail, this configures both the mdn filter, and the server-side spam filter filters, if needed. if we have set up to filter return receipts into our sent folder, this utility method creates a filter to do that, and adds it to our filterlist if it doesn't ...
nsIPropertyBag
lways accessible so the window.navigator cannot be accessed. ...
...le so the window.navigator cannot be accessed. ...
nsISSLErrorListener
security/manager/ssl/public/nsisslerrorlistener.idlscriptable a mechanism to report a broken ssl connection. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) note: the recipient of this ssl status notification should not block. method overview boolean notifysslerror(in nsiinterfacerequestor socketinfo, in print32 error, in autf8string targetsite); methods notifysslerror() called in case of an ssl error. boolean notifysslerror( in nsiinterfacerequestor socketinfo, in print32 error, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection. error the code associated with the error. the ssl status object that desc...
...r. boolean notifysslerror( in nsiinterfacerequestor socketinfo, in print32 error, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection. error the code associated with the error. the ssl status object that describes the problem(s). targetsite the site name that was used to open the current connection. return value the consumer shall return true if it wants to suppress the error message related to the error (the connection will still get canceled). see also nsisockettransport ...
nsIScriptError
66 introduced gecko 1.0 inherits from: nsiconsolemessage last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/scripterror;1. to create an instance, use: var scripterror = components.classes["@mozilla.org/scripterror;1"] .createinstance(components.interfaces.nsiscripterror); note: the nsiscripterror2 interface was merged into this interface in gecko 12.0. prior to that release, if you wanted to associate an outer window with a script error, you had to use nsiscripterror2 instead. ...
...e in the code. this is an attempt to group them together for reference. note that these are strings. if you want to log an error at chrome level you should set a category from the first section (leaving it empty might log it as content error). as addon author i would recommend using "chrome javascript" for logging exceptions caused by addon code. ...
nsISecurityCheckedComponent
caps/idl/nsisecuritycheckedcomponent.idlscriptable provides methods that let an xpcom component define custom rules for accessing it from potentially unprivileged code. inherits from: nsisupports last changed in gecko 1.7 capability strings in gecko, a "capability" is a string identifying a set of actions that code is allowed to perform. two examples: code that has the "universalxpconnect" capability is allowed to access all of xpcom. this includes creating instances of arbitrary xpcom objects and calling methods and setting properties on them. code that has the "universalbrowserread" capability is allowed to perform certain actions that allow it to read information from the local system. for example, this capability allows code to set the value of <input type="file"> and access...
...s have no special capabilities. extensions can define their own capabilities and use this interface to only allow access to code trusted with that capability. the two special return values of '"allaccess" or "noaccess" unconditionally allow or deny access to the operation. all code has the "allaccess" capability, and no code has the "noaccess" capability. this interface is used in mozilla by xpconnect and a handful of things that need special handing (xul controllers, the ui for the <video> tag, etc.). method overview string cancallmethod(in nsiidptr iid, in wstring methodname); string cancreatewrapper(in nsiidptr iid); string cangetproperty(in nsiidptr iid, in wstring propertyname); string cansetproperty(in nsiidptr iid, in wstring propertyname); methods cancallmethod() returns a ...
nsIServerSocketListener
the address of the client can be found by calling the nsisockettransport.getaddress() method or by inspecting nsisockettransport.gethost(), which returns a string representation of the client's ip address, which may be either an ipv4 or an ipv6 address. ...
...esentation of the client's ip address, which may be either an ipv4 or an ipv6 address. inherits from: nsisupports last changed in gecko 1.7 method overview void onsocketaccepted(in nsiserversocket aserv, in nsisockettransport atransport); void onstoplistening(in nsiserversocket aserv, in nsresult astatus); methods onsocketaccepted() this method is called when a client connection is accepted. void onsocketaccepted( in nsiserversocket aserv, in nsisockettransport atransport ); parameters aserv the server socket. atransport the connected socket transport. onstoplistening() this method is called when the listening socket stops for some reason. the server socket is effectively dead after this notification. void onstoplistening( in nsiserversocket a...
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 notifywhencanattachsocket() method should be used. note: this function may only be called from an event dispatch on the socket t...
...solete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void shutdown(); parameters none. example // at first, we need a nsisockettransportservice .... var transportservice = components.classes["@mozilla.org/network/socket-transport-service;1"] .getservice(components.interfaces.nsisockettransportservice); // ... then it is time to create the transport. it will connect to ... // ... mozilla.org:2000 with tls support and default proxy settings var socket = transportservice.createtransport(["starttls"], 1,"mozilla.org", 2000, null); see also nsisockettransport nsirunnable nsiproxyinfo ...
nsITransport
this interface does not in any way specify the resource. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) this interface provides methods to open blocking or non-blocking, buffered or unbuffered streams to the resource. the name "transport" is meant to connote the inherent data transfer implied by this interface (that is, data is being transfered in some fashion via the streams exposed by this interface). a transport can have an event sink associated with it. ...
...resource. the name "transport" is meant to connote the inherent data transfer implied by this interface (that is, data is being transfered in some fashion via the streams exposed by this interface). a transport can have an event sink associated with it. the event sink receives transport-specific events as the transfer is occurring. for a socket transport, these events can include status about the connection. see nsisockettransport for more info about socket transport specifics. method overview void close(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 nsi...
nsIVariant
we mark the interface [scriptable] so that js can use methods that refer to this interface. but we mark all the methods and attributes [noscript] since any nsivariant object will be automatically converted to a js type anyway. ...
...pointer. (the reference count of the object is incremented.) native code only!getasisupports nsisupports getasisupports(); parameters none. return value the interface pointer. (the reference count of the object is incremented.) native code only!getasjsval jsval getasjsval(); parameters none. return value returns the underlying js value, if the variant was created by passing a js object into xpconnect. native code only!getasstring string getasstring(); 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 and interface pointers cannot be converted to a string. native code only!getasstringwithsize void...
nsIWebSocketListener
tring. onserverclose() called when the server sends a close message. in the case of errors, onstop() may be called without this method ever getting called. no additional messages through onmessageavailable(), onbinarymessageavailable()() or onacknowledge()() will be delievered to the listener after onserverclose() is called, but outgoing messages can still be sent through the nsiwebsocketchannel connection. void onserverclose( in nsisupports acontext, in unsigned short acode, in autf8string areason ); parameters acontext user defined context. acode the websocket closing handshake status code; see status codes for possible values. areason a text string explaining the reason for the closure of the connection. onstart() called to signify the establishment of the mes...
...ction. onstart() called to signify the establishment of the message stream. any listener that receives onstart() will also receive onstop(). void onstart( in nsisupports acontext ); parameters acontext user defined context. onstop() called to signify the completion of the message stream. this is the final notification the listener will receive; once it's been received, the websocket connection is complete. this event can be received in error cases even if nsiwebsocketchannel.close() has not been called. void onstop( in nsisupports acontext, in nsresult astatuscode ); parameters acontext user defined context. astatuscode reason for stopping (ns_ok if completed successfully). see also websockets nsiwebsocketchannel ...
nsIAbCard/Thunderbird3
ertyasbool(in string name); returns a property for the given name. these functions convert values in the same manner as the default implementation of nsivariant. of particular note is that boolean variables are converted to integers as in c/c++ (true is a non-zero value), so that false will be converted to a string of 0 and not false<code>. these functions are marked <code>[noscript] since xpcconnect performs automatic type conversion on nsivariant such that they are not needed for scripts, only for c++ callers. parameters name the case-sensitive name of the property to get. return value the value of the attribute asked for. exceptions thrown ns_error_not_available<tt> if the named property does not exist. <tt>ns_error_cannot_convert_data if the property cannot be converted ...
...onstraints for certain properties. however, such constraints might not be checked by this method. these functions convert values in the same manner as the default implementation of nsivariant. a value must be convertible to a string; if this convention is not followed, consumers of cards may fail unpredictably or return incorrect results. the non-variant functions are marked [noscript] since xpconnect uses magic with nsivariant such that the other functions are not needed, although c++ does need them. void setproperty(in autf8string name, in nsivariant value); [noscript] void setpropertyasastring(in string name, in astring value); [noscript] void setpropertyasautf8string(in string name, in autf8string value); [noscript] void setpropertyasuint32(in string name, in pruint32 value); [noscri...
XPCOM
is can create a difficult situation for extension developers trying to support multiple gecko versions (firefox 2 and 3, for example).creating a python xpcom componentcreating applications with mozilla already provides a tutorial for making a simple javascript or c++ component (implementing the nsisimple interface). here is how to make the same component in python using pyxpcom.fun with xbl and xpconnectgenerating guidsguids are used in mozilla programming for identifying several types of entities, including xpcom interfaces (this type of guids is callled iid), components (cid), and legacy add-ons—like extensions and themes—that were created prior to firefox 1.5. add-ons can (and should) be identified with ids of the form extensionname@organization.tld since firefox 1.5.generic factorymost xp...
...when available, it lets you access the javascript object hidden by the wrapper.xpcom abixpcom abi is the binary interface of xpcom components. while xpcom components written in a scripting language (such as javascript) can be moved across platforms (such as windows and os x) without adaptation, those written in a compiled language (such as c++) require recompilation when moving to a dif...
XSLT 2.0
although xslt 2.0 is not natively supported in firefox, it is possible via saxon-b (java) or, more recently, saxon-ce (javascript) to perform xslt 2.0. for users saxon-ce no extensions are required, saxon-ce runs whenever a html page is loaded that links to the saxon-ce javascript library. saxon-b the xsl results extension uses the new incarnation of liveconnect (handled by java 1.6v12+ instead of mozilla-specific code) to connect with the java-based saxon-b library, and adds support for having xslt performed automatically when visiting a page with the appropriate xslt processing instruction (and which isn't processed by firefox's own xslt 1.0 processor). for developers saxon-ce a javascript api is provided for initiating an xslt 2.0 transform from a web page. error and diagnost...
...ting a page with the appropriate xslt processing instruction (and which isn't processed by firefox's own xslt 1.0 processor). for developers saxon-ce a javascript api is provided for initiating an xslt 2.0 transform from a web page. error and diagnostics output from saxon-ce can be reviewed in the firefox developer console or in firebug. saxon-b the extension demonstrates how one can use liveconnect code to communicate with the saxon-b library, but one might find the javascript code module approach used inside the extension xquseme as a more reusable approach. the code does not currently work on the mac (except for server edition supporting java 1.6) due to its lagging java support (and thus liveconnect support). ...
Plug-in Development Overview - Plugins
see the wikipedia article for historical information. both technologies are now obsolete for the purposes of plug-in scriptability, and the cross-browser npruntime api should be used instead. see the scripting plugins section of this reference for the details. building plug-ins once you have added the special code and additional files ...
...see the wikipedia article for historical information. both technologies are now obsolete for the purposes of plug-in scriptability, and the cross-browser npruntime api should be used instead. see the scripting plugins section of this reference for the details. building plug-ins once you have added the special code and additional files to make your plug-in...
Deprecated tools - Firefox Developer Tools
ng immediate feedback. unlike in scratchpad, errors are properly displayed in the output with an expandable stacktrace, making it easier 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 firefo...
...ernatives spector.js is a webextension that can provide these features with 3d contexts. web audio editor bugzilla issue: bug 1403944 removed as of firefox 67 description the web audio editor allowed you to examine an audio context constructed in the page and provided a visualization of its graph. this gave a high-level view of its operation, and enabled you to ensure that all the nodes are connected in the way you expect. it was possible to edit the audioparam properties for each node in the graph. some non-audioparam properties, like an oscillatornode's type property, were displayed and editable as well. it was deprecated due to lack of use. more details about the web audio editor alternatives alternatives include audion and https://github.com/spite/webaudioextension web extensions. ...
Network request list - Firefox Developer Tools
he http status code returned. the numeric code is displayed on a colored background, to help unusual ones stand out. if there was no response, this column is empty. or you might see a red circle with a diagonal slash for responses that were blocked by the browser or the server. method: the http request method used. domain: domain of the path requested. if the request used ssl/tls and the connection had security weaknesses such as weak ciphers, you'll see a warning triangle next to the domain. y hover over the domain to see the ip address. there's an icon next to the domain that gives you extra information about the security status of that request. see security icons. file: the basename of the file requested. (starting in firefox 80) on the right edge of the file column,...
...ept any string, and affect any url containing the string. filtering requests you can filter requests by content type, by whether they are xmlhttprequests or websocket requests, or by request properties. filter type how to apply content type use the buttons in the toolbar (html, css, js). xhr requests use the xhr button in the toolbar. websocket connections use the ws button in the toolbar. you can filter by plain text (in which case the text is used to find partial matches; entering "for" will match any message that contains the word "for") or—as of firefox 75—using regular expressions (by writing the regexp bracketed within slashes; "/.+corp.*/" will look for any occurrence of "corp" which has at least one character before it and may or...
Responsive Design Mode - Firefox Developer Tools
hots are saved to firefox's default download location. if you checked "screenshot to clipboard" in the developer tools settings page, then the screenshot will be copied to the system clipboard. dpr (pixel ratio) - beginning with firefox 68, the dpr is no longer editable; create a custom device in order to change the dpr throttling - a drop-down list where you can select the connection throttling to apply, for example 2g, 3g, or lte enable/disable touch simulation - toggles whether or not responsive design mode simulates touch events. while touch event simulation is enabled, mouse events are translated into touch events; this includes (starting in firefox 79) translating a mouse-drag event into a touch-drag event. (note that when touch simulation is enabled, this toolbar ic...
...vices in responsive design mode by clicking the add custom device button. each device can have its own: name size devicepixelratio user agent string touch screen also, you can preview the properties of existing devices by hovering over the name in the device modal, where they display in a tooltip. network throttling if you do all your development and testing using a very fast network connection, users may experience problems with your site if they are using a slower connection. in responsive design mode, you can instruct the browser to emulate, very approximately, the characteristics of various different types of networks. the characteristics emulated are: download speed upload speed minimum latency the table below lists the numbers associated with each network type, but plea...
AnalyserNode.getFloatFrequencyData() - Web APIs
while the audio is playing, we collect the frequency data repeatedly with requestanimationframe() and draw a "winamp bargraph style" to a <canvas> element. for more complete applied examples/information, check out our voice-change-o-matic-float-data demo (see the source code too). <!doctype html> <body> <script> const audioctx = new audiocontext...
....mp3';//insert file name here audioele.autoplay = true; audioele.preload = 'auto'; const audiosourcenode = audioctx.createmediaelementsource(audioele); //create analyser node const analysernode = audioctx.createanalyser(); analysernode.fftsize = 256; const bufferlength = analysernode.frequencybincount; const dataarray = new float32array(bufferlength); //set up audio node network audiosourcenode.connect(analysernode); analysernode.connect(audioctx.destination); //create 2d canvas const canvas = document.createelement('canvas'); canvas.style.position = 'absolute'; canvas.style.top = 0; canvas.style.left = 0; canvas.width = window.innerwidth; canvas.height = window.innerheight; document.body.appendchild(canvas); const canvasctx = canvas.getcontext('2d'); canvasctx.clearrect(0, 0, canvas.width, ca...
AnalyserNode - Web APIs
the analysernode interface represents a node able to provide real-time frequency and time-domain analysis information. it is an audionode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio visualizations. an analysernode has exactly one input and one output. the node works even if the output is not connected. ...
...me-domain analysis information. it is an audionode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio visualizations. an analysernode has exactly one input and one output. the node works even if the output is not connected. ...
AudioContext.createMediaStreamDestination() - Web APIs
mediastream representing an audio stream, which may be stored in a local file or sent to another computer. the mediastream is created when the node is created and is accessible via the mediastreamaudiodestinationnode's stream attribute. this stream can be used in a similar way as a mediastream obtained via navigator.getusermedia — it can, for example, be sent to a remote peer using the rtcpeerconnection addstream() method. for more details about media stream destination nodes, check out the mediastreamaudiodestinationnode reference page. syntax var audioctx = new audiocontext(); var destination = audioctx.createmediastreamdestination(); returns a mediastreamaudiodestinationnode. examples in the following simple example, we create a mediastreamaudiodestinationnode, an oscillatornode and...
...a pure sine wave to an opus file </p> <button>make sine wave</button> <audio controls></audio> <script> var b = document.queryselector("button"); var clicked = false; var chunks = []; var ac = new audiocontext(); var osc = ac.createoscillator(); var dest = ac.createmediastreamdestination(); var mediarecorder = new mediarecorder(dest.stream); osc.connect(dest); b.addeventlistener("click", function(e) { if (!clicked) { mediarecorder.start(); osc.start(0); e.target.innerhtml = "stop recording"; clicked = true; } else { mediarecorder.stop(); osc.stop(0); e.target.disabled = true; } }); mediarecorder.ondataavailable = function(evt) {...
AudioContext.createMediaStreamTrackSource() - Web APIs
working draft ...
... working draft ...
AudioNode.channelCount - Web APIs
channelcount's usage and precise definition depend on the value of audionode.channelcountmode: it is ignored if the channelcountmode value is max. it is used as a maximum value if the channelcountmode value is clamped-max. it is used as the exact value if the channelcountmode value is explicit. syntax var oscillator = audioctx.createoscillator(); var channels = oscillator.channelcount; value an integer. ...
...t is used as the exact value if the channelcountmode value is explicit. syntax var oscillator = audioctx.createoscillator(); var channels = oscillator.channelcount; value an integer. example var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var oscillator = audioctx.createoscillator(); var gainnode = audioctx.creategain(); oscillator.connect(gainnode); gainnode.connect(audioctx.destination); oscillator.channelcount; specifications specification status comment web audio apithe definition of 'channelcount' in that specification. working draft ...
AudioNode.channelCountMode - Web APIs
de property of the audionode interface represents an enumerated value describing the way channels must be matched between the node's inputs and outputs. the possible values of channelcountmode and their meanings are: value description the following audionode children default to this value max the number of channels is equal to the maximum number of channels of all connections. in this case, channelcount is ignored and only up-mixing happens. gainnode, delaynode, scriptprocessornode, channelmergernode, biquadfilternode, waveshapernode clamped-max the number of channels is equal to the maximum number of channels of all connections, clamped to the value of channelcount. pannernode, convolvernode, dynamicscompressornode explicit the numbe...
...channelsplitternode was max. syntax var oscillator = audioctx.createoscillator(); oscillator.channelcountmode = 'explicit'; value a enumerated value representing a channelcountmode. example var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var oscillator = audioctx.createoscillator(); var gainnode = audioctx.creategain(); oscillator.connect(gainnode); gainnode.connect(audioctx.destination); oscillator.channelcountmode = 'explicit'; specifications specification status comment web audio apithe definition of 'channelcountmode' in that specification. working draft ...
AudioParamDescriptor - Web APIs
8 samples), // however it may contain a single value which is to be used for all 128 samples // if no automation is scheduled for the moment. ...
...oiseprocessor) next, in our main scripts file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor, and connect the node to an audio graph. ...
AudioWorkletNode.parameters - Web APIs
8 samples), // however it may contain a single value which is to be used for all 128 samples // if no automation is scheduled for the moment. ...
...oiseprocessor) next, in our main scripts file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor, and connect the node to an audio graph. ...
AudioWorkletNode - Web APIs
it has an associated audioworkletprocessor, which does the actual audio processing in a web audio rendering thread. ...
...s) { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = math.random() * 2 - 1 } }) return true } } registerprocessor('white-noise-processor', whitenoiseprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor, and connect the node to an audio graph. const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('white-noise-processor.js') const whitenoisenode = new audioworkletnode(audiocontext, 'white-noise-processor') whitenoisenode.connect(audiocontext.destination) specifications specification status comment web audio apithe definition of 'audioworkletnode' in that...
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
8 samples), // however it may contain a single value which is to be used for all 128 samples // if no automation is scheduled for the moment. ...
...oiseprocessor) next, in our main scripts file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor, and connect the node to an audio graph. ...
AudioWorkletProcessor - Web APIs
ssor class (see "deriving classes" section) and supply your own process() method in it; register the processor using audioworkletglobalscope.registerprocessor() method; load the file using addmodule() method on your audio context's audioworklet property; create an audioworkletnode based on the processor. the processor will be instantiated internally by the audioworkletnode constructor. connect the node to the other nodes. examples in the example below we create a custom audioworkletnode that outputs white noise. first, we need to define a custom audioworkletprocessor, which will output white noise, and register it. note that this should be done in a separate file. // white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor { process (inputs, outputs, para...
... { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = math.random() * 2 - 1 } }) return true } } registerprocessor('white-noise-processor', whitenoiseprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode, passing it the name of the processor, then connect the node to an audio graph. const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('white-noise-processor.js') const whitenoisenode = new audioworkletnode(audiocontext, 'white-noise-processor') whitenoisenode.connect(audiocontext.destination) specifications specification status comment web audio apithe definition of 'audioworkletprocessor' in...
BaseAudioContext.createBiquadFilter() - Web APIs
matic demo (look at the source code too). ...
...window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.setvalueattime(1000, audioctx.currenttime); biquadfilter.gain.setvalueattime(25, audioctx.currenttime); specifications spe...
BaseAudioContext.decodeAudioData() - Web APIs
tion uses xhr to load an audio track, setting the responsetype of the request to arraybuffer so that it returns an array buffer as its response that we then store in the audiodata variable . we then pass this buffer into a decodeaudiodata() function; the success callback takes the successfully decoded pcm data, puts it into an audiobuffersourcenode created using audiocontext.createbuffersource(), connects the source to the audiocontext.destination and sets it to loop. the buttons in the example simply run getdata() to load the track and start it playing, and stop it playing, respectively. when the stop() method is called on the source, the source is cleared out. note: you can run the example live (or view the source.) // define variables var audioctx = new (window.audiocontext || window.web...
...we put the buffer into the source function getdata() { source = audioctx.createbuffersource(); var request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { source.buffer = buffer; source.connect(audioctx.destination); source.loop = true; }, function(e){ console.log("error with decoding audio data" + e.err); }); } request.send(); } // wire up buttons to stop and play audio play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute('disabled'); ...
BiquadFilterNode.Q - Web APIs
matic demo (look at the source code too). ...
...window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; biquadfilter.type = "peaking"; biquadfilter.frequency.value = 1000; biquadfilter.q.value...
BiquadFilterNode.detune - Web APIs
matic demo (look at the source code too). ...
...window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; biquadfilter.detune.value = 100; specifications specification status co...
BiquadFilterNode.frequency - Web APIs
matic demo (look at the source code too). ...
...window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; specifications specification status comment web audio apithe d...
BiquadFilterNode.gain - Web APIs
matic demo (look at the source code too). ...
...window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; specifications specification status comment web audio apithe d...
BiquadFilterNode.type - Web APIs
matic demo (look at the source code too). ...
...window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = 25; specifications specification status comment web audio apithe d...
BiquadFilterNode - Web APIs
matic demo (look at the source code too). ...
...window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.setvalueattime(1000, audioctx.currenttime); biquadfilter.gain.setvalueattime(25, audioctx.currenttime); specifications spe...
BluetoothRemoteGATTServer - Web APIs
the bluetoothremotegattserver interface of the web bluetooth api represents a gatt server on a remote device. interface interface bluetoothremotegattserver { readonly attribute bluetoothdevice device; readonly attribute boolean connected; promise<bluetoothremotegattserver> connect(); void disconnect(); promise<bluetoothremotegattservice> getprimaryservice(bluetoothserviceuuid service); promise<sequence<bluetoothremotegattservice>> getprimaryservices(optional bluetoothserviceuuid service); }; properties bluetoothremotegattserver.connectedread only a boolean value that returns true while this script execution environment is connected to this.device. it can be false while the user agent is physically connected. bluetoothremotegattserver.deviceread only a reference ...
...bluetoothserviceuuid service); }; properties bluetoothremotegattserver.connectedread only a boolean value that returns true while this script execution environment is connected to this.device. it can be false while the user agent is physically connected. bluetoothremotegattserver.deviceread only a reference to the bluetoothdevice running the server. methods bluetoothremotegattserver.connect() causes the script execution environment to connect to this.device. bluetoothremotegattserver.disconnect() causes the script execution environment to disconnect from this.device. bluetoothremotegattserver.getprimaryservice() returns a promise to the primary bluetoothgattservice offered by the bluetooth device for a specified bluetoothserviceuuid. bluetoothremotegattserver.getprimaryservice...
Body.arrayBuffer() - Web APIs
Web › API › Body › arrayBuffer
te a new request using the request() constructor, then use it to fetch an ogg music track. we also use audiocontext.createbuffersource to create an audio buffer source. when the fetch is successful, we read an arraybuffer out of the response using arraybuffer(), decode the audio data using audiocontext.decodeaudiodata, set the decoded data as the audio buffer source's buffer (source.buffer), then connect the source up to the audiocontext.destination. once getdata() has finished running, we start the audio source playing with start(0), then disable the play button so it can't be clicked again when it is already playing (this would cause an error.) function getdata() { source = audioctx.createbuffersource(); var myrequest = new request('viper.ogg'); fetch(myrequest).then(function(response...
... function readfile(file) { return new response(file).arraybuffer(); } <input type="...
CanvasRenderingContext2D.closePath() - Web APIs
t, this function does nothing. this method doesn't draw anything to the canvas directly. you can render the path using the stroke() or fill() methods. syntax void ctx.closepath(); examples closing a triangle this example creates the first two (diagonal) sides of a triangle using the lineto() method. after that, the triangle's base is created with the closepath() method, which automatically connects the shape's first and last points. html <canvas id="canvas"></canvas> javascript the triangle's corners are at (20, 150), (120, 20), and (220, 150). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(20, 140); // move pen to bottom-left corner ctx.lineto(120, 10); // line to top corner ctx.lineto(220, 140); // line to bo...
... note: although closepath() is called after all the arcs have been created, only the last arc (sub-path) gets closed. html <canvas id="canvas"></canvas> javascript the first two arcs create the face's eyes. the last arc creates the mouth. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.arc(240, 20, 40, 0, math.pi); ...
CanvasRenderingContext2D.lineTo() - Web APIs
like other methods that modify the current path, this method does not directly render anything. to draw the path onto a canvas, you can use the fill() or stroke() methods. syntax ctx.lineto(x, y); parameters x the x-axis coordinate of the line's end point. y the y-axis coordinate of the line's end point. return value undefined. examples drawing a straight line this example draws a straight line using the lineto() method. ...
... html <canvas id="canvas"></canvas> javascript the line begins at (30, 50) and ends at (150, 100). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); // start a new path ctx.moveto(30, 50); // move the pen to (30, 50) ctx.lineto(150, 100); // draw a line to (150, 100) ctx.stroke(); // render the path result drawing connected lines each call of lineto() (and similar methods) automatically adds to the current sub-path, which means that all the lines will all be stroked or filled together. this example draws a letter 'm' with a single contiguous line. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.moveto(90, 130); ctx.line...
CanvasRenderingContext2D - Web APIs
ntext2d.closepath() causes the point of the pen to move back to the start of the current sub-path. it tries to draw a straight line from the current point to the start. if the shape has already been closed or has only one point, this function does nothing. canvasrenderingcontext2d.moveto() moves the starting point of a new sub-path to the (x, y) coordinates. canvasrenderingcontext2d.lineto() connects the last point in the current sub-path to the specified (x, y) coordinates with a straight line. canvasrenderingcontext2d.beziercurveto() adds a cubic bézier curve to the current path. canvasrenderingcontext2d.quadraticcurveto() adds a quadratic bézier curve to the current path. canvasrenderingcontext2d.arc() adds a circular arc to the current path. canvasrenderingcontext2d.arcto() add...
...nates with a straight line. canvasrenderingcontext2d.beziercurveto() adds a cubic bézier curve to the current path. canvasrenderingcontext2d.quadraticcurveto() adds a quadratic bézier curve to the current path. canvasrenderingcontext2d.arc() adds a circular arc to the current path. canvasrenderingcontext2d.arcto() adds an arc to the current path with the given control points and radius, connected to the previous point by a straight line. canvasrenderingcontext2d.ellipse() adds an elliptical arc to the current path. canvasrenderingcontext2d.rect() creates a path for a rectangle at position (x, y) with a size that is determined by width and height. drawing paths canvasrenderingcontext2d.fill() fills the current sub-paths with the current fill style. canvasrenderingcontext2d.str...
ConvolverNode - Web APIs
working draft ...
... working draft ...
Event - Web APIs
Web › API › Event
a specified target using eventtarget.dispatchevent(). there are many types of events, some of which use other interfaces based on the main event interface. event itself contains the properties and methods which are common to all events. many dom elements can be set up to accept (or "listen" for) these events, and execute code in response to process (or "handle") them. event-handlers are usually connected (or "attached") to various html elements (such as <button>, <div>, <span>, etc.) using eventtarget.addeventlistener(), and this generally replaces using the old html event handler attributes. further, when properly added, such handlers can also be disconnected if needed using removeeventlistener(). note: one element can have several such handlers, even for the exact same event—particularly ...
... properties event.bubbles read only a boolean indicating whether or not the event bubbles up through the dom. event.cancelbubble a histor...
GamepadEvent - Web APIs
the gamepadevent interface of the gamepad api contains references to gamepads connected to the system, which is what the gamepad events window.gamepadconnected and window.gamepaddisconnected are fired in response to. constructor gamepadevent() returns a new gamepadevent object. properties gamepadevent.gamepad read only returns a gamepad object, providing access to the associated gamepad data for the event fired. examples the gamepad property being called on a fired window.gamepadconnected event. window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at index %d: %s. %d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); and on a window.gamepaddisconnected event. window.addeventlistener(...
...ent fired. examples the gamepad property being called on a fired window.gamepadconnected event. window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at index %d: %s. %d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); and on a window.gamepaddisconnected event. window.addeventlistener("gamepaddisconnected", function(e) { console.log("gamepad disconnected from index %d: %s", e.gamepad.index, e.gamepad.id); }); specifications specification status comment gamepadthe definition of 'gamepadevent' in that specification. working draft initial definition browser compatibility desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for a...
Gamepad API - Web APIs
the gamepad api is a way for developers to access and respond to signals from gamepads and other game controllers in a simple, consistent way. it contains three interfaces, two events and one specialist function, to respond to gamepads being connected and disconnected, and to access other information about the gamepads themselves, and what buttons and other controls are currently being pressed. interfaces gamepad represents a gamepad/controller connected to the computer. gamepadbutton represents a button on one of the connected controllers. gamepadevent the event object representing events fired that are related to gamepads. experimental gamepad extensions gamepadhapticactuator represents hardware in the controller designed to provide haptic feedback to the user (if available), mo...
...ardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware. see also the extensions to the gamepad interface, for features that allow you to access the above information. extensions to other interfaces navigator navigator.getgamepads() an extension to the navigator object that returns an array of gamepad objects, one for each connected gamepad. window events window.ongamepadconnected represents an event handler that will run when a gamepad is connected (when the gamepadconnected event fires). window.ongamepaddisconnected represents an event handler that will run when a gamepad is disconnected (when the gamepaddisconnected event fires). tutorials and guides using the gamepad api implementing controls using the ga...
IDBDatabase.objectStoreNames - Web APIs
the objectstorenames read-only property of the idbdatabase interface is a domstringlist containing a list of the names of the object stores currently in the connected database. note: this feature is available in web workers. syntax var list[] = idbdatabase.objectstorenames; value a domstringlist containing a list of the names of the object stores currently in the connected database. example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening ...
... being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be // an object that looks like { ['my-store-name'] } console.log(db.objectstorenames); }; specifications specification status comment indexed database api 2.0the definition of 'objectstorenames' in that specification. recommendation indexed database api draftthe definition of 'objectstorenames' in that specification. reco...
IDBDatabase.version - Web APIs
the version property of the idbdatabase interface is a 64-bit integer that contains the version of the connected database. when a database is first created, this attribute is an empty string. note: this feature is available in web workers. syntax var myinteger = idbdatabase.version; value an integer containing the version of the connected database. example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database // being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be "4" console.log(db.version); }; specifications specification status comment indexed database api 2.0the definition of 'version' in that specification. recommendation indexed database api draftthe definition of 'version' in that specification. recommendation browser compatibility the compatibility table on th...
IDBTransaction.db - Web APIs
Web › API › IDBTransaction › db
the db read-only property of the idbtransaction interface returns the database connection with which this transaction is associated. note: this feature is available in web workers. syntax var mydatabase = transaction.db; value an idbdatabase object. 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 return the associated database connection using db. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function...
... recommendation indexed database api draftthe definition of 'db' in that specification. recommendation browser compatibility the compatibility table on this page...
MediaStreamAudioSourceNode - Web APIs
the mediastreamaudiosourcenode interface is a type of audionode which operates as an audio source whose media is received from a mediastream obtained using the webrtc or media capture and streams apis. this media could be from a microphone (through getusermedia()) or from a remote peer on a webrtc call (using the rtcpeerconnection's audio tracks). a mediastreamaudiosourcenode has no inputs and exactly one output, and is created using the audiocontext.createmediastreamsource() method. the mediastreamaudiosourcenode takes the audio from the first mediastreamtrack whose kind attribute's value is audio. see track ordering for more information about the order of tracks. the number of channels output by the node matches the number of tracks found in the selected audio track. number of i...
...iosourcenode // feed the htmlmediaelement into it var audioctx = new audiocontext(); var source = audioctx.createmediastreamsource(stream); // create a biquadfilter var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.oninput = function() {...
MediaStreamTrackAudioSourceNode - Web APIs
the mediastreamtrackaudiosourcenode interface is a type of audionode which represents a source of audio data taken from a specific mediastreamtrack obtained through the webrtc or media capture and streams apis. the audio itself might be input from a microphone or other audio sampling device, or might be received through a rtcpeerconnection, among other posible options. a mediastreamtrackaudiosourcenode has no inputs and exactly one output, and is created using the audiocontext.createmediastreamtracksource() method. this interface is similar to mediastreamaudiosourcenode, except it lets you specifically state the track to use, rather than assuming the first audio track on a stream. number of inputs 0 number of outputs 1 channel count defined by the first au...
...iosourcenode // feed the htmlmediaelement into it var audioctx = new audiocontext(); var source = audioctx.createmediastreamsource(stream); // create a biquadfilter var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.oninput = function() {...
MediaTrackConstraints - Web APIs
e property. to learn more about how constraints work, see capabilities, constraints, and settings. properties some combination—but not necessarily all—of the following properties will exist on the object. this may be because a given browser doesn't support the property, or because it doesn't apply. for example, because rtp doesn't provide some of these values during negotiation of a webrtc connection, a track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid. properties of all media tracks deviceid a constraindomstring object specifying a device id or an array of device ids which are acceptable and/or required. groupid a constraindomstring object specifying a group id or an array of group ids which are acceptable and/or required. pr...
...r) specifying the degree of color intensity. sharpness a constraindouble (a double-precision integer) specifying the intensity of edges. focusdistance a constraindouble (a double-precision integer) specifying distance to a focused object. zoom a constraindouble (a double-precision integer) specifying the desired focal length. torch a boolean defining whether the fill light is continuously connected, meaning it stays on as long as the track is active. properties of video tracks aspectratio a constraindouble specifying the video aspect ratio or range of aspect ratios which are acceptable and/or required. facingmode a constraindomstring object specifying a facing or an array of facings which are acceptable and/or required. framerate a constraindouble specifying the frame rate or ra...
MediaTrackSettings.echoCancellation - Web APIs
llation is enabled on an audio track. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.echocancellation property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). echo cancellation is a feature which attempts to prevent echo effects on a two-way audio connection by attempting to reduce or eliminate crosstalk between the user's output device and their input device. for example, it might apply a filter that negates the sound being produced on the speakers from being included in the input track generated from the microphone. if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.e...
...you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.echocancellation as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var echocancellation = mediatracksettings.echocancellation; value a boolean value which is true if the track has echo cancellation functionality enabled or false if echo cancellation is disabled. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status ...
MutationObserver - Web APIs
the mutationobserver interface provides the ability to watch for changes being made to the dom tree. it is designed as a replacement for the older mutation events feature, which was part of the dom3 events specification. constructor mutationobserver() creates and returns a new mutationobserver which will invoke a specified callback function when dom changes occur. methods disconnect() stops the mutationobserver instance from receiving further notifications until and unless observe() is called again. observe() configures the mutationobserver to begin receiving notifications through its callback function when dom changes matching the given options occur. takerecords() removes all pending notifications from the mutationobserver's notification queue and returns them in a new array of ...
... living standard ...
OfflineAudioContext.startRendering() - Web APIs
the complete event (of type offlineaudiocompletionevent) is raised when the rendering is finished, containing the resulting audiobuffer in its renderedbuffer property. browsers currently support two versions of the startrendering() method — an older event-based version and a newer promise-based version. the former will eventually be removed, but currently both mechanisms are provided for legacy reasons. ...
...udiodata to decode it and offlineaudiocontext to render it function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.connect(offlinectx.destination); source.start(); //source.loop = true; offlinectx.startrendering().then(function(renderedbuffer) { console.log('rendering completed successfully'); var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var song = audioctx.createbuffersource(); song.buffer = renderedbuffer; song.connect(audioctx.d...
OfflineAudioContext - Web APIs
er the event-based version of offlineaudiocontext.startrendering() is used. methods also inherits methods from its parent interface, baseaudiocontext. offlineaudiocontext.suspend() schedules a suspension of the time progression in the audio context at the specified time and returns a promise. offlineaudiocontext.startrendering() starts rendering the audio, taking into account the current connections and the current scheduled changes. this page covers both the event-based version and the promise-based version. deprecated methods offlineaudiocontext.resume() resumes the progression of time in an audio context that has previously been suspended. note: the resume() method is still available — it is now defined on the baseaudiocontext interface (see baseaudiocontext.resume()) and t...
...udiodata to decode it and offlineaudiocontext to render it function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.connect(offlinectx.destination); source.start(); //source.loop = true; offlinectx.startrendering().then(function(renderedbuffer) { console.log('rendering completed successfully'); var song = audioctx.createbuffersource(); song.buffer = renderedbuffer; song.connect(audioctx.destination); play.onclick = function() { song.start(); ...
Path2D - Web APIs
Web › API › Path2D
) adds a path to the current path. path2d.closepath() causes the point of the pen to move back to the start of the current sub-path. it tries to draw a straight line from the current point to the start. if the shape has already been closed or has only one point, this function does nothing. path2d.moveto() moves the starting point of a new sub-path to the (x, y) coordinates. path2d.lineto() connects the last point in the subpath to the (x, y) coordinates with a straight line. path2d.beziercurveto() adds a cubic bézier curve to the path. it requires three points. the first two points are control points and the third one is the end point. the starting point is the last point in the current path, which can be changed using moveto() before creating the bézier curve. path2d.quadraticcurveto...
... the bézier curve. path2d.quadraticcurveto() adds a quadratic bézier curve to the current path. path2d.arc() adds an arc to the path which is centered at (x, y) position with radius r starting at startangle and ending at endangle going in the given direction by anticlockwise (defaulting to clockwise). path2d.arcto() adds a circular arc to the path with the given control points and radius, connected to the previous point by a straight line. path2d.ellipse() adds an elliptical arc to the path which is centered at (x, y) position with the radii radiusx and radiusy starting at startangle and ending at endangle going in the given direction by anticlockwise (defaulting to clockwise). path2d.rect() creates a path for a rectangle at position (x, y) with a size that is determined by width and ...
RTCDTMFSender - Web APIs
for that reason, dtmf can't be used between two webrtc-based devices, because there is no mechanism provided by webrtc for receiving dtmf codes. ...
...for that reason, dtmf can't be used between two webrtc-based devices, because there is no mechanism provided by webrtc for receiving dtmf codes. ...
RTCDataChannel.close() - Web APIs
the sequence of events which occurs in response to this method being called: rtcdatachannel.readystate is set to "closing". ...
...sed". if the transport was closed with an error, the rtcdatachannel is sent a networkerror event. a close event is sent to the channel. in firefox, the rtcdatachannel interface was implemented under the name datachannel until firefox 24, so this method was called datachannel.close(). syntax rtcdatachannel.close(); parameters none. return value undefined. example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); dc.onmessage = function (event) { console.log("received: " + event.data); dc.close(); // we decided to close after the first received message }; dc.onopen = function () { console.log("datachannel open"); }; dc.onclose = function ( console.log("datachannel close"); }; // now negotiate the connection and so forth... specifications ...
RTCDataChannel: close event - Web APIs
erty rtcdatachannel.onclose examples this example sets up a handler for the close event for the rtcdatachannel named dc; its responsibility in this example is to update user interface elements to reflect that there is no longer an ongoing call, and to allow a new call to be started. dc.addeventlistener("close", ev => { messageinputbox.disabled = true; sendbutton.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; }, false); all this code does in response to receiving the close event is to disable an input box and its "send" button, and to enable the button used to start a call (while disabling the one that ends a call). you can also use the onclose event handler property to set a handler for close events: dc.onclose = ev => { messageinputbo...
...d = true; }, false); all this code does in response to receiving the close event is to disable an input box and its "send" button, and to enable the button used to start a call (while disabling the one that ends a call). you can also use the onclose event handler property to set a handler for close events: dc.onclose = ev => { messageinputbox.disabled = true; sendbutton.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'close' in that specification. candidate recommendation initial specification. ...
RTCDataChannel.id - Web APIs
Web › API › RTCDataChannel › id
the read-only rtcdatachannel property id returns an id number (between 0 and 65,534) which uniquely identifies the rtcdatachannel. this id is set at the time the data channel is created, either by the user agent (if rtcdatachannel.negotiated is false) or by the site or app script (if negotiated is true). each rtcpeerconnection can therefore have up to a theoretical maximum of 65,534 data channels on it, although the actual maximum may vary from browser to browser. in early versions of the webrtc specification, this property's name was stream. code that uses that property needs to be updated. syntax var id = adatachannel.id; value an unsigned short value (that is, an integer between 0 and 65,535) which uniquely identifies the data channel. while the label property doesn't have to be u...
...ta channel. while the label property doesn't have to be unique, this id number is guaranteed to be unique among all data channels. additionally, known implementations of webrtc use the same id on both peers. a unique id makes it easier for your code to do its own out-of-band data channel-related signaling. this can be also useful for logging and debugging purposes. example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); console.log("channel id: " + dc.id); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.id' in that specification. candidate recommendation initial specification. ...
RTCDataChannel.label - Web APIs
wish; you could use it to identify all the channels that are being used for the same purpose, by giving them all the same name. or you could give each channel a unique label for tracking purposes. it's entirely up to the design decisions made when building your site or app. a unique id can be found in the id property. ...
...n decisions made when building your site or app. a unique id can be found in the id property. a data channel's label is set when the channel is created by calling rtcpeerconnection.createdatachannel(). it cannot be changed after that. syntax var name = adatachannel.label; value a string identifier assigned by the web site or app when the data channel was created, as specified when rtcpeerconnection.createdatachannel() was called to create the channel. example this sample creates a data channel on an rtcpeerconnection, then, some time later, sets the content of a ui element to display the channel's name. var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); /* ... */ document.getelementbyid("channel-name").innerhtml = "<span class='channelname'>" + ...
RTCDataChannel.onclose - Web APIs
ves as its sole input parameter the event itself, as an object of type event. example in this sample from a hypothetical instant messaging client, a data channel is created, then handlers for the open and close events are set up to enable and disable user interface objects based on the state of the channel. ...
...as an object of type event. example in this sample from a hypothetical instant messaging client, a data channel is created, then handlers for the open and close events are set up to enable and disable user interface objects based on the state of the channel. this way, the message entry field and the send button are only enabled for use when the connection is actually open. let pc = new rtcpeerconnection(); let dc = pc.createdatachannel("messagechannel")}}; dc.onopen = function(event) { document.getelementbyid("messagebox").disabled = false; document.getelementbyid("sendbutton").disabled = false; }; dc.onclose = function(event) { document.getelementbyid("messagebox").disabled = true; document.getelementbyid("sendbutton").disabled = true; } /* now negotiate the connection, etc... */ ...
RTCDataChannel.onmessage - Web APIs
. this event is represented by the messageevent interface. this event is sent to the channel when a message is received from the other peer. syntax rtcdatachannel.onmessage = function; value a function which the browser will call to handle the message event. the function receives as its sole input parameter a messageevent object describing the event. ...
...ssage event. the function receives as its sole input parameter a messageevent object describing the event. example this code snippet creates a peer connection, adds a data channel to it, and starts creating new <p> (paragraph) elements each time a message arrives, with the message's contents displayed inside it. the new elements are then attached to the end of the document. ...
RTCDataChannel.ordered - Web APIs
the read-only rtcdatachannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered. this is set when the rtcdatachannel is created, by setting the ordered property on the rtcdatachannelinit object passed as rtcpeerconnection.createdatachannel()'s options parameter. ...
... indicates that the data channel is indeed ordered. this is set when the rtcdatachannel is created, by setting the ordered property on the rtcdatachannelinit object passed as rtcpeerconnection.createdatachannel()'s options parameter. syntax var ordered = adatachannel.ordered; a boolean value which is true if in-order delivery is guaranteed and is otherwise false. example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); if (!dc.ordered) { // handle unordered messaging } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.ordered' in that specification. candidate recommendation initial specification. ...
RTCDataChannelEvent - Web APIs
the rtcdatachannelevent() constructor returns a new rtcdatachannelevent object, which represents a datachannel event. these events sent to an rtcpeerconnection when its remote peer is asking to open an rtcdatachannel between the two peers. you will rarely if ever construct an rtcdatachannelevent by hand; instead, the webrtc layer will generate and deliver them to you at the appropriate time. just listen for the datachannel event to be received by the rtcpeerconnection and when you receive it, use the rtcdatachannelevent.channel property to gain access to the data channel which has been opened. constructorrtcdatachannelevent() the rtcdatachannelevent() constructor creates a new rtcdatachannelevent.propertiesalso inherits properties from: eventchannel read only the read-only property rtcdat...
...d-only property rtcdatachannelevent.channel returns the rtcdatachannel associated with the event.methodsthis interface has no methods, but inherits methods from: event examples in this example, the datachannel event handler is set up to save the data channel reference and set up handlers for the events which need to be monitored. the channel property provides the rtcdatachannel representing the connection to the other peer. pc.ondatachannel = function(event) { inbounddatachannel = event.channel; inbounddatachannel.onmessage = handleincomingmessage; inbounddatachannel.onopen = handlechannelopen; inbounddatachannel.onclose = handlechannelclose; } see a simple rtcdatachannel sample for another, more complete, example of how to use data channels. specifications specification ...
RTCError - Web APIs
Web › API › RTCError
t. datachannel.addeventlistener("error", (event) => { let error = event.error; if (error.errordetail === "sdp-syntax-error") { let errline = error.sdplinenumber; let errmessage = error.message; let alertmessage = `a syntax error occurred interpreting line ${errline} of the sdp: ${errmessage}`; showmyalertmessage("data channel error", alertmessage); } else { terminatemyconnection(); } }); if the error is an sdp syntax error—indicated by its errordetail property being sdp-syntax-error—, a message string is constructed to present the error message and the line number within the sdp at which the error occurred. this message is then displayed using a function called showmyalertmessage(), which stands in for whatever output mechanism this code might use. any other ...
...r—indicated by its errordetail property being sdp-syntax-error—, a message string is constructed to present the error message and the line number within the sdp at which the error occurred. this message is then displayed using a function called showmyalertmessage(), which stands in for whatever output mechanism this code might use. any other error is treated as terminal, causing a terminatemyconnection() function to be called. the above example uses addeventlistener() to add the handler for error events. you can also use the rtcdatachannel object's onerror event handler property, like this: datachannel.onerror = (event) => { let error = event.error; /* and so forth */ }; specifications specification status comment webrtc 1.0: real-time communication betw...
RTCErrorEvent.error - Web APIs
t. datachannel.addeventlistener("error", (event) => { let error = event.error; if (error.errordetail === "sdp-syntax-error") { let errline = error.sdplinenumber; let errmessage = error.message; let alertmessage = `a syntax error occurred interpreting line ${errline} of the sdp: ${errmessage}`; showmyalertmessage("data channel error", alertmessage); } else { terminatemyconnection(); } }); if the error is an sdp syntax error—indicated by its errordetail property being sdp-syntax-error—, a message string is constructed to present the error message and the line number within the sdp at which the error occurred. this message is then displayed using a function called showmyalertmessage(), which stands in for whatever output mechanism this code might use. any other ...
...r—indicated by its errordetail property being sdp-syntax-error—, a message string is constructed to present the error message and the line number within the sdp at which the error occurred. this message is then displayed using a function called showmyalertmessage(), which stands in for whatever output mechanism this code might use. any other error is treated as terminal, causing a terminatemyconnection() function to be called. the above example uses addeventlistener() to add the handler for error events. you can also use the rtcdatachannel object's onerror event handler property, like this: datachannel.onerror = (event) => { let error = event.error; /* and so forth */ }; specifications specification status comment webrtc 1.0: real-time communication betw...
RTCIceCandidate - Web APIs
the rtcicecandidate interface—part of the webrtc api—represents a candidate internet connectivity establishment (ice) configuration which may be used to establish an rtcpeerconnection. an ice candidate describes the protocols and routing needed for webrtc to be able to communicate with a remote device. when starting a webrtc peer connection, typically a number of candidates are proposed by each end of the connection, until they mutually agree upon one which describes the connection they decide will be best. webrtc then uses that candidate's details to initiate the connection. for details on how the ice process works, see lifetime of a webrtc session. the article webrtc connectivity provides additional useful details. constructor rtcicecandidate() creates an rtcicecandidate object to r...
...dictionary. note: for backward compatibility, the constructor also accepts as input a string containing the value of the candidate property instead of a rtcicecandidateinit object, since the candidate includes all of the information that rtcicecandidateinit does and more. properties candidate read only a domstring representing the transport address for the candidate that can be used for connectivity checks. the format of this address is a candidate-attribute as defined in rfc 5245. this string is empty ("") if the rtcicecandidate is an "end of candidates" indicator. component read only a domstring which indicates whether the candidate is an rtp or an rtcp candidate; its value is either "rtp" or "rtcp", and is derived from the "component-id" field in the candidate a-line string. the ...
RTCIceCandidatePairStats.availableIncomingBitrate - Web APIs
the rtcicecandidatepairstats property availableincomingbitrate returns a value indicative of the available inbound capacity of the network connection represented by the candidate pair. the higher the value, the more bandwidth you can assume is available for incoming data. you can get the incoming outgoing bitrate from availableoutgoingbitrate. syntax availableincomingbitrate = rtcicecandidatepairstats.availableincomingbitrate; value a floating-point value which approximates the amount of available bandwidth for incoming data on the network connection described by the rtcicecandidatepair. ...
...the returned value doesn't take into account overhead introduced by underlying protocols, including ip, udp, or tcp. ...
RTCIceCandidatePairStats.availableOutgoingBitrate - Web APIs
the rtcicecandidatepairstats property availableoutgoingbitrate returns a value indicative of the available outbound capacity of the network connection represented by the candidate pair. the higher the value, the more bandwidth you can assume is available for outgoing data. you can get the incoming available bitrate from availableincomingbitrate. syntax availableoutgoingbitrate = rtcicecandidatepairstats.availableoutgoingbitrate; value a floating-point value which approximates the amount of available bandwidth for outgoing data on the network connection described by the rtcicecandidatepair. the value is reported in bits per second and is computed over a 1-second interval. the returned value is undefined in each of the following situations: the underlying implementation doesn't support co...
...eturned value is undefined in each of the following situations: the underlying implementation doesn't support computing a sender-side estimate of the outgoing bit rate. the rtcicecandidatepair described by this object has never been used. the candidate pair was once in use, but no longer is. the value returned is calculated by adding up the available bit rate for every rtp stream using the connection described by this candidate pair. the returned value doesn't take into account overhead introduced by underlying protocols, including ip, udp, or tcp. note: the returned value is computed using a method similar—but not identical—to the transport independent application specific maximum (tias) described in rfc 3890: 6.2. specifications specification status comment ...
RTCIceCandidatePairStats.currentRoundTripTime - Web APIs
the rtcicecandidatepairstats property currentroundtriptime is a floating-point value indicating the number of seconds it takes for data to be sent by this peer to the remote peer and back over the connection described by this pair of ice candidates. syntax rtt = rtcicecandidatepairstats.currentroundtriptime; value a floating-point value indicating the round-trip time, in seconds for the connection described by the pair of candidates for which this rtcicecandidatepairstats object offers statistics. ...
...a floating-point value indicating the round-trip time, in seconds for the connection described by the pair of candidates for which this rtcicecandidatepairstats object offers statistics. this value is computed by observing the time that elapsed between the most recent stun request being sent to the remote peer and the response to that request arriving. this information may come from ongoing stun connectivity checks as well as from consent requests made when the connection was initially being opened. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.currentroundtriptime' in that specification. candidate recommendation initial specification. ...
RTCIceCandidatePairStats.firstRequestTimestamp - Web APIs
the rtcicecandidatepairstats property firstrequesttimestamp specifies the time at which the first stun request was sent on the described candidate pair. syntax firstrequesttimestamp = rtcicecandidatepairstats.firstrequesttimestamp; value a domhighrestimestamp object indicating the timestamp at which the first stun request was sent on the connection described by the described pair of candidates. ...
... candidate pair. syntax firstrequesttimestamp = rtcicecandidatepairstats.firstrequesttimestamp; value a domhighrestimestamp object indicating the timestamp at which the first stun request was sent on the connection described by the described pair of candidates. you can use this value in combination with lastrequesttimestamp and requestssent to compute the average interval between consecutive connectivity checks: avgcheckinterval = (candidatepairstats.lastrequesttimestamp - candidatepairstats.firstrequesttimestamp) / candidatepairstats.requestssent; specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.firstrequesttimestamp' in that specification. c...
RTCIceCandidatePairStats.lastRequestTimestamp - Web APIs
the rtcicecandidatepairstats property lastrequesttimestamp indicates the time at which the most recent stun request was sent on the described candidate pair. syntax lastrequesttimestamp = rtcicecandidatepairstats.lastrequesttimestamp; value a domhighrestimestamp object indicating the timestamp at which the last (most recent) stun request was sent on the connection indicated by the described pair of candidates. ...
...air. syntax lastrequesttimestamp = rtcicecandidatepairstats.lastrequesttimestamp; value a domhighrestimestamp object indicating the timestamp at which the last (most recent) stun request was sent on the connection indicated by the described pair of candidates. you can use this value in combination with firstrequesttimestamp and requestssent to compute the average interval between consecutive connectivity checks: avgcheckinterval = (candidatepairstats.lastrequesttimestamp - candidatepairstats.firstrequesttimestamp) / candidatepairstats.requestssent; specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.lastrequesttimestamp' in that specification. ca...
RTCIceCandidatePairStats.nominated - Web APIs
the rtcicecandidatepairstats property nominated specifies whether or not the candidate pair described by the underlying rtcicecandidatepair has been nominated to be used as the configuration for the webrtc connection. syntax nominated = rtcicecandidatepairstats.nominated; value a boolean value which is set to true by the ice layer if the controlling user agent has indicated that the candidate pair should be used to configure the webrtc connection between the two peers. note: if more than one candidate pair are nominated at the same time, the one whose priority is higher will be selected for use. once a candidate pair has been nominated and the two peers have each reconfigured themselves to use the specified configuration, the ice negotiation process can potentially end (or it can continu...
... specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.nominated' in that specification. ...
RTCIceCandidatePairStats.readable - Web APIs
the obsolete rtcicecandidatepairstats property readable reports whether or not the connection described by the candidate pair has received at least one valid incoming ice request. syntax isreadable = rtcicecandidatepairstats.readable; value a boolean value which is true if the connection described by this candidate pair has received at least one valid ice request, and is therefore ready to be read from. ...
...as received at least one valid incoming ice request. syntax isreadable = rtcicecandidatepairstats.readable; value a boolean value which is true if the connection described by this candidate pair has received at least one valid ice request, and is therefore ready to be read from. ...
RTCIceCandidateStats - Web APIs
present for local candidates. transportid optional a string uniquely identifiying the transport object that was inspected in order to obtain the rtctransportstats associated with the candidate correspondin to these statistics. url optional for local candidates, the url property is the url of the ice server from which the candidate was received. this url matches the one included in the rtcpeerconnectioniceevent object representing the icecandidate event that delivered the candidate to the local peer. example this example features a function, isusablenetworktype(), whose job it is to look at an rtcicecandidatestats object's networktype and determine whether or not the type of network is acceptable for use. this function is then called for rtcstats objects whose type is local-candidate, ind...
...s with information about a local ice candidate. const isusablenetworktype = stats => { switch(stats.networktype) { case "ethernet": case "vpn": return true; case "bluetooth": case "cellular": case "wimax": case "unknown": default: return false; } } if (rtcstats && rtcstats.type === "local-candidate") { if (!isusablenetworktype(rtcstats)) { abortconnection(); return; } } this code calls a function called abortconnection() if the rtcstats object represents information about a local candidate is which would be using a network connection other than ethernet or a vpn. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatestats' in that specification.
RTCIceRole - Web APIs
values "controlling" the rtcicetransport object is serving as the controlling agent. "controlled" the transport is the controlled agent. ...
... values "controlling" the rtcicetransport object is serving as the controlling agent. "controlled" the transport is the controlled agent. ...
RTCIceServer.credential - Web APIs
the rtciceserver dictionary's credential property is a string providing the credential to use when connecting to the described server. this is typically a password, key, or other secret. this value is used when the rtciceserver describes a turn server. syntax var iceserver = { ... credential = credential, ... }; var credential = iceserver.credential; iceserver.credential = newcredential; example this example creates a new rtcpeerconnection which uses a turn server at turnserver.example.org to negotiate connections. logging into the turn server uses the username "webrtc" and the creative password "turnpassword". ...
... credential = credential, ... }; var credential = iceserver.credential; iceserver.credential = newcredential; example this example creates a new rtcpeerconnection which uses a turn server at turnserver.example.org to negotiate connections. logging into the turn server uses the username "webrtc" and the creative password "turnpassword". mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: "turn:turnserver.example.org", // a turn server username: "webrtc", credential: "turnpassword" } ] }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceserver.credential' in that specification. candidate recommen...
RTCIceServer.url - Web APIs
Web › API › RTCIceServer › url
it was removed from the specification in june 2013 but is still broadly used in older examples and books, so we include documentation here to help adapt old code to new browsers. this property has been removed from the specification; while it's still supported by many browsers, it should no longer be used. you should instead use the newer urls property, which allows you to optionally specify multiple urls for the server. try to update any existing code to use that property instead. ...
...update any existing code to use that property instead. syntax var iceserver = { ... url = iceserverurl, ... }; var serverurl = iceserver.url; iceserver.url = iceserverurl; the value of this property is a domstring containing the full url of a server to use during ice negotiation. example this example creates a new rtcpeerconnection which will use a stun server at stunserver.example.org to negotiate connections. mypeerconnection = new rtcpeerconnection({ iceservers: [ { url: "stun:stunserver.example.org" } ] }); unfortunately, the only way to tell ice that the server has a backup domain name of stunserver2.example.org is to add a new entry to the iceservers array for it. the urls property lets you incl...
RTCIceTransport.getRemoteCandidates() - Web APIs
syntax remotecandidates = rtcicetransport.getremotecandidates(); parameters none. ...
...remote peer during the current ice candidate gathering session. it's important to keep in mind that there's no way to correlate these remote candidates with compatible local candidates. to find the best match found so far, call rtcicetransport.getselectedcandidatepair(). example this simple example gets the remote candidate list from the rtcicetransport for the first rtcrtpsender on the rtcpeerconnection, then outputs to the console all of the candidates in the list. var remotecandidates = pc.getsenders()[0].transport.transport.getremotecandidates(); remotecandidates.foreach(function(candidate, index)) { console.log("candidate " + index + ": " + candidate.candidate); }); specifications specification status comment webrtc 1.0: real-time communication between browse...
RTCIceTransport.getSelectedCandidatePair() - Web APIs
ontaining the current best-choice pair of ice candidates describing the configuration of the endpoints of the transport. syntax candidatepair = rtcicetransport.getselectedcandidatepair(); parameters none. return value a rtcicecandidatepair object describing the configurations of the currently-selected candidate pair's two endpoints. ...
...ne. return value a rtcicecandidatepair object describing the configurations of the currently-selected candidate pair's two endpoints. local describes the configuration of the local end of the connection, while remote describes the remote peer's configuration. the return value is null if no pair of candidates has been selected yet. usage notes as the ice agent performs negotiation of a rtcpeerconnection, it gathers and analyzes candidate configurations from each the two peers. as soon as it finds an acceptable matching pair of candidates, meeting the requirements for the connection, a selectedcandidatepairchange event is fired at the rtcicetransport. from that time forward, the best matching pair of candidates will always be available by calling getselectedcandidatepair(). as ice negotiation...
RTCIceTransport: selectedcandidatepairchange event - Web APIs
a selectedcandidatepairchange event is sent to an rtcicetransport when the ice agent selects a new pair of candidates that describe the endpoints of a viable connection. the pair of candidates is in turn described by an rtcicecandidatepair object which contains one rtcicecandidate representing the local end of the connection, and another representing the remote end of the connection. together, the candidates can be used to establish a connection to be used by the rtcicetransport, and, by extension, by an rtcpeerconnection. bubbles no cancelable no interface event event handler property onselectedcandidatepairchange examples this example creates an event handler for selectedcandidatepairchange that updates a display providing the user info...
...tcicetransport, and, by extension, by an rtcpeerconnection. bubbles no cancelable no interface event event handler property onselectedcandidatepairchange examples this example creates an event handler for selectedcandidatepairchange that updates a display providing the user information about the progress of the ice negotiation for an rtcpeerconnection called pc. let icetransport = pc.getsenders[0].transport.icetransport; let localprotoelem = document.getelementbyid("local-protocol"); let remoteprotoelem = document.getelementbyid("remote-protocol"); icetransport.addeventlistener("selectedcandidatepairchange", ev => { let pair = icetransport.getselectedcandidatepair(); localprotoelem.innertext = pair.local.protocol.touppercase(); remo...
RTCOfferOptions - Web APIs
this is useful if network conditions have changed in a way that make the current configuration untenable or impractical, for instance. ...
...this is useful if network conditions have changed in a way that make the current configuration untenable or impractical, for instance. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcofferoptions' in that specification. candidate recommendation initial definition. ...
RTCRtpContributingSource.source - Web APIs
to change preferences in firefox, visit about:config.ie no support noopera no support nosafari ? webview android full support 59chrome android full support ...
...to change preferences in firefox, visit about:config.opera android no support nosafari ios ? samsung internet android full support 7.0legend full support ...
RTCRtpReceiver.getCapabilities() static function - Web APIs
). syntax let rtpcapabilities = rtcrtpreceiver.getcapabilities(kind); parameters kind a domstring indicating 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 tr...
...capabilities can in whole or in part provide a cross-origin method for identifying a user. for that reason, in privacy-sensitive contexts, the browser may choose to obscure the capabilities; this might be done, for example, by leaving out rarely-used codec configurations. example the function below returns a boolean indicating whether or not the device supports receiving h.264 video on a webrtc connection. since rtcrtpreceiver.getcapabilities() actually only indicates probable support, attempting to receive h.264 video might still fail even after getting a positive response from this function. function canreceiveh264() { let capabilities = rtcrtpreceiver.getcapabilities("video"); capabilities.codecs.foreach((codec) => { if (codec.mimetype === "video/h264") { return true; ...
RTCRtpReceiver.transport - Web APIs
the receiver is exchanging real-time transport control protocol (rtcp) packets. this transport is responsible for receiving the data for the media on the receiver's track. ...
...he 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 case, all of them are using the same connection to transmit and/or receive rtp and rtcp packets. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtc...
RTCRtpSender.transport - Web APIs
ver which the sender is exchanging real-time transport control protocol (rtcp) packets. this transport is responsible for receiving the data for the media on the sender's track. ...
...enting 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, all of them are using the same connection to transmit and/or receive rtp and rtcp packets. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrt...
RTCRtpStreamStats - Web APIs
while the dictionary has a base set of properties that are present in each of these cases, there are also additional properties added depending on which interface the method is called on. rtcrtpstreamstats is the base class for all rtp-related statistics reports. it's based on rtcstats and adds the following additional fields. note: this interface was called rtcrtpstreamstats until a specification update in the spring of 2017. ...
...this rtp stream. obsolete fields mediatype renamed to kind in the specification in february 2018. see browser compatibility in rtcrtpstreamstats.kind to determine when browsers made the transition. local-only measurements these properties are computed locally, and are only available to the device receiving the media stream. their primary purpose is to examine the error resiliency of the connection, as they provide information about lost packets, lost frames, and how heavily compressed the data is. fircount a count of the total number of full intra request (fir) packets received by the sender. this statistic is only available to the device which is receiving the stream and is only available for video tracks. a fir packet is sent by the receiving end of the stream when it falls behind...
RTCRtpTransceiver.setCodecPreferences() - Web APIs
the rtcrtptransceiver method setcodecpreferences() configures the transceiver's codecs given a list of rtcrtpcodeccapability objects specifying the new preferences for each codec. the specified set of codecs and configurations will be used for all future connections including this transceiver until this method is called again. when preparing to open an rtcpeerconnection, you can change the codec parameters from the user agent's default configuration by calling setcodecparameters() before calling either rtcpeerconnection.createoffer() or createanswer(). a guide to codecs supported by webrtc—and each codec's positive and negative characteristics—can be found in codecs used by webrtc. syntax rtcrtptransceiver.setcodecpreferences(codecs) parameters codecs an array of rtcrtpcodeccapabi...
...ansceiver.setcodecpreferences(codecs) parameters codecs an array of rtcrtpcodeccapability objects, in order of preference, each providing the parameters for one of the transceiver's supported codecs. if codecs is empty, the codec configurations are all returned to the user agent's defaults. note: any codecs not included in codecs will not be considered during the process of negotiating a connection. this lets you prevent the use of codecs you don't wish to use. return value undefined exceptions invalidaccesserror the codecs list includes one or more codecs which are not supported by the transceiver. usage notes getting a list of supported codecs you can only include in the codecs list codecs which the transceiver actually supports. that means that either the associated rtcr...
RTCRtpTransceiver.stop() - Web APIs
the stop() method in the rtcrtptransceiver interface permanently stops the transceiver by stopping both the associated rtcrtpsender and rtcrtpreceiver. note: until recently, the stopped property was provided to return true if the connection is stopped. that property has been deprecated and will be removed at some point. instead, check the value of currentdirection. if it's stopped, the transceiver has been stopped. this method does nothing if the transceiver is already stopped. syntax rtcrtptransceiver.stop() paramters none. return value undefined exceptions invalidstateerror the rtcpeerconnection of which the transceiver is a member is closed. usage notes when you call stop() on a transceiver, the sender immediately stops sending media and each of its rtp streams are closed us...
...is a member is closed. usage notes when you call stop() on a transceiver, the sender immediately stops sending media and each of its rtp streams are closed using the rtcp "bye" message. the receiver then stops receiving media; the receiver's track is stopped, and the transceiver's direction is changed to stopped, and renegotiation is triggered by sending a negotiationneeded event to the rtcpeerconnection. the negotiation process causes currentnegotiation to be set to stopped, finally indicating that the transceiver has been fully stopped. note: stopping the transceiver causes a negotiationneeded event to be sent to the transceiver's rtcpeerconnection, so the connection can adapt to the change. specifications specification status comment webrtc 1.0: real-time commu...
RTCSessionDescription() - Web APIs
the rtcsessiondescription() constructor creates a new rtcsessiondescription with its properties initialized as described in the specified object. this constructor has been deprecated because rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself. syntax sessiondescription = new rtcsessiondescription(rtcsessiondescriptioninit); values rtcsessiondescriptioninit optional an object providing the default values for the session description; the object conforms to the rtcsessiondescriptioninit dictionary. that dictionary has the following properties: type required. a string which is a member of the rtcsdpt...
...s special type with an empty session description is used to roll back to the previous stable state. sdp a string containing a sdp message describing the session. this value is an empty string ("") by default and may not be null. example this example uses the constructor to convert an sdp offer into an rtcsessiondescription object. this is no longer necessary, however; rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself. navigator.getusermedia({video: true}, function(stream) { pc.onaddstream({stream: stream}); // adding a local stream won't trigger the onaddstream callback pc.addstream(st...
RTCTrackEvent() - Web APIs
the rtctrackevent() constructor creates and returns a new rtctrackevent object, configured to describe the track which has been added to the rtcpeerconnection. in general, you won't need to use this constructor, as rtctrackevent objects are created by webrtc and delivered to your rtcpeerconnector's ontrack event handler as appropriate. syntax trackevent = new rtctrackevent(eventinfo); parameters eventinfo an object based on the rtctrackeventinit dictionary, providing information about the track which has been added to the rtcpeerconnection. this object has the following properties: receiver the rtcrtpreceiver which is being used to receive the track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding trac...
...eiver which is being used to receive the track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding track. track the mediastreamtrack the event is associated with. transceiver the rtcrtptransceiver associated with the event. return value a new rtctrackevent describing a track which has been added to the rtcpeerconnection. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtctrackevent()' in that specification. candidate recommendation initial specification. ...
Using the Screen Capture API - Web APIs
ed when the "start capture" button is clicked. async function startcapture() { logelem.innerhtml = ""; try { videoelem.srcobject = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); dumpoptionsinfo(); } catch(err) { console.error("error: " + err); } } after clearing the contents of the log in order to get rid of any leftover text from the previous attempt to connect, startcapture() calls getdisplaymedia(), passing into it the constraints object defined by displaymediaoptions. using await, the following line of code does not get executed until after the promise returned by getdisplaymedia() resolves. upon resolution, the promise returns a mediastream, which will stream the contents of the screen, window, or other region selected by the user. the stream is co...
...essage to the log box. stopping display capture the stopcapture() method is called when the "stop capture" button is clicked. it stops the stream by getting its track list using mediastream.gettracks(), then calling each track's {domxref("mediastreamtrack.stop, "stop()")}} method. once that's done, srcobject is set to null to make sure it's understood by anyone interested that there's no stream connected. function stopcapture(evt) { let tracks = videoelem.srcobject.gettracks(); tracks.foreach(track => track.stop()); videoelem.srcobject = null; } dumping configuration information for informational purposes, the startcapture() method shown above calls a method named dumpoptions(), which outputs the current track settings as well as the constraints that were placed upon the stream when i...
Sensor APIs - Web APIs
ed to as low-level and high-level respectively. the latter type of sensor is also called a fusion sensor (alternatively, virtual or synthetic sensors). feature detection sensor interfaces are only proxies for the underlying device sensors. consequently, feature detection is more complicated for sensors than it is for other apis. the presence of a sensor api does not tell you whether that api is connected to a real hardware sensor, whether that sensor works, if it's still connected, or even whether the user has granted access to it. making all this information consistently available is costly to performance and battery life. therefore, feature detection for sensor apis must include both detection of the apis themselves and defensive programming strategies (see below). the examples below show t...
.... let accelerometer = null; try { accelerometer = new accelerometer({ referenceframe: 'device' }); accelerometer.addeventlistener('error', event => { // handle runtime errors. if (event.error.name === 'notallowederror') { // branch to code for requesting permission. } else if (event.error.name === 'notreadableerror' ) { console.log('cannot connect to the sensor.'); } }); accelerometer.addeventlistener('reading', () => reloadonshake(accelerometer)); accelerometer.start(); } catch (error) { // handle construction errors. if (error.name === 'securityerror') { // see the note above about feature policy. console.log('sensor construction was blocked by a feature policy.'); } else if (error.name ===...
Using Service Workers - Web APIs
etting started with service workers, including basic architecture, registering a service worker, the install and activation process for a new service worker, updating your service worker, cache control and custom responses, all in the context of a simple app with offline functionality. the premise of service workers one overriding problem that web users have suffered with for years is loss of connectivity. the best web app in the world will provide a terrible user experience if you can’t download it. there have been various attempts to create technologies to solve this problem, and some of the issues have been solved. but the overriding problem is that there still isn’t a good overall control mechanism for asset caching and custom network requests. the previous attempt — appcache —...
...return caches.delete(key); } })); }) ); }); developer tools chrome has chrome://inspect/#service-workers, which shows current service worker activity and storage on a device, and chrome://serviceworker-internals, which shows more detail and allows you to start/stop/debug the worker process. in the future they will have throttling/offline modes to simulate bad or non-existent connections, which will be a really good thing. firefox has also started to implement some useful tools related to service workers: you can navigate to about:debugging to see what sws are registered and update/remove them. when testing you can get around the https restriction by checking the "enable service workers over http (when toolbox is open)" option in the firefox developer tools settings. th...
SharedWorkerGlobalScope - Web APIs
the performance object associated with the worker, which is a regular performance object, but with a subset of its properties and methods available. event handlers this interface inherits event handlers from the workerglobalscope interface, and its parent eventtarget, and therefore implements event handlers from windowtimers, windowbase64, and windoweventhandlers. sharedworkerglobalscope.onconnect is an eventhandler representing the code to be called when the connect event is raised — that is, when a messageport connection is opened between the associated sharedworker and the main thread. methods this interface inherits methods from the workerglobalscope interface, and its parent eventtarget, and therefore implements methods from windowtimers, windowbase64, and windoweventhandlers. ...
...al(). windowtimers.cleartimeout() cancels the repeated execution set using windowtimers.settimeout(). windowtimers.setinterval() schedules the execution of a function every x milliseconds. windowtimers.settimeout() sets a delay for executing a function. events listen to this event using addeventlistener() or by assigning an event listener to the oneventname property of this interface. connect fired on shared workers when a new client connects. also available via the onconnect property. specifications specification status comment html living standardthe definition of 'sharedworkerglobalscope' in that specification. living standard ...
SpeechRecognition: end event - Web APIs
the end event of the web speech api speechrecognition object is fired when the speech recognition service has disconnected. ...
...gnition service has disconnected. bubbles no cancelable no interface event event handler property onend examples you can use the end event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('end', function() { console.log('speech recognition service disconnected'); }); or use the onend event handler property: recognition.onend = function() { console.log('speech recognition service disconnected'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification. draft ...
USB - Web APIs
Web › API › USB
methods usb.getdevices() returns a promise that resolves with an array of usbdevice objects for paired attached devices. usb.requestdevice() returns a promise that resolves with an instance of usbdevice if the specified device is found. calling this function triggers the user agent's pairing flow. ...
... methods usb.getdevices() returns a promise that resolves with an array of usbdevice objects for paired attached devices. usb.requestdevice() returns a promise that resolves with an instance of usbdevice if the specified device is found. calling this function triggers the user agent's pairing flow. ...
WebGL constants - Web APIs
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 passed to drawelements or drawarrays to draw a connected group of line segments from the first vertex to the last. triangles 0x0004 passed to drawelements or drawarrays to draw tria...
... separate line segment. line_strip 0x0003 passed to drawelements or drawarrays to draw a connected group of line segments from the first vertex to the last. triangles 0x0004 passed to drawelements or drawarrays to draw triangles. each set of three vertices creates a separate triangle. triangle_strip 0x0005 passed to drawelements or drawarrays to draw a connected group of triangles. triangle_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). ...
WebSocket: close event - Web APIs
the close event is fired when a connection with a websocket is closed. bubbles no cancelable no interface closeevent event handler property onclose examples you might want to know when the connection has been closed so that you can update the ui or, perhaps, save data about the closed connection. given that you have a variable called examplesocket that refers to an opened websocket, this handler would handle the situation where the socket has been closed. ...
...nclose examples you might want to know when the connection has been closed so that you can update the ui or, perhaps, save data about the closed connection. given that you have a variable called examplesocket that refers to an opened websocket, this handler would handle the situation where the socket has been closed. examplesocket.addeventlistener('close', (event) => { console.log('the connection has been closed successfully.'); )}; you can perform the same actions using the event handler property, like this: examplesocket.onclose = function (event) { console.log('the connection has been closed successfully.'); }; specifications specification status html living standardthe definition of 'websocket close' in that specification. living standard ...
WebSocket.onopen - Web APIs
Web › API › WebSocket › onopen
it is called with an event. syntax awebsocket.onopen = function(event) { console.log("websocket is open now."); }; value an eventlistener. ...
...it is called with an event. syntax awebsocket.onopen = function(event) { console.log("websocket is open now."); }; value an eventlistener. ...
WebSocket.send() - Web APIs
Web › API › WebSocket › send
if the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. syntax websocket.send("hello server!"); parameters data the data to send to the server. it may be one of the following types: usvstring a text string. the string is added to the buffer in utf-8 format, and the value of bufferedamount is increased by the number of bytes required to represent the utf-8 string. ...
...queues the blob's raw data to be transmitted in a binary frame. the value of bufferedamount is increased by the byte size of that raw data. arraybufferview you can send any javascript typed array object as a binary frame; its binary data contents are queued in the buffer, increasing the value of bufferedamount by the requisite number of bytes. exceptions thrown invalid_state_err the connection is not currently open. syntax_err the data is a string that has unpaired surrogates. note: gecko's implementation of the send() method differs somewhat from the specification in gecko 6.0; gecko returns a boolean indicating whether or not the connection is still open (and, by extension, that the data was successfully queued or transmitted); this is corrected in gecko 8.0. as of gecko 11.
Fundamentals of WebXR - Web APIs
hardware the simplest xr presentation involves rendering the scene directly to the user's screen, either in the context of a web document, or in full screen mode. this is most common when the user either doesn't have a dedicated xr device, or when the user is viewing the ar or vr app on a phone or other handheld device. simpler and lower-priced xr devices typically use an integrated computer or connect to a smartphone, essentially using the mobile cpu and gpu to run apps, render images, and display them to the user. higher-powered solutions typically offload application execution and graphics processing to an external device such as a desktop computer, and are either tethered to the computer using a cable or use a wireless network to receive the imagery to display to the user. headsets most i...
... other inexpensive materials. these devices often work by snapping your phone into the headset so that its screen and onboard graphics processor can be used to render and display the xr scene. more advanced headsets have integrated displays and are strapped to the head using an elastic or strap or a strap with velcro closure. these headsets may include integrated speakers and microphone, and/or connectors to attach external ones. additionally, these headsets may have various sensors for detecting when the headset moves through space. the types and number of sensors included will determine how many degrees of freedom the user has. goggles and glasses xr goggles are similar to headsets in that they involve the placing of graphics display surfaces in front of the eyes in order to render the view...
Inputs and input sources - Web APIs
tracked for manipulating ui elements, or will both? to manage input sources, then, you need to be able to enumerate input sources, examine profile information about each input source, and decide how to use each input controller. enumerating input sources the webxr session represented by the xrsession object has an inputsources property which is a live list of the webxr input devices currently connected to the xr system. let inputsourcelist = xrsession.inputsources; due to the fact that the contents of the xrinputsource objects representing each input source in the list are read-only, changes to these inputs are made by the webxr system by deleting the source's record and adding a new one to replace it. an inputsourceschange event is sent to your xrsession whenever one or more of the input s...
...icating that the user has performed the activity that begins the primary action. this may be a gesture, depressing a button, or the like. if the primary action ends successfully (for example, due to the user releasing the button or trigger), rather than because of an error, the select event is sent. after the select event is sent or if the controller on which the action is being performed is disconnected or otherwise becomes unavailable, the selectend event is sent. generally speaking, the selectstart and selectend events tell you when you might want to display something to the user indicating that the primary action is going on. this might be drawing a controller with the activated button in a new color, or showing the targeted object being grabbed and moved around, starting when selectstart...
Rendering and the WebXR frame animation callback - Web APIs
tual environment, you need to establish a webxr session by creating an xrsession using the navigator.xr.requestsession() method; you also need to associate the session with a framebuffer and perform other setup tasks. these setup tasks are described in the article setting up and shutting down a webxr session. preparing the renderer once the xr session has been set up, with the webgl framebuffer connected and webgl primed with the data it needs in order to render the scene, you can set up the renderer to start running. this begins with getting the reference space in which you want to draw, with its origin and orientation set at the viewer's starting position and viewing direction. once that's in hand, you request that the browser call your rendering function the next time it needs a framebuffer ...
... methods by which users might provide input while using a webxr application. first, webxr supports directly handling inputs from the controllers which are integrated with the xr hardware itself. these input sources may include devices such as hand controllers, optical tracking systems, acclerometers and magnetometers, and other devices of that nature. the second type of input is a gamepad that's connected through the xr system. this uses interfaces inherited from the gamepad api but you interact with them through webxr. the third and final type of input is the traditional non-xr input device such as keyboards, mice, trackpads, touch screens, and non-xr gamepads and joysticks. orientation and position information that can be collected from the xr hardware directly is applied automatically. thus...
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
is data is obtained during each frame by calling the xrframe method getviewerpose() to get the position and facing direction of the viewer (defining what the user should see), and getpose() to get any other poses, such as the positions of the hand controllers and any other parts of the xr system. detecting and functioning after tracking loss if tracking fails, such as due to a temporary loss of connectivity between the headset and the user's device, the xr layer will continue to return poses, but those poses' emulatedposition property will be true, indicating that the computation of the pose is based on a guess of the current position of the user. some xr hardware uses algorithms to compute the estimated position of the user based on the movement currently ongoing, while other hardware will re...
... section probably has problems still; corrections are appreciated --->>> when a discontinuity or break in the native or effective origin of a reference space occurs, the user agent will send the xrreferencespace a reset event. this event indicates that a significant change to the origin's position has taken place relative to the user's environment. a reset may occur because the xr hardware lost connectivity for a time, resulting in the user's movements not being properly tracked for a while. upon recovery of tracking, a reset means tracking has been restored and the new position information represents the actual position information provided by the xr hardware, rather than cached or "best-guess" data. another reason reset may be sent is because the user has exited the bounds of a reference spa...
Using IIR filters - Web APIs
, feedback); we need a sound source to play. we set this up using a custom function, playsoundnode(), which creates a buffer source from an existing audiobuffer, attaches it to the default destination, starts it playing, and returns it: function playsourcenode(audiocontext, audiobuffer) { const soundsource = audiocontext.createbuffersource(); soundsource.buffer = audiobuffer; soundsource.connect(audiocontext.destination); soundsource.start(); return soundsource; } this function is called when the play button is pressed. the play button html looks like this: <button class="button-play" role="switch" data-playing="false" aria-pressed="false">play</button> and the click event listener starts like so: playbutton.addeventlistener('click', function() { if (this.dataset.playing === ...
...function() { if (this.dataset.playing === 'false') { srcnode = playsourcenode(audioctx, sample); ... }, false); the toggle that turns the iir filter on and off is set up in the similar way. first, the html: <button class="button-filter" role="switch" data-filteron="false" aria-pressed="false" aria-describedby="label" disabled></button> the filter button's click handler then connects the iirfilter up to the graph, between the source and the detination: filterbutton.addeventlistener('click', function() { if (this.dataset.filteron === 'false') { srcnode.disconnect(audioctx.destination); srcnode.connect(iirfilter).connect(audioctx.destination); ... }, false); frequency response we only have one method available on iirfilternode instances, getfrequ...
Web Audio API - Web APIs
x or modify these streams of sound samples into different streams. a common modification is multiplying the samples by a value to make them louder or quieter (as is the case with gainnode). once the sound has been sufficiently processed for the intended effect, it can be linked to the input of a destination (audiocontext.destination), which sends the sound to the speakers or headphones. ...
... timing is controlled with high precision and low latency, allowing developers to write code that responds accurately to events and is able to target specific samples, even at a high sample rate. so applications such as drum machines and sequencers are well within reach. ...
Functions and classes available to Web Workers - Web APIs
vas element. manipulating such data can be a complex task better suited to be delegated to a web worker. 25 (25) no support no support no support indexeddb database to store records holding simple values and hierarchical objects. 37 (37), 42 (42) for idbcursorwithvalue. 10.0 (yes) 10.1 network information api provides information about the system's connection in terms of general connection type (e.g., 'wifi', 'cellular', etc.). 53.0 (53) only on mobile (yes) only on mobile no support no support notifications allows web pages to control the display of system notifications to the end user 41 (41) ? ? ? performance the performance interface represents timing-related performance information for the given ...
...erformanceresourcetiming enables retrieval and analysis of detailed data regarding various aspects of an application's network performance. (yes) (yes) (yes) (yes) promise javascript objects that allow you to write asynchronous functions. 28 (28) (yes) (yes) (yes) server-sent events allows a server to push data to a web page at any point, after a connection has been opened to it. 53 (53) (currently only available in dedicated and shared workers; not service workers.) ? (yes) ? serviceworkerregistration you can register a service worker from inside a standard worker, and use associated functionality. 40 (40) no support (yes) no support textencoder and textdecoder create and return a new textencoder, ...
XRInputSourceEvent() - Web APIs
to the new event's properties. return value a new xrinputsourceevent object representing the event described by the given type and eventinitdict. event types select sent to an xrsession when the sending input source has fully completed a primary action. selectend sent to an xrsession when an ongoing primary action ends, or when an input source with an ongoing primary action has been disconnected from the system. selectstart sent to an xrsession when an input source begins its primary action, indicating that the user has begun a command-like input, such as pressing a trigger or button, issuing a spoken command, tapping on a touchpad, or the like. squeeze sent to an xrsession when the sending input source has fully completed a primary squeeze action. squeezeend sent to an xrsession...
...that the user has begun a command-like input, such as pressing a trigger or button, issuing a spoken command, tapping on a touchpad, or the like. squeeze sent to an xrsession when the sending input source has fully completed a primary squeeze action. squeezeend sent to an xrsession when an ongoing primary squeeze action ends or when an input source with an ongoing primary squeeze action is disconnected. squeezestart sent to an xrsession when an input source begins its primary squeeze action, indicating that the user has begun to grab, squeeze, or grip the controller. examples the code below sets up handlers for primary action events in order to determine when the user clicks on (shoots at/pokes at/whatever) objects in the scene. xrsession.addeventlistener("select", event => { let targ...
XRInputSourceEvent - Web APIs
ent. methods the xrinputsourceevent interface doesn't define any methods; however, several methods are inherited from the parent interface, event. event types select sent to an xrsession when the sending input source has fully completed a primary action. selectend sent to an xrsession when an ongoing primary action ends, or when an input source with an ongoing primary action has been disconnected from the system. selectstart sent to an xrsession when an input source begins its primary action, indicating that the user has begun a command-like input, such as pressing a trigger or button, issuing a spoken command, tapping on a touchpad, or the like. squeeze sent to an xrsession when the sending input source has fully completed a primary squeeze action. squeezeend sent to an xrsession...
...that the user has begun a command-like input, such as pressing a trigger or button, issuing a spoken command, tapping on a touchpad, or the like. squeeze sent to an xrsession when the sending input source has fully completed a primary squeeze action. squeezeend sent to an xrsession when an ongoing primary squeeze action ends or when an input source with an ongoing primary squeeze action is disconnected. squeezestart sent to an xrsession when an input source begins its primary squeeze action, indicating that the user has begun to grab, squeeze, or grip the controller. examples the code below sets up handlers for primary action events in order to determine when the user clicks on (shoots at/pokes at/whatever) objects in the scene. xrsession.addeventlistener("select", event => { let targ...
XRSystem: devicechange event - Web APIs
it's a generic event with no added properties. note: not to be confused with the mediadevices devicechange event. ...
...it's a generic event with no added properties. note: not to be confused with the mediadevices devicechange event. ...
Web APIs
Web › API
tallevent installtrigger intersectionobserver intersectionobserverentry interventionreportbody k keyboard keyboardevent keyboardlayoutmap keyframeeffect keyframeeffectoptions l largestcontentfulpaint layoutshift layoutshiftattribution linearaccelerationsensor linkstyle localfilesystem localfilesystemsync localmediastream location lock lockmanager lockedfile m midiaccess midiconnectionevent midiinput midiinputmap midimessageevent midioutputmap mscandidatewindowhide mscandidatewindowshow mscandidatewindowupdate msgestureevent msgraphicstrust msmanipulationevent msrangecollection mssitemodeevent magnetometer mathmlelement mediacapabilities mediacapabilitiesinfo mediaconfiguration mediadecodingconfiguration mediadeviceinfo mediadevices mediaelementaudiosourcenode me...
...rstats rtcicecandidatestats rtcicecandidatetype rtcicecomponent rtcicecredentialtype rtcicegathererstate rtciceparameters rtciceprotocol rtcicerole rtciceserver rtcicetcpcandidatetype rtcicetransport rtcicetransportstate rtcidentityassertion rtcidentityerrorevent rtcidentityevent rtcinboundrtpstreamstats rtcnetworktype rtcofferansweroptions rtcofferoptions rtcoutboundrtpstreamstats rtcpeerconnection rtcpeerconnectioniceerrorevent rtcpeerconnectioniceevent rtcremoteoutboundrtpstreamstats rtcrtcpparameters rtcrtpcapabilities rtcrtpcodeccapability rtcrtpcodecparameters rtcrtpcontributingsource rtcrtpencodingparameters rtcrtpparameters rtcrtpreceiveparameters rtcrtpreceiver rtcrtpsendparameters rtcrtpsender rtcrtpstreamstats rtcrtpsynchronizationsource rtcrtptransceiver rtcrtptransceiverdir...
ARIA: tab role - Accessibility
ent is part of a group of related elements. some assistive technology will provide a count of the number of tab role elements inside a tablist, and inform users of which tab they currently have targeted. they should contain the aria-controls property identifying an element with the tabpanel role. when an element with the tabpanel role has focus, or a child of it has focus, that indicates that the connected element with the tab role is the active tab in a tablist. when working with elements with the tab role, when they are selected or active, they should have their aria-selected attribute set to true, otherwise it should be set to false. when a tab is selected or active, its controlled tabpanel should have its aria-expanded and hidden attributes set to true, otherwise they should be set to false.
...irst tab has tabindex=0 on it, which we will later change to whatever tab has aria-selected=true. all of the tabpanel elements have tabindex=0 to make them tabbable, and all but the currently active one have the hidden attribute, which we will change with javascript. there is some basic styling applied that restyles the buttons and changes the z-index to of tab elements to give the illusion of it connecting to the tabpanel for active elements, and the illusion that inactive elements are behind the active tabpanel. <div class="tabs"> <div role="tablist" aria-label="sample tabs"> <button role="tab" aria-selected="true" aria-controls="panel-1" id="tab-1" tabindex="0"> first tab </button> <button role="tab" aria-selected="false" aria-controls="panel-2" id="tab-2" tabindex...
Ordering Flex Items - CSS: Cascading Style Sheets
it does not change the sequential navigation order of the items. therefore if a user is tabbing between the items, they could find themselves jumping around your layout in a very confusing way. by tabbing around any of the live examples on this page, you can see how order is potentially creating a strange experience for anyone not using a pointing device of some kind. ...
...ry confusing way. by tabbing around any of the live examples on this page, you can see how order is potentially creating a strange experience for anyone not using a pointing device of some kind. to read more about this disconnect of visual order and logical order and some of the potential problems it raises for accessibility, see the following resources. flexbox and the keyboard navigation disconnect html source order vs css display order the responsive order conflict for keyboard focus use cases for order there are sometimes places where the fact that the logical and therefore reading order of flex items is separate from the visual order, is helpful. used carefully the order property can allow for some useful common patterns to be easily implemented. you might have a design, perhaps a ...
flex-direction - CSS: Cascading Style Sheets
ts are permuted. column the flex container's main-axis is the same as the block-axis. the main-start and main-end points are the same as the before and after points of the writing-mode. column-reverse behaves the same as column but the main-start and main-end are permuted. ...
... row-reverse or column-reverse will create a disconnect between the visual presentation of content and dom order. this will adversely affect users experiencing low vision navigating with the aid of assistive technology such as a screen reader. if the visual (css) order is important, then screen reader users will not have access to the correct reading order. ...
order - CSS: Cascading Style Sheets
Web › CSS › order
ues */ order: 5; order: -5; /* global values */ order: inherit; order: initial; order: unset; since order is only meant to affect the visual order of elements and not their logical or tab order. order must not be used on non-visual media such as speech. values <integer> represents the ordinal group to be used by the item. ...
...erns using the order property will create a disconnect between the visual presentation of content and dom order. this will adversely affect users experiencing low vision navigating with the aid of assistive technology such as a screen reader. if the visual (css) order is important, then screen reader users will not have access to the correct reading order. ...
Cross-browser audio basics - Developer guides
fore the play button is pressed. metadata: download the audio metadata; this is usually the best option, as it allows you to access and display information such as audio length, and allow the browser to work out which audio file it should use. auto: download the whole audio file as soon as possible. this is generally not a good option unless you can guarantee your users will have a fast network connection. note: this value is often ignored on mobile platforms. <audio preload="auto"> ... </audio> controls we specify the controls attribute when we require the browser to provide us with its default playback controls. <audio controls> ... </audio> src as mentioned above, you can use the <source> element to specify one or more source audio files. alternatively, you can include the src ...
...ry simple audio player, but what if we want to show progress, buffering and only activate the buttons when the media is ready to play? fortunately, there are a number of events we can use to let our player know exactly what is happening. first, let's take a look at the media loading process in order: loadstart the loadstart event tells us simply that load process has started and the browser is connecting to the media. myaudio.addeventlistener("loadstart", function() { //grabbing the file }); durationchange if you just want to know as soon as the duration of your media is established, this is the event for you. this can be useful because the initial value for duration is nan (not a number), which you probably don't want to display to your users. myaudio.addeventlistener("durationchange", ...
Audio and Video Delivery - Developer guides
find more about web audio api basics in using the web audio api. getusermedia / stream api ...
... retrieve a live stream from a webcam and/or microphone using getusermedia and the stream api. this makes up part of a wider technology known as webrtc (web real-time communications) and is compatible with the latest versions of chrome, firefox and opera. ...
HTML attribute: rel - HTML: Hypertext Markup Language
Web › HTML › Attributes › rel
uxiliary browsing context if the hyperlink would otherwise create a top-level browsing context that is not anauxiliary browsing context (i.e., has "_blank" as target attribute value). not allowed annotation annotation pingback gives the address of the pingback server that handles pingbacks to the current document. external resource not allowed not allowed preconnect specifies that the user agent should preemptively connect to the target resource's origin. external resource not allowed not allowed prefetch specifies that the user agent should preemptively fetch and cache the target resource as it is likely to be required for a followup navigation. external resource not allowed not allowed preload specifies that the...
...vel browsing context, as if noopener were also set. opener creates an auxiliary browsing context if the hyperlink would otherwise create a top-level browsing context that is not anauxiliary browsing context (i.e., has "_blank" as target attribute value). effectively, the opposite of noopener. pingback gives the address of the pingback server that handles pingbacks to the current document. preconnect specifies that the user agent should preemptively connect to the target resource's origin. prefetch specifies that the user agent should preemptively fetch and cache the target resource as it is likely to be required for a followup navigation. preload specifies that the user agent must preemptively fetch and cache the target resource for current navigation according to the potential destinat...
Link types - HTML: Hypertext Markup Language
, <area>, <form> <link> pingback defines an external resource uri to call if one wishes to make a comment or a citation about the webpage. the protocol used to make such a call is defined in the pingback 1.0 specification. note: if the x-pingback: http header is also present, it supersedes the <link> element with this link type. <link> <a>, <area>, <form> preconnect provides a hint to the browser suggesting that it open a connection to the linked web site in advance, without disclosing any private information or downloading any content, so that when the link is followed the linked content can be fetched more quickly. <link> <a>, <area>, <form> prefetch suggests that the browser fetch the linked resource in advance, as it is likely to b...
... of that structure. the number of up link types indicates the depth difference between the current page and the linked resource. <a>, <area>, <link> <form> specifications specification status comment preloadthe definition of 'preload' in that specification. candidate recommendation added preload. resource hintsthe definition of 'preconnect' in that specification. working draft added dns-prefetch, preconnect, and prerender values. html living standardthe definition of 'link types' in that specification. living standard added opener and made noopener the default behavior for target="_blank" links. html5the definition of 'link types' in that specification. recommendation added tag, search, prefetch,...
HTML: Hypertext Markup Language
Web › HTML
links are a fundamental aspect of the web. ...
...oad, before the browser's main rendering machinery kicks in. this ensures that they are made available earlier and are less likely to block the page's first render, leading to performance improvements. this article provides a basic guide to how preload works. references html reference html consists of elements, each of which may be modified by some number of attributes. html documents are connected to each other with links. html element reference browse a list of all html elements. html attribute reference elements in html have attributes. these are additional values that configure the elements or adjust their behavior in various ways. global attributes global attributes may be specified on all html elements, even those not specified in the standard. this means that any non-standard...
Basics of HTTP - HTTP
es how web resources are referenced and how to locate them. data uris a specific kind of uri that directly embeds the resource it represents. data uris are very convenient, but have some caveats. resource urls resource urls, those prefixed with the resource scheme are used by firefox and firefox browser extensions to load resources internally, but is also available to some sites the browser connects to as well. separating identity and location of a resource: the alt-svc http header most of the time the identity and location of a web resource are shared, this can be changed with the alt-svc header. mime types since http/1.0, different types of content can be transmitted. this article explains how this is accomplished using the content-type header and the mime standard. choosing between ...
...in your browser. http messages http messages transmitted during requests or responses have a very clear structure. this introductory article describes this structure, its purpose, and its possibilities. frame and message structure in http/2 http/2 encapsulates and represents http/1.x messages in a binary frame. this article explains the frame structure, its purpose, and the way it's encoded. connection management in http/1.x http/1.1 was the first version of http to support persistent connection and pipelining. this article explains both concepts. connection management in http/2 http/2 completely revisited how connections are created and maintained. this article explains how http frames allow multiplexing and solve the 'head-of-line' blocking problem of former http versions. content nego...
Compression in HTTP - HTTP
h browsers and servers have it implemented already, but they have to be sure that the server is configured adequately. compression happens at three different levels: first some file formats are compressed with specific optimized methods, then general encryption can happen at the http level (the resource is transmitted compressed from end to end), and finally compression can be defined at the connection level, between two nodes of an http connection. file format compression each data type has some redundancy, that is wasted space, in it. if text can typically have as much as 60% redundancy, this rate can be much higher for some other media like audio and video. unlike text, these other media types use lot of space to store their data and the need to optimize storage and regain space was ap...
...p_module; for iis, the <httpcompression> element. hop-by-hop compression hop-by-hop compression, though similar to end-to-end compression, differs by one fundamental element: the compression doesn't happen on the resource in the server, creating a specific representation that is then transmitted, but on the body of the message between any two nodes on the path between the client and the server. connections between successive intermediate nodes may apply a different compression. to do this, http uses a mechanism similar to the content negotiation for end-to-end compression: the node transmitting the request advertizes its will using the te header and the other node chooses the adequate method, applies it, and indicates its choice with the transfer-encoding header. in practice, hop-by-hop c...
CSP: default-src - HTTP
the http content-security-policy (csp) default-src directive serves as a fallback for the other csp fetch directives. ...
...see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples no inheritance with default-src if there are other directives specified, default-src does not influence them. ...
Expect-CT - HTTP
rtificate_timestamp sent during the handshake supporting ocsp stapling (that is, the status_request tls extension) and providing a signedcertificatetimestamplist when a site enables the expect-ct header, they are requesting that the browser check that any certificate for that site appears in public ct logs. browsers ignore the expect-ct header over http; the header only has effect on https connections. the expect-ct will likely become obsolete in june 2021. since may 2018 new certificates are expected to support scts by default. certificates before march 2018 were allowed to have a lifetime of 39 months, those will all be expired in june 2021. header type response header forbidden header name yes syntax expect-ct: report-uri="<uri>", enforce,...
...o as an "enforce-and-report" configuration, signalling to the user agent both that compliance to the certificate transparency policy should be enforced and that violations should be reported. enforce optional signals to the user agent that compliance with the certificate transparency policy should be enforced (rather than only reporting compliance) and that the user agent should refuse future connections that violate its certificate transparency policy. when both the enforce directive and the report-uri directive are present, the configuration is referred to as an "enforce-and-report" configuration, signalling to the user agent both that compliance to the certificate transparency policy should be enforced and that violations should be reported. example the following example specifies e...
OPTIONS - HTTP
Web › HTTP › Methods › OPTIONS
request is sent, it will have a post request method. the access-control-request-headers header tells the server that when the actual request is sent, it will have the x-pingother and content-type headers. options /resources/post-here/ http/1.1 host: bar.example accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip,deflate connection: keep-alive origin: https://foo.example access-control-request-method: post access-control-request-headers: x-pingother, content-type the server now can respond if it will accept a request under these circumstances. in this example, the server response says that: access-control-allow-origin the https://foo.example origin is permitted to request the bar.example/resources/post-here/ url via...
...the above permissions may be cached for 86,400 seconds (1 day). ...
HTTP request methods - HTTP
Web › HTTP › Methods
asks for a response identical to that of a get request, but without the response body. post the post method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. put the put method replaces all current representations of the target resource with the request payload. delete the delete method deletes the specified resource. connect the connect method establishes a tunnel to the server identified by the target resource. options the options method is used to describe the communication options for the target resource. trace the trace method performs a message loop-back test along the path to the target resource. patch the patch method is used to apply partial modifications to a resource. specifications ...
...ce. trace the trace method performs a message loop-back test along the path to the target resource. patch the patch method is used to apply partial modifications to a resource. specifications specification title comment rfc 7231, section 4: request methods hypertext transfer protocol (http/1.1): semantics and content specifies get, head, post, put, delete, connect, options, trace. rfc 5789, section 2: patch method patch method for http specifies patch. ...
HTTP response status codes - HTTP
Web › HTTP › Status
nd should not return this error code. 406 not acceptable this response is sent when the web server, after performing server-driven content negotiation, doesn't find any content that conforms to the criteria given by the user agent. 407 proxy authentication required this is similar to 401 but authentication is needed to be done by a proxy. 408 request timeout this response is sent on an idle connection by some servers, even without any previous request by the client. it means that the server would like to shut down this unused connection. this response is used much more since some browsers, like chrome, firefox 27+, or ie9, use http pre-connection mechanisms to speed up surfing. also note that some servers merely shut down the connection without sending this message. 409 conflict this resp...
...s that have been deleted with this status code. 411 length required server rejected the request because the content-length header field is not defined and the server requires it. 412 precondition failed the client has indicated preconditions in its headers which the server does not meet. 413 payload too large request entity is larger than limits defined by server; the server might close the connection or return an retry-after header field. 414 uri too long the uri requested by the client is longer than the server is willing to interpret. 415 unsupported media type the media format of the requested data is not supported by the server, so the server is rejecting the request. 416 range not satisfiable the range specified by the range header field in the request can't be fulfilled; it's p...
HTTP
Web › HTTP
http is a stateless protocol, meaning that the server does not keep any data (state) between two requests. ...
... 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 http session. connection management in http/1.x describes the three connection management models available in http/1.x, their strengths, and their weaknesses. reference browse through detailed http reference documentation. http headers http message headers are used to describe a resource, or the behavior of the server or the client. custom proprietary headers can be added using the x- prefix; others in an ia...
Optional chaining (?.) - JavaScript
the ?. operator functions similarly to the . chaining operator, except that instead of causing an error if a reference is nullish (null or undefined), the expression short-circuits with a return value of undefined. when used with function calls, it returns undefined if the given function does not exist. this results in shorter and simpler expressions when accessing chained properties when the possibility exists that a reference may be missing. ...
...ies 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.first.second; the value of obj.first is confirmed to be non-null (and non-undefined) befor...
JavaScript shells - JavaScript
gtk2 for gui apps, posix for system programming, etc. the best of cpan now for javascript programmers. shelljs - portable unix shell commands for node.js list of javascript shells the following javascript shells work with mozilla. firefox has a built-in javascript console, which support multi-line editing. javascript shell (js) - a command line interpreter for javascript xpcshell is an xpconnect - enabled shell, sometimes useful for mozilla development. babel repl - a browser-based repl for experimenting with future javascript. es6console.com - an open-source javascript console to test ecmascript 2015 code inside the browser. jsconsole.com -- an open-source javascript console with the ability to easily link to particular expressions javascript shell (web page) - also available as par...
....com - an open-source javascript console to test ecmascript 2015 code inside the browser. jsconsole.com -- an open-source javascript console with the ability to easily link to particular expressions javascript shell (web page) - also available as part of the extension developer's extension jash: javascript shell - a dhtml based shell that gives you command line access to a web page. mozrepl - connect to firefox and other mozilla apps, explore and modify them from the inside, while they're running. execute js - (no longer maintained) - firefox-extension which provides an enhanced javascript-console, where you can comfortably enter and execute arbitrary javascript-code and modify functions. xqjs - simple console for firefox. ...
Web audio codec guide - Web media technologies
g.722 (64 kbps (7 khz) audio coding) published by the international telecommunications union (itu), the g.722 codec is designed specifically for voice compression. its audio coding bandwidth is limited to the 50 hz to 7,000 hz range, which covers most of the frequency range of typical human vocalization. this makes it ill-suited for handling any audio that might range outside the human spe...
... human vocalization. this makes it ill-suited for handling any audio that might range outside the human speech range, such as music. g.722 audio is encoded using adaptive differential pulse code modulation (adpcm), in which each sample is represented not by its absolute value, but as a value indicating how much the new sample differs from the previous sample. g.722 is primarily used with webrtc connections, as it's one of the audio codecs mandated by the webrtc specification. supported bit rates g.722: 48 kbps, 56 kbps, and 64 kbps; however, in practice 64 kbps is always used g.722 annex b super wide-band: 64 kbps, 80 kbps, and 96 kbps g.722 annex d stereo wide-band: 64 kbps and 80 kbps g.722 annex d stereo super wide-band: 80 kbps, 96 kbps, 112 kbps, and 128 kbps ...
points - SVG: Scalable Vector Graphics
Web › SVG › Attribute › points
rate a x and y coordinate with a comma and a group of coordinates by a space. it makes things more readable for human beings. --> </svg> polyline for <polyline>, points defines a list of points, each representing a vertex of the line to be drawn. each point is define by a x and y coordinate in the user coordinate system. note: a polyline is an open shape, meaning the last point is not connected to the first point. value [ <number>+ ]# default value none animatable yes example html,body,svg { height:100% } <svg viewbox="-10 -10 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- polyline is an open shape --> <polyline stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90"/> </svg> polygon for <polygon>, points defines a ...
...//www.w3.org/2000/svg"> <!-- polyline is an open shape --> <polyline stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90"/> </svg> polygon for <polygon>, points defines a list of points, each representing a vertex of the shape to be drawn. each point is define by a x and y coordinate in the user coordinate system. note: a polygon is a closed shape, meaning the last point is connected to the first point. value [ <number>+ ]# default value none animatable yes example html,body,svg { height:100% } <svg viewbox="-10 -10 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- polygon is an closed shape --> <polygon stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90" /> </svg> specifications specification ...
<polyline> - SVG: Scalable Vector Graphics
Web › SVG › Element › polyline
for closed shapes see the <polygon> element. ...
...for closed shapes see the <polygon> element. ...
SVG documentation index - SVG: Scalable Vector Graphics
Web › SVG › Index
k the horizontal distance between two glyphs. this process is known as kerning. 349 <image> element, reference, svg, svg graphics the <image> svg element includes images inside svg documents. it can display raster image files or other svg files. 350 <line> element, reference, svg, svg graphics the <line> element is an svg basic shape used to create a line connecting two points. 351 <lineargradient> element, svg, svg gradient the <lineargradient> element lets authors define linear gradients that can be applied to fill or stroke of graphical elements. 352 <marker> element, svg, svg container the <marker> element defines the graphic that is to be used for drawing arrowheads or polymarkers on a given <path>, <line>, <...
...all the basic shapes can be created with a path element. 358 <pattern> element, svg, svg container the <pattern> element defines a graphics object which can be redrawn at repeated x- and y-coordinate intervals ("tiled") to cover an area. 359 <polygon> element, reference, svg, svg graphics the <polygon> element defines a closed shape consisting of a set of connected straight line segments. the last point is connected to the first point. 360 <polyline> element, reference, svg, svg graphics the <polyline> svg element is an svg basic shape that creates straight lines connecting several points. typically a polyline is used to create open shapes as the last point doesn't have to be connected to the first point. for closed shapes see the <po...
Basic shapes - SVG: Scalable Vector Graphics
center of the ellipse. cy the y position of the center of the ellipse. line the <line> element takes the positions of two points as parameters and draws a straight line between them. <line x1="10" x2="50" y1="110" y2="150"/> x1 the x position of point 1. y1 the y position of point 1. x2 the x position of point 2. y2 the y position of point 2. polyline a <polyline> is a group of connected straight lines. since the list of points can get quite long, all the points are included in one attribute: <polyline points="60, 110 65, 120 70, 115 75, 130 80, 125 85, 140 90, 135 95, 150 100, 145"/> points a list of points. each number must be separated by a space, comma, eol, or a line feed character. each point must contain two numbers: an x coordinate and a y coordinate. so, the lis...
... 125 85, 140 90, 135 95, 150 100, 145"/> points a list of points. each number must be separated by a space, comma, eol, or a line feed character. each point must contain two numbers: an x coordinate and a y coordinate. so, the list (0,0), (1,1), and (2,2) would be written as 0, 0 1, 1 2, 2. polygon a <polygon> is similar to a <polyline>, in that it is composed of straight line segments connecting a list of points. for polygons though, the path automatically connects the last point with the first, creating a closed shape. note: a rectangle is a type of polygon, so a polygon can be used to create a <rect/> element in cases where you need a little more flexibility. <polygon points="50, 160 55, 180 70, 180 60, 190 65, 205 50, 195 35, 205 40, 190 30, 180 45, 180"/> points a list of ...
Web security
re your site and its code from attacks and data theft. content security content security policy (csp) content security policy (csp) is an added layer of security that helps to detect and mitigate certain types of attacks, including cross-site scripting (xss) and data injection attacks. these attacks are used for everything from data theft to site defacement to the distribution of malware. connection security transport security layer (tls) the transport layer security (tls) protocol is the standard for enabling two networked applications or devices to exchange information privately and robustly. applications that use tls can choose their security parameters, which can have a substantial impact on the security and reliability of data. this article provides an overview of tls and the kin...
... security parameters, which can have a substantial impact on the security and reliability of data. this article provides an overview of tls and the kinds of decisions you need to make when securing your content. https https (hypertext transfer protocol secure) is an encrypted version of the http protocol. it uses ssl or tls to encrypt all communication between a client and a server. this secure connection allows clients to be sure that they are connected with the intended server, and to exchange sensitive data. http strict-transport-security the strict-transport-security: http header lets a website specify that it may only be accessed using https. certificate transparency certificate transparency is an open framework designed to protect against and monitor for certificate misissuances. newl...
Web Components
ntains functionality related to custom elements, most notably the customelementregistry.define() method used to register new custom elements so they can then be used in your document. window.customelements returns a reference to the customelementregistry object. life cycle callbacks special callback functions defined inside the custom element's class definition, which affect its behavior: connectedcallback: invoked when the custom element is first connected to the document's dom. disconnectedcallback: invoked when the custom element is disconnected from the document's dom. adoptedcallback: invoked when the custom element is moved to a new document. attributechangedcallback: invoked when one of the custom element's attributes is added, removed, or changed. extensions ...
... tree to the specified element. the element.shadowroot property returns the shadow root attached to the specified element, or null if there is no shadow root attached. relevant node additions additions to the node interface relevant to shadow dom: the node.getrootnode() method returns the context object's root, which optionally includes the shadow root if it is available. the node.isconnected property returns a boolean indicating whether or not the node is connected (directly or indirectly) to the context object, e.g. the document object in the case of the normal dom, or the shadowroot in the case of a shadow dom. event extensions extensions to the event interface related to shadow dom: event.composed: returns a boolean which indicates whether the event will propagate acro...
panel - Archive of obsolete content
33, you don't get a context menu. from firefox 33 you can enable a context menu by passing contextmenu: true to the panel's constructor. the html <select> element doesn't work. the html <datalist> element doesn't give you autocomplete suggestions (bug 918600). you can't embed flash (bug 952578). you can't provide tooltips using title attributes (bug 918600). security warning pages (the "this connection is untrusted" warning) does not work, so panels which trigger it will be broken (bug 1031554). mouse button shortcuts, such as using the middle button to open a link in a new page, don't work. scrolling using keyboard doesn't work properly (bug 1001914) globals constructors panel(options) creates a panel. parameters options : object optional options: name type ...
remote/child - Archive of obsolete content
that was previously registered. properties port an event emitter that can be used to send and receive frame specific events to and from code in the main process. content the top level dom window currently displaying in this frame. istab a boolean property indicating whether this frame displays in one of the application's main browser tabs. events detach event emitted when this frame disconnects from the application. ...
Storing annotations - Archive of obsolete content
, onmessage: function(message) { require('sdk/tabs').open(message); } }); since this panel's content script uses jquery we will pass that in too: again, make sure the name of it matches the version of jquery you downloaded. when the panel is shown we send it the array of stored annotations. when the panel sends us a url we use the tabs module to open it in a new tab. ...
Developing for Firefox Mobile - Archive of obsolete content
ox. you can use the same code to target both desktop firefox and firefox mobile, and use jpm-mobile instead of the normal jpm. right now not all modules are fully functional, but we're working on adding support for more modules. the tables at the end of this guide list the modules that are currently supported on firefox mobile. this tutorial explains how to run sdk add-ons on an android device connected via usb to your development machine. we'll use the android debug bridge (adb) to communicate between the add-on sdk and the device. it's possible to use the android emulator to develop add-ons for android without access to a device, but it's slow, so for the time being it's much easier to use the technique described below. setting up the environment first you'll need an android device capa...
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
export:: $(install) $(srcdir)/*.js $(final_target)/components now you can instantiate an instance of this component and use the locationfile property to get an nsifile interface that points to your extension's home directory. using third-party libraries for more sophisticated extensions, you may want to integrate third-party libraries that provide specialized functionality for database connectivity, image processing, networking and the like. if you want your extension to run on all firefox platforms, you will need to have the source code for the library in question, so i assume that this is available. the most convenient approach from the perspective of the development cycle is to create a mozilla-style makefile for the library. this works well for libraries that have a straightforwar...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
le. chrome urls are structured as: chrome://%package name%/%package type%/%relative path to source file% for example, the chrome url for the firefox browser window is as follows: chrome://browser/content/browser.xul here, the package name is “browser”, the file “browser.xul”, and the type of the package is “content”. source files represented through chrome urls run with universalxpconnect privileges; even if they haven’t been granted “use xpconnect as local file” privileges, as discussed in chapter 4, they will be able to use xpcom functions (figure 1). extension/ chrome manifest chrome/ #registered in the chrome content package #run with privileges locale package skin package figure 1: chrome packages and chrome registration (fixme: not really explicit and...
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
ability. even if you trust the remote server; for example, because it is one you rent and administer yourself, there is a huge security risk, because of, but not limited to: you might discontinue your project or sell it, so that it is possible another person with malicious intentions takes over your domain. the server and/or domain name might be compromised. if using an unencrypted, insecure connection, a man-in-the-middle attacker might replace the json with attack code before it arrives at the user. use native json since firefox 3.5 you should use json. really, just use it! note: do not use json parsers implemented in javascript. these implementations are less efficient and often also contain serious security vulnerabilities. such implementations are meant to be used within a very diff...
Intercepting Page Loads - Archive of obsolete content
ndow.top) { // this is a frame. } in this case, the url can be obtained from arequest.name. make sure you access it from inside the state validation if condition. there may be other cases where accessing this property will throw an exception. canceling the request works just like with onlocationchange. see "recognizing page load failure" at mozilla.dev.extensions for tips on detecting connection failures and http response codes. xpcom solutions there are a couple more solutions you may be interested in trying if the previous ones are insufficient. these require creating xpcom components that implement existing firefox interfaces. they may be useful in case you have most of your application logic in xpcom, or if you absolutely need a single point of inspection for loads. the previ...
Local Storage - Archive of obsolete content
on code that moves the data from the old db format to the new, and this becomes increasingly complex as you add new versions and new structure changes. so, be careful and plan for the future. there are two paths you can take when creating the local database you'll be using for your extension: generate the database file (through mozistorageservice.opendatabase(), all tables (through mozistorageconnection.createtable(), and initial data when your extension starts up for the first time. if you need a complex database this can be heavy in terms of time and code, but this will only happen once and this can be done in a lazy or asynchronous way. have an initial database file in your defaults directory that you can copy to the user's profile. this way you just need to do a file copy. you can reach ...
XUL School Tutorial - Archive of obsolete content
arted with firefox extensions the essentials of an extension setting up a development environment javascript object management basic functionality adding menus and submenus adding toolbars and toolbar buttons adding events and commands adding windows and dialogs adding sidebars user notifications and alerts intermediate functionality intercepting page loads connecting to remote content handling preferences local storage advanced topics the box model xpcom objects observer notifications custom xul elements with xbl mozilla documentation roadmap useful mozilla community sites appendices appendix a: add-on performance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loadi...
Security best practices in extensions - Archive of obsolete content
type="content" attribute, which essentially sandboxes the code there and blocks callback rights into chrome. using eval() in an extension using the built-in javascript eval function is frowned upon in the context of extensions. while there are some legitimate use-cases, most of the time there are safer alternatives. this blog post offers some excellent reasons not to use eval(). sandboxed http connections the main purpose of sandboxed http connections is to interact with a web service, without interfering with the cookies set in the browser by that service/site. for example, if you are loading pictures or other data from a photo sharing site, you can sandbox your connections to that site so that the normal browsing of that site by the user in the main firefox browser is not affected. for a re...
Setting up an extension development environment - Archive of obsolete content
. don't forget to switch from content to browser as context. devtools.debugger.remote-enabled = true. this adds a "browser debugger" entry to the "web developer" submenu of the "tools" menu. the browser debugger can be used to debug the javascript code of extensions. the devtools.chrome.enabled preference must also be set to true for the browser debugger to be enabled. devtools.debugger.prompt-connection = false. this prevents the browser debugger from prompting for connection permission every time. extensions.logging.enabled = true. this will send more detailed information about installation and update problems to the error console. (note that the extension manager automatically restarts the application at startup sometimes, which may mean you won't have time to see the messages logged befor...
Promises - Archive of obsolete content
ost of dealing with flat files directly. for use cases which are not easily served by other options, or for legacy code which cannot easily be upgraded to non-relational models, the sqlite.jsm module provides a clean, promise-based interface to sqlite databases. representative example usage components.utils.import("resource://gre/modules/sqlite.jsm"); task.spawn(function* () { // open the connection. let db = yield sqlite.openconnection({ path: database_path }); try { // start a transaction to insert the data. yield db.executetransaction(function* () { for (let node of nodes) // insert the node's data, using an automatically-cached, // pre-compiled statement, and parameter placeholders. yield db.executeca...
Updating addons broken by private browsing changes - Archive of obsolete content
w use guids, and contain a new guid property. nsidownload now has retry, cancel, remove, pause, and resume methods which should be used instead of deprecated similarly-named nsidownloadmanager methods. nsidownload's getdownload method is deprecated; use the asynchronous getdownloadbyguid method instead. nsidownloadmanager now has activeprivatedownloads, activeprivatedownloadcount, and privatedbconnection members to complement the existing public ones. nsidownloadmanager's addlistener method is deprecated. addprivacyawarelistener should be used instead, or no notifications will be received for private downloads. there is a new download-manager-remove-download-guid notification, which passes an nsisupportscstring subject for the guid or null. nsihttpauthmanager: setauthidentity and getauth...
MMgc - Archive of obsolete content
izedobject base class: gcobject a garbage collected object with finalization support. all of the rules from gcobject above apply to gcfinalizedobject. the finalizer (c++ destructor) of a gcfinalizedobject will be invoked when mmgc collects the object. class myfinalizedobject : public mmgc::gcfinalizedobject { public: ~myfinalizedobject() { // do finalization behavior, like closing network connections, // freeing unmanaged memory owned by this object, etc. } }; rcobject base class: gcfinalizedobject this is a reference-counted, garbage collected object. rcobject is used instead of gcobject when more immediate reclamation of memory is desired. for instance, the avmplus::string class in avm+ is a rcobject. strings are created very frequently, and are often temporary objects with very ...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
from. the default plug-in will redirect you to this page when you do not have the correct plug-in installed. you may also supply any custom plug-in parameters as additional <param> elements. still to do only hosts windowed plug-ins. an official pluginhostctrl.cab file. doesn't work for the adobe acrobat plug-in yet. plug-ins cannot create writeable streams or seek in readable streams. liveconnect scripting is not supported. if you need scripting functionality, consider shipping a modified pluginhostctrl.dll that exposes methods you wish to call on your plugin. ...
Blackwood - Archive of obsolete content
the blackwood project, started by engineers at sun microsystems, is an attempt to better integrate the java platform with the mozilla browser. blackwood consists of a series of java-based extensions to mozilla. blackwood's mission is to put java support in mozilla on a par with javascript support. active subprojects webclient java dom api java pluglet api defunct subprojects blackconnect -- blackconnect was superseeded by javaxpcom ...
Exception logging in JavaScript - Archive of obsolete content
orting in firefox 3 firefox 3 improves reporting of unhandled exceptions by establishing a set of rules that determines whether or not an exception is worth reporting: any methods on interfaces annotated with the [function] attribute in idl (see, for example, nsidomeventlistener) that throw exceptions always report those exceptions into the error console. any exceptions that are generated by xpconnect -- that is, those exceptions whose result codes are defined in nsixpconnect.idl -- are always logged into the error console. the ns_nointerface error is never reported when returned by a javascript object's queryinterface() method on the nsisupports interface. the ns_nointerface error is never reported when returned by a javascript object's getinterface() method on the nsiinterfacerequestor int...
Layout System Overview - Archive of obsolete content
the same content model. in other words, the same html or xml document could be viewed as a normal galley presentation in a browser window, while simultaneously being presented in a paged presentation to a printer, or even an aural presentation to a speech-synthesizer. to date the only real use of this multiple presentation ability is seen in printing, where multiple presentations are managed, all connected to the same content model. (note: it is unclear if this is really a benefit - it may have been better to use a copy of the content model for each presentation, and to remove the complexity of managing separate presentations - analysis is needed here). the idea of supporting a non-visual presentation is interesting. layout's support for aural presentations is undeveloped, though conceptually, it...
JavaScript Client API - Archive of obsolete content
i is available in mozilla-based products that use sync, such as firefox desktop. this document is somewhat outdated, and the api isn't well-supported for use from add-ons; tread carefully. the best, and most up-to-date, reference to sync's internal apis is the source code. please note that usage of the sync apis is governed by a terms of service: by accessing or using the firefox sync apis in connection with the development of your own client software to access the firefox sync services (a “third party client”), you acknowledge that you will need to install and use a local version of the firefox sync server for multiple account testing and that any use of mozilla’s hosted firefox sync services is subject to mozilla’s firefox sync terms of service at https://services.mozilla.com/tos/. ...
Helper Apps (and a bit of Save As) - Archive of obsolete content
security considerations multiple checks for whether a file is executable (on windows) to keep from launching such files via ::shellexecute(). checks happen in onstartrequest, in the helper app dialog, and as a last ditch in the launching code. limitations of nsimimeinfo no way to say "do whatever the os default is." no support for command-line arguments. no support for multiple commands connected by pipes (mostly useful on unix). ongoing work support synchronous dialogs, not just asynchronous ones (fixes many issues related to pre-downloading, content-decoding, etc). reworking the nsimimeservice api to improve the quality of the mimeinfo we get. reworking the helper app dialog to save user choices better. gnome integration for unix. future work fix the deficiencies in nsimime...
JavaScript crypto - Archive of obsolete content
he user password again. the ssl session cache is also cleared (from firefox 1.5 upward). this means the master password will be requested the next time a saved password will be accessed after this function is called. this also means the ssl client authentication state will be erased for ssl sites with client authentication, and a client certificate prompt will appear again the next time the user connects to the site. note: this function provides a convenient way to erase the ssl session state at the browser level, but in order to really guarantee that the state is erased, it is more secure to do it on the server side whenever possible. void disablerightclick(); unimplemented ...
jspage - Archive of obsolete content
tion:-1})).write("");return this;}});cookie.write=function(b,c,a){return new cookie(b,a).write(c); };cookie.read=function(a){return new cookie(a).read();};cookie.dispose=function(b,a){return new cookie(b,a).dispose();};var swiff=new class({implements:[options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowscriptaccess:"always",wmode:"transparent",swliveconnect:true},callbacks:{},vars:{}},toelement:function(){return this.object; },initialize:function(l,m){this.instance="swiff_"+$time();this.setoptions(m);m=this.options;var b=this.id=m.id||this.instance;var a=document.id(m.container); swiff.callbacks[this.instance]={};var e=m.params,g=m.vars,f=m.callbacks;var h=$extend({height:m.height,width:m.width},m.properties);var k=this;for(var d in f){swiff.callbac...
Monitoring downloads - Archive of obsolete content
dbconn.close(); }, this is fairly simple stuff. the download manager instance is cached into a member variable in the downloadlogger object for reuse later, and its addlistener() method is called to start listening for download status updates. the database file is opened, and an sqlite create table command is executed to create the table. finally, the database is closed. note: the mozistorageconnection method close() is being added to firefox 3 alpha 8; in prior versions of firefox, there is no way to explicitly close the database. instead, it is closed when the garbage collector disposes of the connection object. handling download state changes once the code above is run, our ondownloadstatechange() method is called whenever a download's state changes. this is part of the nsidownloadprogr...
Mozilla Application Framework - Archive of obsolete content
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 applications. and much much more... tools venkman a javascript debugger with...
Plug-n-Hack - Archive of obsolete content
without integration between security tools and browsers, a user must often switch between the tool and their browser several times to perform a simple task, such as intercepting an http(s) request. pnh allows security tools to declare the functionality that they support which is suitable for invoking directly from t...
Bundles - Archive of obsolete content
f="prismdemo.webapp" title="prism demo"> when the extension finds such a <link> tag, it will notify the user. the user can then decide to install the webapp. how-to here is a simple way to build a basic web application bundle: create file called webapp.ini that contains something like: [parameters] id=unique-app-id@unique-author-id.whatever name=webapp name uri=http://[the-url-what-you-want-to-connect-to]/ status=yes location=no sidebar=no navigation=no zip the file to [whatever].webapp double-click the webapp bundle or use prism -webapp [path-to-webapp] structure a bundle can contain the following files. any other files in the .webapp file will be ignored. after the .webapp file is executed the first time, these files will be unzipped and "cached" to a local directory structure. / webapp.i...
Proxy UI - Archive of obsolete content
seamonkey menu: preferences > advanced group > proxies panel menu: right-click on offline-online button (on browser windows). camino configured in os (networking preferences) (recently added - some support for reading os and account settings.)ui elements preferences panel overview the ui is based on selecting a proxy mode, then filling out any additional needed information in "related" ui. the "ok" button saves the preferences. ...
RDF Datasource How-To - Archive of obsolete content
rresponds 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, 2000 copyright information: copyright (c) chris waterson ...
Standalone XPCOM - Archive of obsolete content
standalone-modules=xpcom. what's the difference between standalone and non-standalone xpcom? there is no binary difference between standalone xpcom and the xpcom that ships with the mozilla browser. the one functional difference is that xpt files cannot be read from .zip files in standalone xpcom. todo for v 1.0 optional exclusion of specific features into standalone xpcom like registry, xpconnect. tweeking these options will cause reduction in memory requirements and size. get xpcom/tests directory upto date and documented. update this document for mac. api freeze and documentation original document information author: suresh duddi last updated date: 15 may 2000 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content av...
Tamarin Acceptance Testing - Archive of obsolete content
to build and setup the tools see building_tamarin_windows_mobile_utilities. ...
Mozilla Web Developer Community - Archive of obsolete content
get news from developer.mozilla.org and connect with developers involved in cross-browser, standards-based web development. newsgroups, mailing lists, and forums by topic: css - mozilla.dev.tech.css dom - mozilla.dev.tech.dom html - mozilla.dev.tech.html plugins - mozilla.dev.tech.plugins xml - mozilla.dev.tech.xml documentation - see mdc:community more at http://www.mozilla.org/community/dev...er-forums.html mozillazine forums mozilla news and development help mozilla (testing and development) mozdev.org mozillazine planet mozilla spread firefox standards communities get involved in grass-roots web standards evangelism efforts through these groups: the web standards project, a grassroots coalition fighting for standards maccaws, making a commercial cas...
Binding Attachment and Detachment - Archive of obsolete content
ttached. for example, given a binding d1, with an explicit inheritance chain of d1 -> d2 -> d3 if this element is attached to an element using element.style.mozbinding that already has a binding chain of s1 -> s2 -> s3 the resulting binding chain following the addition of the binding is d1 -> d2 -> d3 -> s1 -> s2 -> s3 the inheritance between d3 and s1 is implicit, meaning that there is no connection in the xbl documents between the two bindings. the inheritance link has been forged dynamically through the invocation of the element.style.mozbinding. <constructor> call as a document is loaded and style rules are matched for elements, any binding documents that are encountered will load as needed. binding document loads suppress the firing of the dom load event for the bound document. when...
treelines - Archive of obsolete content
this is false by default. ...
linkedpanel - Archive of obsolete content
« xul reference home linkedpanel type: id the id of the linked tabpanel element that will be displayed when the tab is selected. if this attribute is not used, the tab will be connected to the panel at the corresponding index in the tabpanels element that the tab is in its tabs container. however, if this attribute is used, this behavior is overridden, and the tab will always be linked to a specific panel. this might be used to avoid duplication by linking several tabs to one panel with slight differences to the content adjusted in the select event. ...
preference-editable - Archive of obsolete content
this is useful for custom elements implemented in xbl. ...
preference - Archive of obsolete content
this attribute only has any effect when used inside a prefwindow. ...
preference.type - Archive of obsolete content
int an integer string a string unichar a unicode string wstring a localized string. ...
Introduction to XUL - Archive of obsolete content
ion allowing the exact location of files involved in the chrome description to be moved without affecting the xul source. so it's just an indirection. someday, there will be a complete description of this mechanism at packages, but for now there's a good but somewhat out of date document at configurable chrome available for more information. scripting a xul interface is only a collection of disconnected widgets until it has been programmed. "programming" can be as simple as some javascript to tie the widgets together and perhaps to give them extra functionality, or as complex as application (c++) code which is free to do ... anything. this paper will concentrate on javascript, deeming application programming to be beyond its scope. javascript xul can contain html content, including javascrip...
Multiple Rule Example - Archive of obsolete content
ate without requiring it to match the conditions. of course, the variable doesn't have to be ?date in the second rule. you might notice that the ?title variable is used in the first rule whereas the ?phototitle variable is used for the second rule, despite that they both store the value of the title predicate. there is no reason for this -- it is only used in this example to show that there is no connection between the variables used in the two rules. you can use different variables if it makes sense in the context of the template or the data, although in this example it would seem more reasonable to use the same variable name. the only exception to this is that the container and member variables (those that are referred to in the uri attributes), must be the same in all rules. in this example, t...
Complete - Archive of obsolete content
s 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 description from: locale/fr-fr/allcustom/install.properties testing a locale to test the alternative locale, install the ex...
More Tree Features - Archive of obsolete content
em in the tree has a level starting at 0. the topmost items in the tree will have a level of 0, the children of those items will have a level of 1, the children below that will have a level of 2, and so on. the tree will query the view for the level of each item in order to determine how to draw the rows. the tree will draw the open and close icons to open and close a parent item as well as lines connecting the children to their parents. the tree will also handle drawing the rows with the right level of indenting. however, the view will need to make sure it keeps track of the level of the rows as necessary. this can sometimes be quite tricky, but fortunately, the built-in content tree view does all of the hard work for us. to create a set of nested rows, all we need to do is add a second treechil...
Skinning XUL Files by Hand - Archive of obsolete content
ector to apply style information to a single xul element. since id attribute must be unique in a document, there can only be a single element with the id "navbar", and it will pick up the style information in the block. the third type of selector, thepseudo-class, is one you may have seen in the in-line style definitions for hyperlinks which commonly appear in html documents. the pseudo-class is connected to an element (or not: you can also define styles that apply to any element in the state specified by a pseudo-class) with the ":" character. in this third type of style definition, the "a" element picks up the style information defined in the block only when it is, as a link, active. this last type is new to css2. to start creating the xul skin: add the stylesheet processing instruction t...
Styling a Tree - Archive of obsolete content
of the twisty used to expand and collapse child rows. ::-moz-tree-image: the image for a cell. you can set the image with the list-style-image property. ::-moz-tree-row: a row. use this to set the background color of a row. ::-moz-tree-indentation: the indentation to the left of rows that are children of other rows. ::-moz-tree-column: a column. ::-moz-tree-line: the lines that are drawn to connect child rows to parent rows. ::-moz-tree-separator: a separator in a tree. ::-moz-tree-progressmeter: content for progressmeter cells. you can create a progressmeter column by setting the type attribute on the column to progressmeter. ::-moz-tree-drop-feedback: the drag and drop feedback. ::-moz-tree-checkbox: the image to use for checkbox columns. you can check for multiple properties by sep...
XUL element attributes - Archive of obsolete content
n index where the child is inserted. the position is one-based, so use a value of 1 to place the element at the beginning. this attribute is ignored if either an insertbefore or insertafter attribute matches an element. preference-editable mozilla 1.8 type: boolean if true, the element may be used as one that modifies a preference in a prefwindow. the preference attribute may be used to connect to a preference element. this is useful for custom elements implemented in xbl. the element should fire change, command, or input event when the value is changed so that the preference will update accordingly. see the pref system documentation for more information. querytype type: string indicates the type of datasource used in a template. firefox 3 provides 3 built-in datasources: 'r...
XUL accessibility guidelines - Archive of obsolete content
aningful images, or it is inappropriate for the function of an image. title all windows, including dialogs and wizards, have a descriptive title. windows lack a title or have a incorrect title. form labels every form element has an associated label and radiobuttons are encapsulated in a groupbox. form elements are missing labels or the labels are not programmatically connected or radiobuttons are not contained in a groupbox. display checkpoint pass fail system defaults system settings are maintained. system settings are not maintained. color color alone is not used to convey meaning and sufficient contrast exists between font color and background color. color alone is used to convey meaning, or font and background ...
checkbox - Archive of obsolete content
ge to appear in the checkbox. if this attribute is left out, no image appears. you can have both an image and a label. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. prop...
colorpicker - Archive of obsolete content
this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. ...
hbox - Archive of obsolete content
Archive › Mozilla › XUL › hbox
« xul reference home [ examples | attributes | properties | methods | related ] a container element which can contain any number of child elements. this is equivalent to the box element, except it defaults to horizontal orientation. more information is available in the xul tutorial. ...
listbox - Archive of obsolete content
update additional state. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. rows type: integer the number of rows to display in the element. if the element contains more than this number of rows, a scrollbar will appear which the user can use to scroll to the other rows. to ...
listitem - Archive of obsolete content
ibute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selectedindex or selecteditem property of the containing element. tabi...
menulist - Archive of obsolete content
em. oncommand type: script code this event handler is called when the command is activated. this occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if the menu is closed. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. sizetopopup type: one of the values below indicates how the m...
radiogroup - Archive of obsolete content
e element will, however, still respond to mouse events. to enable the element, leave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. focused type: boolean this attribute is true if the element is focused. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. ...
richlistbox - Archive of obsolete content
pdate additional state. disablekeynavigation type: boolean if this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. this is done incrementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. seltype type: one of the values below used to indicate whether multiple selection is allowed. single only one row may be selected at a time. (default in listbox and richlistbox.) multiple multiple rows ...
tab - Archive of obsolete content
Archive › Mozilla › XUL › tab
on user selection of the menuitem. last-tab type: boolean this attribute will be set to true for the last tab. this attribute should not be set manually, but is useful in a theme if the last tab should be styled differently. linkedpanel type: id the id of the linked tabpanel element that will be displayed when the tab is selected. if this attribute is not used, the tab will be connected to the panel at the corresponding index in the tabpanels element that the tab is in its tabs container. however, if this attribute is used, this behavior is overridden, and the tab will always be linked to a specific panel. this might be used to avoid duplication by linking several tabs to one panel with slight differences to the content adjusted in the select event. oncommand type: scr...
textbox - Archive of obsolete content
t, matching the behavior of all other event handlers. oninput type: script code this event is sent when a user enters text in a textbox. this event is only called when the text displayed would change, thus it is not called when the user presses non-displayable keys. placeholder type: string a string that appears in the textbox when it has no value. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. readonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. rows type: integer the number of rows to dis...
tree - Archive of obsolete content
Archive › Mozilla › XUL › tree
s opened. if you do not specify this attribute, state information will be stored in the local store (rdf:local-store). tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. treelines type: boolean when set to true, lines are drawn connecting the lines in the tree; when false, the lines are not drawn. this is false by default. properties accessibletype type: integer a value indicating the type of accessibility object for the element. builderview type: nsixultreebuilder a reference to the tree builder which constructed the tree data. the builder provides access to the rdf resources for each row in t...
Debugging a XULRunner Application - Archive of obsolete content
and you should be able to point the debugger to your app. happy debugging :) venkman follow these instructions to install venkman into your xulrunner application (xulrunner 1.9 and later): get venkman from addons.mozilla.org (v0.9.87 at the time of writing). to download the package, right-click the install link and save the package locally. create a directory <application>/distribution/b...
Using LDAP XPCOM with XULRunner - Archive of obsolete content
dap.so or...) mozldap.xpt and two files in the root directory of the build package: on windows: nsldap32v50.dll nsldappr32v50.dll on linux: libldap50.so libprldap50.so those are the native ldap library. if you copy as usual those files in the components directory of your xul app, this can't work. actually, the ldap interfaces are available (for exemple, components.interfaces.nsildapconnection is not null), but the components can't be loaded (for example, components.classes["@mozilla.org/network/ldap-connection;1"] is null). this is due to the fact that the native ldap library files are not found by the xulrunner process. the solution is to use the bsmedberg stub, described in using dependent libraries in extension components: the component library is just a loader of the real libra...
Mozilla release FAQ - Archive of obsolete content
la because the x-mailer field mentions mozilla, then you're misinterpreting the meaning of the x-mailer field -- it indicates that the sender is *using* netscape communicator to deliver the mail. if you're getting mail contents of one of the mozilla newsgroups, it's likely because you subscribed (or someone subscribed you) to the mailing list form of those groups. as to the first case, there's no connection between the mozilla project and the spam. you might want to visit the open directory project's spam pages to help you track down the origin. for the second case, go to the mozilla community section to unsubscribe original document information author(s): pat gunn last updated date: may 28, 2005 copyright information: portions of this content are © 1998–2007 by individual mo...
2006-12-01 - Archive of obsolete content
summary: mozilla.dev.security - november 25, 2006 to december 1, 2006 return to mozilla-dev-security announcements none during this week. discussions protocol security daniele rizzo posted a question as to whether or not it is possible to enable/disable the privilege of universalxpconnect in a 'entire' protocol (http://, file://). problem with downloading signed script components in a firefox extension andrew groom is having problems getting an extension to download a signed script and would appreciates some help with his problem. meetings none during this week. ...
2006-12-01 - Archive of obsolete content
sion. http://www.juicescript.org/ discussions deleting objects in spidermonkey a user asks if there's a method of manually deleting an object in spidermonkey before garbage collector deletes it. peter wilson's reply was to add a method that does the deleting with a native implementation that releases the resources held by the object as seen in this database interface: var mydbase = new pgsqlconnection; mydbase.connect("database"); mydbase.exec("select * from mytable where ..."); // use the result data - (native implementation function) mydbase.close() spidermonkey for server side inquiry about why javascript hasn't caught on for general server-side scripting. peter wilson lists some important comparisons between spidermonkey and php. he states that javascript is powerful server-side scri...
JS-Engine FAQ - Archive of obsolete content
an alternative would be to use built-in e4x. ...
2006-10-13 - Archive of obsolete content
unbird calendars to/from other calendar applications. discussions how to change between lightning and mail discussion about how to view folder pane and lightning pane again after you closed them. lightning 0.3 - event list/search? discussion about the ability to list and search all the events in a calendar. can anyone see what's wrong with this vcalendar? discussion about the problem remotely connecting to a particular calendar meetings none this week. authors mark paruzel yi (eric) shen [back to weekly summaries ] ...
NPP_NewStream - Archive of obsolete content
e instance, but can be randomly accessed by the plug-in as needed, through calls to npn_requestread. if the stream is not seekable, placing the stream in np_seek mode causes the browser to save the entire stream to the disk cache. npn_requestread requests are only fulfilled when all data has been read and stored in the cache. as an optimization to extract the maximum benefit from existing network connections, the browser continues to read data sequentially out of the stream (as in mode np_normal) until the first npn_requestread call is made. note: in any mode other than np_seek, the application should call npp_destroystream once all data in the stream has been written to the plug-in. the plug-in can also request termination of the stream at any time by calling npn_destroystream. see also np...
NPSetWindowCallbackStruct - Archive of obsolete content
nt. syntax typedef struct { int32 type; display* display; visual* visual; colormap colormap; unsigned int depth; } npsetwindowcallbackstruct; fields the data structure has the following fields: type always contains np_setwindow. 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, all...
Adobe Flash - Archive of obsolete content
function myflash_dofscommand(command, args) { // handle any callback logic that you may have designed into your flash plugin // the flash animation will supply you with the values for command and args // this is a function that h...
Confidentiality, Integrity, and Availability - Archive of obsolete content
t site. now imagine that an attacker can shop on your web site and maliciously alter the prices of your products, so that they can buy anything for whatever price they choose. that would be a failure of integrity, because your information—in this case, the price of a product—has been altered and you didn't authorize this alteration. another example of a failure of integrity is when you try to connect to a website and a malicious attacker between you and the website redirects your traffic to a different website. in this case, the site you are directed to is not genuine. availability availability means that information is accessible by authorized users. if an attacker is not able to compromise the first two elements of information security (see above) they may try to execute attacks like deni...
UUID - Archive of obsolete content
see also generating_guids ...
Using IO Timeout And Interrupt On NT - Archive of obsolete content
rror, the file descriptor is no longer usable. suppose the file descriptor is intended to be used for the life time of the process, for example, the logging file, this is really not acceptable. a possible solution is to add a <tt>pr_disableinterrupt()</tt> function to turn off interrupts when accessing such file descriptors. a related known bug is that timeout and interrupt don't work for <tt>pr_connect()</tt> on nt. this bug is due to a different limitation in our nt implementation. conclusions as long as we need to support nt 3.51, we need to program under the guideline that after an io timeout or interrupt error, the thread must make sure the file descriptor is closed before it exits. programs should also take care in sharing file descriptors and using io timeout or interrupt on files that ...
References - Archive of obsolete content
<- previous section: summary of changes you can learn more on using web standards from these sites (listed in no particular order): what are web standards and why should i use them? what are the advantages of using web standards? ...
New in JavaScript 1.1 - Archive of obsolete content
navigator 3.0. --> new features in javascript 1.1 new objects array boolean function number new properties number.max_value number.min_value nan number.negative_infinity number.positive_infinity new methods array.prototype.join() array.prototype.reverse() array.prototype.sort() array.prototype.split() new operators typeof void other new features <noscript> liveconnect. communication between java and javascript. changed functionality in javascript 1.1 "object deletion". you can remove an object by setting its object reference to null. constructor and prototype properties on objects added. eval() is now a method of every object (was previously a built-in function); it evaluates a string of javascript code in the context of the specified object. math.rand...
New in JavaScript 1.4 - Archive of obsolete content
ld netscape documentation can be found on archive.org. new features in javascript 1.4 exception handling (throw and try...catch) in operator instanceof operator changed functionality in javascript 1.4 eval() changes (cannot be called indirectly and no longer a method of object) arguments not a property of functions deprecated function.arity in favor of function.length changes to liveconnect ...
JavaClass - Archive of obsolete content
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. ...
Packages - Archive of obsolete content
obsolete since gecko 16.0 (firefox 16.0 / thunderbird 16.0 / seamonkey 2.13)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. 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.
java - Archive of obsolete content
created by the java object is a top-level, predefined javascript object. ...
Reference - Archive of obsolete content
neither: core javascript 1.5 reference:operators:special operators:delete operator --nickolay 14:48, 19 december 2005 (pst) reading offline? well, may be it's no so common in today's world... but is there a way to get content of jsref-1.5 or other documents as a tarball? there are still valid needs for this: computers on slow links, computers behind insane firewalls, as well as computers not connected to internet. unfortunately there is not an [easy] method to download content/packages of content off of devmo for 'local' browsing/viewing/printing, yet. it is in the "nice to have" category for us here, however i am unaware of anyone feverishly working on it. (there are some other priorities ahead of that, imho). if downloading the stuff is your priority you are free to field ideas/concept t...
Archived open Web documentation - Archive of obsolete content
t remove the old code as it isn't hosted anywhere (i thought the github reference contained the code) but inserted a faster implementation above while retaining the rest of the document. iterator the iterator function returns an object which implements legacy iterator protocol and iterates over enumerable properties of an object. liveconnect (please update or remove as needed.) msx emulator (jsmsx) old proxy api proxies are objects for which the programmer has to define the semantics in javascript. the default object semantics are implemented in the javascript engine, often written in lower-level languages like c++. proxies let the programmer define most of the...
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
warning: the content of this article may be out of date. this article was written on august 31, 2001; it is not compatible with current versions of firefox. this article applies to mozilla versions 0.9.2 and higher and netscape versions 6.1 and higher. it does not cover netscape 6 and 6.01 introduction plugins that used to take advantage of being scriptable via liveconnect in 4.x netscape browsers lost this possibility in the new world. the main reason for this is that there is no guarantee of java compatibility on a binary level due to the jri/jni switch. the new mozilla xpcom architecture allows xpcom components be scriptable via a different mechanism called xpconnect. we leverage some of these ideas to help you make your netscape communicator 4.x plugins exposed to javascript i...
XQuery - Archive of obsolete content
erkeley db xml was the initial choice by the extension developer for its support across many languages (c++, java, python, perl, php, etc.) (besides its also being open source), but now some problems may exist with bdbxml (unlike saxon). a simple usage example is available. notes for developers wishing to access xquery in their own extensions at present, the extension works simply by using liveconnect to work with berkeley db xml's java api (and via a java wrapper class which circumvents liveconnect's current inability to handle some types of java exceptions properly). however, use of the approach of the java firefox extension might be used to turn the above extension concept into an xpcom component (giving it access to all open windows), and for berkeley db xml, possibly implementing it in c...
Anatomy of a video game - Game development
elate these requests to their main loop. the w3c spec for requestanimationframe does not really define exactly when the browsers must perform the requestanimationframe callbacks. this can be a benefit because it leaves browser vendors free to experiment with the solutions that they feel are best and tweak it over time. modern versions of firefox and google chrome (and probably others) attempt to connect requestanimationframe callbacks to their main thread at the very beginning of a frame's timeslice. the browser's main thread thus tries to look like the following: start a new frame (while the previous frame is handled by the display). go through the list of requestanimationframe callbacks and invoke them. perform garbage collection and other per-frame tasks when the above callbacks stop con...
Examples - Game development
this page lists a number of impressive web technology demos for you to get inspiration from, and generally have fun with. a testament to what can be done with javascript, webgl, and related technologies. the first two sections list playable games, while the second is a catch-all area to list demos that aren't necessarily interactive/games. free/demo games beloola webvr platform to connect passionate people. experience both available on 2d screens and on vr hmds (settings / switch to vr mode). tanx a multiplayer tank battle game, created with playcanvas. hyper vanguard force a neat vertically scrolling space shooter. swooop a plane flying game: control your plane and collect the jewels. again, created with playcanvas. save the day fly your rescue chopper around the disaster area an...
Index - Game development
his series of articles we will show you how you can approach building a game that can be played using touchscreen smartphones, mouse and keyboard, and also less common mechanisms such as gamepads. 31 desktop gamepad controls controls, desktop, gamepad api, gamepads, games, javascript, controllers that's it! we have successfully implemented gamepad controls in our game — try connecting any popular controller like the xbox 360 one and see for yourself how fun it is to avoid the asteroids and shoot the aliens with a gamepad. 32 desktop mouse and keyboard controls controls, desktop, games, javascript, keyboard, mouse ok, we've dealt with touch, keyboard and mouse controls. now let's move on to look at how to set up the game to be controlled using a console...
Audio for Web games - Game development
need an offset here, so if we have started one file playing, we have a record of how far through to start another file. start() takes two optional parameters. the first is when to commence playback and the second is where, which is our offset. ...
Finishing up - Game development
es left, the game is lost; if there are still some lives left, then the position of the ball and the paddle are reset, along with the movement of the ball. rendering the lives display now you need to add a call to drawlives() inside the draw() function and add it below the drawscore() call. drawlives(); improving rendering with requestanimationframe() now let's work on something that is not connected to the game mechanics, but to the way it is being rendered. requestanimationframe helps the browser render the game better than the fixed framerate we currently have implemented using setinterval(). replace the following line: var interval = setinterval(draw, 10); with simply: draw(); and remove each instance of: clearinterval(interval); // needed for chrome to end game then, at the very...
Visual-js game engine - Game development
js project parts : -2d part : this is javascript game engine (server part node.js / client part js) js framework with windows gui editor and game instance creator. ( + server engine tools + server part of web apps ) -3d part : webgl based on three.js engine -3d part : webgl2 based on glmatrix 2.0 -2d part (new): this is typescript based game engine (client part ts). with strong connection with webpack physics done with (matter.js) matter ts this part is removed from this project. new link is : https://github.com/zlatnaspirala/visual-ts-game-engine basic licence rules : 1) each file in this project has its own license , be careful , do not violate the basic rules. 2) you are free to use any version of visual js library in any other project (even commercial projects) ...
ALPN - MDN Web Docs Glossary: Definitions of Web-related terms
application-layer protocol negotiation (alpn) is a tls extension which indicates what application layer protocol is negotiating the encryped connection without requiring additional round trips. important protocol identifiers: protocol identification sequence http/1.1 0x68 0x74 0x74 0x70 0x2f 0x31 0x2e 0x31 ("http/1.1") http/2 0x68 0x32 ("h2") http/2 over cleartext tcp 0x68 0x32 0x63 ("h2c") specifications specification status notes rfc 7301 ietf rfc initial definition. ...
Arpanet - MDN Web Docs Glossary: Definitions of Web-related terms
the arpanet (advanced research projects agency network) was an early computer network, constructed in 1969 as a robust medium to transmit sensitive military data and to connect leading research groups throughout the united states. arpanet first ran ncp (network control protocol) and subsequently the first version of the internet protocol or tcp/ip suite, making arpanet a prominent part of the nascent internet. arpanet was closed in early 1990. learn more general knowledge arpanet on wikipedia ...
Bandwidth - MDN Web Docs Glossary: Definitions of Web-related terms
bandwidth is the measure of how much information can pass through a data connection in a given amount of time. it is usually measured in multiples of bits-per-second (bps), for example megabits-per-second (mbps) or gigabits-per-second (gbps). learn more bandwidth on wikipedia ...
DNS - MDN Web Docs Glossary: Definitions of Web-related terms
dns maintains a list of domain names along with the resources, such as ip addresses, that are associated with them. the most prominent function of dns is the translation of human-friendly domain names (such as mozilla.org) to a numeric ip address (such as 151.106.5.172); this process of mapping a domain name to the appropriate ip address is known as a dns lookup. by contrast, a reverse dns lookup (rdns) is used to determine the domain name associated with an ip address. ...
Dynamic programming language - MDN Web Docs Glossary: Definitions of Web-related terms
e is a programming language in which operations otherwise done at compile-time can be done at run-time. for example, in javascript it is possible to change the type of a variable or add new properties or methods to an object while the program is running. this is opposed to so-called static programming languages, in which such changes are normally not possible. note that while there is indeed a connection between this dynamic/static property of programming languages and dynamic/static-typing, the two are far from synonymous. learn more general knowledge dynamic programming language on wikipedia ...
Forbidden header name - MDN Web Docs Glossary: Definitions of Web-related terms
because the user agent retains full control over them. names starting with `sec-` are reserved for creating new headers safe from apis using fetch that grant developers control over headers, such as xmlhttprequest. forbidden header names start with proxy- or sec-, or are one of the following names: accept-charset accept-encoding access-control-request-headers access-control-request-method connection content-length cookie cookie2 date dnt expect feature-policy host keep-alive origin proxy- sec- referer te trailer transfer-encoding upgrade via note: the user-agent header is no longer forbidden, as per spec — see forbidden header name list (this was implemented in firefox 43) — it can now be set in a fetch headers object, or via xhr setrequestheader(). however, chro...
General header - MDN Web Docs Glossary: Definitions of Web-related terms
...
HTTP - MDN Web Docs Glossary: Definitions of Web-related terms
otocol (http) is the underlying network protocol that enables transfer of hypermedia documents on the web, typically between a browser and a server so that humans can read them. the current version of the http specification is called http/2. as part of a uri, the "http" within "http://example.com/" is called a "scheme". resources using the "http" schema are typically transported over unencrypted connections using the http protocol. the "https" scheme (as in "https://developer.mozilla.org") indicates that a resource is transported using the http protocol, but over a secure tls channel. http is textual (all communication is done in plain text) and stateless (no communication is aware of previous communications). this property makes it ideal for humans to read documents (web sites) on the world wi...
HTTP header - MDN Web Docs Glossary: Definitions of Web-related terms
aders containing more information about the body of the entity, like its content length or its mime-type. ...
Host - MDN Web Docs Glossary: Definitions of Web-related terms
some hosts called servers offer additional services like serving webpages or storing files and emails. the host doesn't need to be a hardware instance. it can be generated by virtual machines. the host generated by virtual machines is called "virtual hosting". ...
Hyperlink - MDN Web Docs Glossary: Definitions of Web-related terms
in html, <a> elements define hyperlinks from a spot on a webpage (like a text string or image) to another spot on some other webpage (or even on the same page). ...
IMAP - MDN Web Docs Glossary: Definitions of Web-related terms
imap (internet message access protocol) is a protocol used to retrieve and store emails. more recent than pop3, imap allows folders and rules on the server. unlike pop3, imap allows multiple simultaneous connections to one mailbox. clients accessing a mailbox can receive information about state changes made from other clients. imap also provides a mode for clients to stay connected and receive information on demand. mark crispin initially developed imap in 1986 as interim mail access protocol. imap4 revision 1 is the current version, defined by rfc 3501. learn more rfc 3501 pop3 imap on wikipedia ...
IP Address - MDN Web Docs Glossary: Definitions of Web-related terms
"ip address" typically still refers to 32-bit ipv4 addresses until ipv6 is deployed more broadly. ...
IPv4 - MDN Web Docs Glossary: Definitions of Web-related terms
ipv4 is the fourth version of the communication protocol underlying the internet and the first version to be widely deployed. first formalized in 1981, ipv4 traces its roots to the initial development work for arpanet. ipv4 is a connectionless protocol to be used on packet-switched link layer networks (ethernet). ipv6 is gradually replacing ipv4 owing to ipv4's security problems and the limitations of its address field. (version number 5 was assigned in 1979 to the experimental internet stream protocol, which however has never been called ipv5.) learn more general knowledge ipv4 on wikipedia ...
IRC - MDN Web Docs Glossary: Definitions of Web-related terms
irc (internet relay chat) is a worldwide chat system requiring an internet connection and an irc client, which sends and receives messages via the irc server. designed in the late 1980s by jarrko oikarinen, irc uses tcp and is an open protocol. the irc server broadcasts messages to everyone connected to one of many irc channels (each with their own id). ...
ISP - MDN Web Docs Glossary: Definitions of Web-related terms
an isp (internet service provider) sells internet access, and sometimes email, web hosting, and voice over ip, either by a dial-up connection over a phone line (formerly more common), or through a broadband connection such as a cable modem or dsl service. learn more general knowledge how the internet works (explanation for beginners) internet service provider on wikipedia ...
Idempotent - MDN Web Docs Glossary: Definitions of Web-related terms
/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 ...
Node (networking) - MDN Web Docs Glossary: Definitions of Web-related terms
in physical networks, a node is usually a device, like a computer or a router. ...
Node - MDN Web Docs Glossary: Definitions of Web-related terms
the term node can have several meanings depending on the context. it may refer to: node (dom) in the context of the dom, a node is a single point in the node tree. various things that are nodes are the document itself, elements, text, and comments. node (networking) in networking, a node is a connection point in the network. in physical networks, a node is usually a device, like a computer or a router. another use of the word is when talking about node.js ...
OTA - MDN Web Docs Glossary: Definitions of Web-related terms
all device owners receiving a given set of updates are on the same "channel", and each device often can access several channels (e.g. for production or engineering builds). ...
P2P - MDN Web Docs Glossary: Definitions of Web-related terms
p2p (peer-to-peer) is a computer networking architecture in which all participating nodes (peers) have equal privileges and share the workload. p2p differs from a client-server network architecture, where multiple client nodes connect to centralized servers for services. p2p is commonly found in blockchain applications. learn more general knowledge p2p on wikipedia ...
POP3 - MDN Web Docs Glossary: Definitions of Web-related terms
pop3 does not support folders, unlike the more recent imap4, which is harder to implement because of its more complex structure. ...
Port - MDN Web Docs Glossary: Definitions of Web-related terms
ports are designated by numbers, and below 1024 each port is associated by default with a specific protocol. for example, the default port for the http protocol is 80 and the default port for the https protocol is 443, so a http server waits for requests on those ports. each internet protocol is associated with a default port: smtp (25), pop3 (110), imap (143), irc (194), and so on. ...
Preflight request - MDN Web Docs Glossary: Definitions of Web-related terms
...
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
flight requests. ...
Response header - MDN Web Docs Glossary: Definitions of Web-related terms
example, the content-length header is an entity header referring to the size of the body of the response message. however, these entity requests are usually called responses headers in such a context. the following shows a few response headers after a get request. ...
SCTP - MDN Web Docs Glossary: Definitions of Web-related terms
it's used for sending traditional telephone calls over the internet, but is also used for webrtc data. learn more general knowledge rfc 4960: stream control transmission protocol stream control transmission protocol on wikipedia ...
SDP - MDN Web Docs Glossary: Definitions of Web-related terms
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. ...
STUN - MDN Web Docs Glossary: Definitions of Web-related terms
stun (session traversal utilities for nat) is an auxiliary protocol for transmitting data around a nat (network address translator). stun returns the ip address, port, and connectivity status of a networked computer behind a nat. learn more general knowledge stun on wikipedia webrtc protocols technical reference specification ...
TCP - MDN Web Docs Glossary: Definitions of Web-related terms
tcp guarantees the delivery of data and packets in the same order as they were sent. vint cerf and bob kahn, who were darpa scientists at the time, designed tcp in the 1970s. tcp role is to ensure the packets are reliably delivered, error free. ...
TOFU - MDN Web Docs Glossary: Definitions of Web-related terms
if no identifier is found, the client can prompt the user to determine if the client should trust the identifier. ...
TURN - MDN Web Docs Glossary: Definitions of Web-related terms
turn (traversal using relays around nat) is a protocol enabling a computer to receive and send data from behind a network address translator (nat) or firewall. turn is used by webrtc to allow any two devices on the internet to enter a peer-to-peer connection. learn more general knowledge turn on wikipedia webrtc protocols technical reference specification specification update for ipv6 ...
UDP (User Datagram Protocol) - MDN Web Docs Glossary: Definitions of Web-related terms
udp provides checksums for data integrity, and port numbers for addressing different functions at the source and destination of the datagram. ...
VoIP - MDN Web Docs Glossary: Definitions of Web-related terms
it voice messages over ip (internet protocol) networks. common voip packages include skype, msn messenger, yahoo and many more. everything transferrred through voip is digital. it is also known as ip telephony, or broadband telephony. the main reason for using voip technology is because of cost. voip allows you to make a call directly from a computer, a special voip phone, or a traditional phone connected to a special adapter. a high speed internet connection is required for voip. usually, telephone calls over the internet do not incur further charges beyond what the user is paying for internet access, much in the same way that the user doesn't pay for sending individual emails over the internet. learn more general knowledge voip on wikipedia ...
WebRTC - MDN Web Docs Glossary: Definitions of Web-related terms
webrtc (web real-time communication) is an api that can be used by video-chat, voice-calling, and p2p-file-sharing web apps. webrtc consists mainly of these parts: getusermedia() grants access to a device's camera and/or microphone, and can plug in their signals to a rtc connection. rtcpeerconnection an interface to configure video chat or voice calls. rtcdatachannel provides a method to set up a peer-to-peer data pathway between browsers. learn more webrtc on wikipedia webrtc api on mdn browser support for webrtc ...
WebSockets - MDN Web Docs Glossary: Definitions of Web-related terms
any client or server application can use websocket, but principally web browsers and web servers. through websocket, servers can pass data to a client without prior client request, allowing for dynamic content updates. ...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
} } else if (href.match(/#$/, '') || href.match(/^#/, '')) { alert('fragment identifiers are disallowed in an xinclude "href" attribute'); return false; } var j; var xincludeparent = xinclude.parentnode; try { netscape.security.privilegemanager.enableprivilege('universalxpconnect universalbrowserread'); // necessary with file:///-located files trying to reach external sites if (href !== null) { var response, responsetype; var request = new xmlhttprequest(); request.open('get', href, false); request.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); ...
firewall - MDN Web Docs Glossary: Definitions of Web-related terms
a firewall is a system that filters network traffic. it can either let it pass or block it, according to some specified rules. for example, it can block incoming connections aimed at a certain port or outgoing connections to a certain ip address. firewalls can be as simple as a single piece of software, or more complex, like a dedicated machine whose only function is to act as a firewall. learn more general knowledge firewall (computing) on wikipedia ...
HTTPS - MDN Web Docs Glossary: Definitions of Web-related terms
https (hypertext transfer protocol secure) is an encrypted version of the http protocol. it uses ssl or tls to encrypt all communication between a client and a server. this secure connection allows clients to safely exchange sensitive data with a server, such as when performing banking activities or online shopping. ...
Time to first byte - MDN Web Docs Glossary: Definitions of Web-related terms
time to first byte (ttfb) refers to the time between the browser requesting a page and when it receives the first byte of information from the server. this time includes dns lookup and establishing the connection using a tcp handshake and ssl handshake if the request is made over https. ttfb is the time it takes between the start of the request and the start of the response, in milliseconds: ttfb = responsestart - requeststart see also: a typical http session performanceresourcetiming performancetiming ...
MDN Web Docs Glossary: Definitions of Web-related terms
document environment dom (document object model) domain domain name domain sharding dominator dos attack dtls (datagram transport layer security) dtmf (dual-tone multi-frequency signaling) dynamic programming language dynamic typing e ecma ecmascript effective connection type element empty element encapsulation encryption endianness engine entity entity header event exception expando f fallback alignment falsy favicon fetch directive fetch metadata request header firefox os firewall ...
About Scriptable Interfaces - Interfaces
utside 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 other scripts languages are supported by xpconnect. python there's an extension extensions/python that bridges the gap between xpcom and python, allowing scriptable interfaces to be used/implemented from/in python scripts. ...
HTML: A good basis for accessibility - Learn web development
-> <footer> <!-- footer content in here --> </footer> if you try our more modern structure example with a screen reader, you'll see that the layout markup no longer gets in the way and confuses the content readout. it is also much leaner and smaller in terms of code size, which means easier to maintain code, and less bandwidth for the user to download (particularly prevalent for those on slow connections). another consideration when creating layouts is using html5 semantic elements as seen in the above example (see content sectioning) — you can create a layout using only nested <div> elements, but it is better to use appropriate sectioning elements to wrap your main navigation (<nav>), footer (<footer>), repeating content units (<article>), etc. these provide extra semantics for screen rea...
HTML: A good basis for accessibility - Learn web development
-> <footer> <!-- footer content in here --> </footer> if you try our more modern structure example with a screen reader, you'll see that the layout markup no longer gets in the way and confuses the content readout. it is also much leaner and smaller in terms of code size, which means easier to maintain code, and less bandwidth for the user to download (particularly prevalent for those on slow connections). another consideration when creating layouts is using html5 semantic elements as seen in the above example (see content sectioning) — you can create a layout using only nested <div> elements, but it is better to use appropriate sectioning elements to wrap your main navigation (<nav>), footer (<footer>), repeating content units (<article>), etc. these provide extra semantics for screen rea...
Mobile accessibility - Learn web development
on a narrow screen, for example, and the text size may need to be increased so it is legible. such issues can be solved by creating a responsive layout using technologies such as media queries, viewport, and flexbox. conserving image sizes downloaded. in general, small screen devices won't need images that are as large as their desktop counterparts, and they are more likely to be on slow network connections. therefore, it is wise to serve smaller images to narrow screen devices as appropriate. you can handle this using responsive image techniques. thinking about high resolutions. many mobile devices have high-resolution screens, and therefore need higher-resolution images so that the display can continue to look crisp and sharp. again, you can serve images as appropriate using responsive image ...
Accessible multimedia - Learn web development
urces are provided along with the audio + transcript, and specifically link to them in the places where they are referred to in the transcript. this of course will help all users, not just people who are deaf. note: an audio transcript will in general help multiple user groups. as well as giving deaf users access to the information contained in the audio, think about a user with a low bandwidth connection, who would find downloading the audio inconvenient. think also about a user in a noisy environment like a pub or bar, who is trying to access the information but can't hear it over the noise. video text tracks to make video accessible for deaf, blind, or even other groups of users (such as those on low bandwidth, or who don't understand the language the video is recorded in), you need to in...
Sizing items in CSS - Learn web development
they scale down appropriately. you should, however, not use this technique to load really large images and then scale them down in the browser. images should be appropriately sized to be no larger than they need to be for the largest size they are displayed in the design. downloading overly large images will cause your site to become slow, and it can cost users more money if they are on a metered connection. note: find out more about responsive image techniques. viewport units the viewport — which is the visible area of your page in the browser you are using to view a site — also has a size. in css we have units which relate to the size of the viewport — the vw unit for viewport width, and vh for viewport height. using these units you can size something relative to the viewport of the ...
CSS FAQ - Learn web development
Learn › CSS › Howto › CSS FAQ
ly have element to style with that style, but you might want to add more later. use an id-specific style when you need to restrict the applied styling rules to one specific block or element. this style will only be used by the element with that particular id. it is generally recommended to use classes as much as possible, and to use ids only when absolutely necessary for specific uses (like to connect label and form elements or for styling elements that must be semantically unique): using classes makes your styling extensible — even if you only have one element to style with a particular ruleset now, you might want to add more later. classes allow you to style multiple elements, therefore they can lead to shorter stylesheets, rather than having to write out the same styling information i...
Fundamental text and font styling - Learn web development
the flourishes and other small details you see at the ends of the strokes in some typefaces) my big red elephant sans-serif fonts that don't have serifs. my big red elephant monospace fonts where every character has the same width, typically used in code listings. my big red elephant cursive fonts that are intended to emulate handwriting, with flowing, connected strokes. my big red elephant fantasy fonts that are intended to be decorative. my big red elephant font stacks since you can't guarantee the availability of the fonts you want to use on your webpages (even a web font could fail for some reason), you can supply a font stack so that the browser has multiple fonts it can choose from. this simply involves a font-family val...
What text editors are available? - Learn web development
ing system) do i want to work with? what kind of technologies do i want to manipulate? what kind of basic features do i expect from my text editor? do i want to add extra features to my text editor? do i need support/help while using my text editor? does my text editor's look-and-feel matter to me? notice we didn't mention price. obviously, that matters too, but a product's cost has little connection with its quality or capability. there's a big chance you'll find a suitable text editor for free. here are some popular editors: editor licence price os support doc. extensible atom mit/bsd free windows, mac, linux forum online manual yes bluefish gpl 3 free windows, mac, linux mailing list, wiki online manual ...
How do you make sure your website works properly? - Learn web development
along the way! frequent errors the most frequent errors that we find are these: typos in the address we wanted to type http://demozilla.examplehostingprovider.net/ but typed too fast and forgot an “l”: the address cannot be found. indeed. 404 errors many times the error just results just from a typo, but sometimes maybe you either forgot to upload a resource or you lost your network connection while you were uploading your resources. first check the spelling and accuracy of the file path, and if there's still a problem, upload your files again. that will likely fix the problem. javascript errors someone (possibly you) added a script to the page and made a mistake. this will not prevent the page from loading but you will feel something went wrong. open the console (tools ➤ web d...
What is the difference between webpage, website, web server, and search engine? - Learn web development
ese terms and technologies in more detail as we explore further, but these quick definitions will be a great start for you: web page a document which can be displayed in a web browser such as firefox, google chrome, opera, microsoft internet explorer or edge, or apple's safari. these are also often called just "pages." website a collection of web pages which are grouped together and usually connected together in various ways. often called a "web site" or simply a "site." web server a computer that hosts a website on the internet. search engine a web service that helps you find other web pages, such as google, bing, yahoo, or duckduckgo. search engines are normally accessed through a web browser (e.g. you can perform search engine searches directly in the address bar of firefox, chrome, ...
What is accessibility? - Learn web development
ause 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 accessibility include: whenever your site needs an image to convey meaning, include text as an alternative for visually-challenged users or those with slow connections. make sure all users can operate graphical interfaces (like unfolding menus) solely with a keyboard (e.g., with tab and the return key). provide an attribute explicitly specifying your content's language, so that screen readers read your text properly. make sure that a user can navigate to all widgets on a page solely with the keyboard, without getting trapped. (at least let them tab in an...
What software do I need to build a website? - Learn web development
web when your website is ready for public viewing, you'll have to upload your webpages to your web server. you can buy space on a server from various providers (see how much does it cost to do something on the web?). once you settle on which provider to use, the provider will email you the access information, usually in the form of an sftp url, username, password, and other information needed to connect to their server. bear in mind that (s)ftp is now somewhat old-fashioned, and other uploading systems are starting to become popular, such as rsync and git/github. note: ftp is inherently insecure. you should make sure your hosting provider allows use of a secure connection, e.g. sftp or rsync over ssh. uploading files to a web server is a very important step while creating a website, so we co...
Basic native form controls - Learn web development
it can't be easily read by others. keep in mind this is just a user interface feature; unless you submit your form securely, it will get sent in plain text, which is bad for security — a malicious party could intercept your data and steal passwords, credit card details, or whatever else you've submitted. the best way to protect users from this is to host any pages involving forms over a secure connection (i.e. at an https:// ... address), so the data is encrypted before it is sent. browsers recognize the security implications of sending form data over an insecure connection, and have warnings to deter users from using insecure forms. for more information on what firefox implements, see insecure passwords. hidden content another original text control is the hidden input type. this is used to...
Front-end web developer - Learn web development
ctionality on the web tooling that is used to facilitate modern client-side web development. you can work through sections in order, but each one is also self-contained. for example, if you already know html, you can skip ahead to the css section. prerequisites you don't need any previous knowledge to start this course. all you need is a computer that can run modern web browsers, an internet connection, and a willingness to learn. if you are not sure if front-end web development is for you, and/or you want a gentle introduction before starting a longer and more complete course, work through our getting started with the web module first. getting help we have tried to make learning front-end web development as comfortable as possible, but you will probably still get stuck because you don't ...
Publishing your website - Learn web development
a.org or http://www.bbc.co.uk. you can rent your domain name for as many years as you want from a domain registrar. many professional websites go online this way. in addition, you will need a file transfer protocol (ftp) program (see how much does it cost: software for more details) to actually transfer the website files over to the server. ftp programs vary widely, but generally, you have to connect to your web server using details provided by your hosting company (typically username, password, hostname). then the program shows you your local files and the web server's files in two windows, and provides a way for you to transfer files back and forth. tips for finding hosting and domains mdn does not promote specific commercial hosting companies or domain name registrars. to find hostin...
The web and web standards - Learn web development
t kinds of people as possible (related concepts are diversity and inclusion, and inclusive design). this includes people with visual impairments, hearing impairments, cognitive disabilities, or physical disabilities. it also goes beyond people with disabilities — how about young or old people, people from different cultures, people using mobile devices, or people with unreliable or slow network connections? internationalization means making websites usable by people from different cultures, who speak different languages to your own. there are technical considerations here (such as altering your layout so that it still works ok for right-to-left, or even vertical languages), and human ones (such as using simple, non-slang language so that people who have your language as their second or third l...
Creating hyperlinks - Learn web development
it will perform less efficiently. linking to non-html resources — leave clear signposts when linking to a resource that will be downloaded (like a pdf or word document), streamed (like video or audio), or has another potentially unexpected effect (opens a popup window, or loads a flash movie), you should add clear wording to reduce any confusion. for example: if you're on a low bandwidth connection, click a link, and then a multiple megabyte download starts unexpectedly. if you don't have the flash player installed, click a link, and then suddenly get taken to a page that requires flash. let's look at some examples, to see what kind of text can be used here: <p><a href="http://www.example.com/large-report.pdf"> download the sales report (pdf, 10mb) </a></p> <p><a href="http://www.
Getting started with HTML - Learn web development
ot a programming language. it is a markup language that tells web browsers how to structure the web pages you visit. it can be as complicated or as simple as the web developer wants it to be. html consists of a series of elements, which you use to enclose, wrap, or mark up different parts of content to make it appear or act in a certain way. the enclosing tags can make content into a hyperlink to connect to another page, italicize words, and so on. for example, consider the following line of text: my cat is very grumpy if we wanted the text to stand by itself, we could specify that it is a paragraph by enclosing it in a paragraph (<p>) element: <p>my cat is very grumpy</p> note: tags in html are case-insensitive. this means they can be written in uppercase or lowercase. for example, a <tit...
Images in HTML - Learn web development
le), 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 misspell your filename. if for example our image name was spelled dinosooooor.jpg, the browser wouldn't display the image, and would display the a...
From object to iframe — other embedding technologies - Learn web development
embedded in a master document called a frameset, which allowed you to specify the area on the screen that each frame filled, rather like sizing the columns and rows of a table. these were considered the height of coolness in the mid to late 90s, and there was evidence that having a webpage split up into smaller chunks like this was better for download speeds — especially noticeable with network connections being so slow back then. they did however have many problems, which far outweighed any positives as network speeds got faster, so you don't see them being used anymore. a little while later (late 90s, early 2000s), plugin technologies became very popular, such as java applets and flash — these allowed web developers to embed rich content into webpages such as videos and animations, which j...
HTML table basics - Learn web development
Learn › HTML › Tables › Basics
ow to group together all the cells in a column for styling purposes. prerequisites: the basics of html (see introduction to html). objective: to gain basic familiarity with html tables. what is a table ? a table is a structured set of data made up of rows and columns (tabular data). a table allows you to quickly and easily look up values that indicate some kind of connection between different types of data, for example a person and their age, or a day of the week, or the timetable for a local swimming pool. tables are very commonly used in human society, and have been for a long time, as evidenced by this us census document from 1800: it is therefore no wonder that the creators of html provided a means by which to structure and present tabular data on the ...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
interestingly, it is available in internet explorer 10 and above. so, unless you need to support older versions of ie, there is little reason to not use requestanimationframe(). a simple example enough with the theory! let's build your own personal requestanimationframe() example. you're going to create a simple "spinner animation"—the kind you might see displayed in an app when it is busy connecting to the server, etc. note: in a real world example, you should probably use css animations to run this kind of simple animation. however, this kind of example is very useful to demonstrate requestanimationframe() usage, and you'd be more likely to use this kind of technique when doing something more complex such as updating the display of a game on each frame. grab a basic html templat...
Introduction to events - Learn web development
ers to use javascript to build network and server-side applications. the node.js event model relies on listeners to listen for events and emitters to emit events periodically — it doesn't sound that different, but the code is quite different, making use of functions like on() to register an event listener, and once() to register an event listener that unregisters after it has run once. the http connect event docs provide a good example. you don't need to understand anything about other such environments at this stage in your learning; we just wanted to make it clear that events can differ in different programming environments. ways of using web events there are a number of ways to add event listener code to web pages so it runs when the associated event fires. in this section, we review the ...
Fetching data from the server - Learn web development
ding information, like the header, footer, navigation menu, etc., will stay the same. this is a really good thing because: page updates are a lot quicker and you don't have to wait for the page to refresh, meaning that the site feels faster and more responsive. less data is downloaded on each update, meaning less wasted bandwidth. this may not be such a big issue on a desktop on a broadband connection, but it's a major issue on mobile devices and in developing countries that don't have ubiquitous fast internet service. to speed things up even further, some sites also store assets and data on the user's computer when they are first requested, meaning that on subsequent visits they use the local versions instead of downloading fresh copies when the page is first loaded. the content is only ...
Introduction to web APIs - Learn web development
.creategain() method, which can be used to adjust the volume of audio fed through it, and create another event handler that changes the value of the audio graph's gain (volume) whenever the slider value is changed: const gainnode = audioctx.creategain(); volumeslider.addeventlistener('input', function() { gainnode.gain.value = this.value; }); the final thing to do to get this to work is to connect the different nodes in the audio graph up, which is done using the audionode.connect() method available on every node type: audiosource.connect(gainnode).connect(audioctx.destination); the audio starts in the source, which is then connected to the gain node so the audio's volume can be adjusted. the gain node is then connected to the destination node so the sound can be played on your computer ...
Web performance resources - Learn web development
there are many reasons why your website should perform as well as possible. below is a quick review of best practices, tools, apis with links to provide more information about each topic. best practices start with learning the critical rendering path of the browser. knowing this will help you understand how to improve the performance of the site. using resource hints such as rel=preconnect, rel=dns-prefetch, rel=prefetch, and rel=preload keep the size of javascript to a minimum. only use as much javascript as needed for the current page. css performance factors use http/2 on your server (or cdn). use a cdn for resources which can reduce load times significantly. compress your resources using gzip, brotli, and zopfli. image optimization (use css animation, or svg if possible). lazy l...
Server-side web frameworks - Learn web development
tructured mvc web applications. restful routes, plugins, commands, perl-ish templates, content negotiation, session management, form validation, testing framework, static file server, cgi/psgi detection, and first-class unicode support. a full-stack http and websocket client/server implementation with ipv6, tls, sni, idna, http/socks5 proxy, unix domain socket, comet (long polling), keep-alive, connection pooling, timeout, cookie, multipart, and gzip compression support. json and html/xml parsers and generators with css selector support. very clean, portable and object-oriented pure-perl api with no hidden magic. fresh code based upon years of experience, free and open-source. spring boot (java) spring boot is one of a number of projects provided by spring. it is a good starting point for...
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
nd javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to continue our learning about components classes, start looking at conditional rendering, and wire up some of our footer functionality. connecting the behavior in the footer to get the footer working, we need to implement the following thre areas of functionality: a pending todo counter. filters for all, active, and completed todos. a button to clear the completed todos. because we need access to our service from the footer component, we need to generate a class for the footer. enter the following terminal command to do s...
Ember app structure and componentization - Learn web development
class, run `ember generate component-class header` installing component-test create tests/integration/components/header-test.js header.hbs is the template file where we’ll include the html structure for just that component. later on we'll add the required dynamic functionality such as data bindings, responding to user interaction, etc. note: the header.js file (shown as skipped) is for connection to a backing glimmer component class, which we don't need for now, as they are for adding interactivity and state manipulation. by default, generate component generates template-only components, because in large applications, template-only components end up being the majority of the components. header-test.js is for writing automated tests to ensure that our app continues to work over time a...
Getting started with Svelte - Learn web development
face or whole applications. you can either start from scratch letting svelte drive your ui or you can incrementally integrate it into an existing application. nevertheless, svelte is particularly appropriate to tackle the following situations: web applications intended for low power devices: applications built with svelte have smaller bundle sizes, which is ideal for devices with slow network connections and limited processing power. less code means less kb to download, parse, execute, and keep hanging around in memory. highly interactive pages or complex visualizations: if you are building data-visualizations that need to display a large number of dom elements, the performance gains that come from a framework with no runtime overhead will ensure that user interactions are snappy and respons...
Styling Vue components with CSS - Learn web development
to the root <div>, add a custom-checkbox class. to the <input>, add a checkbox class. last of all, to the <label> add a checkbox-label class. the updated template is below: the app should now have custom checkboxes. your app should look something like the screenshot below. summary our work is done on the styling of our sample app. in the next article we'll return to adding some ...
Handling common accessibility problems - Learn web development
ibility is pretty much impossible to achieve for all content, especially as sites get more complex. instead, it is more about making a reasonable effort to make as much of your content accessible to as many people as possible via defensive coding and sticking to best practices. common accessibility issues in this section we'll detail some of the main issues that arise around web accessibility, connected with specific technologies, along with best practices to follow, and some quick tests you can do to see if your sites are going in the right direction. note: accessibility is morally the right thing to do, and good for business (numbers of disabled users, users on mobile devices, etc. present significant market segments), but it is also a legal requirement in many parts of the world to make w...
Handling common HTML and CSS problems - Learn web development
e device, so you need to provide a suitable mobile layout using media queries, and make sure it is applied correctly using viewport. you can find a detailed account of such practices in the building blocks of responsive design. resolution is a big issue too — for example, mobile devices are less likely to need big heavy images than desktop computers, and are more likely to have slower internet connections and possibly even expensive data plans that make wasted bandwidth more of a problem. in addition, different devices can have a range of different resolutions, meaning that smaller images could appear pixellated. there are a number of techniques that allow you to work around such problems, from simple mobile first media queries, to more complex responsive image techniques. another difficulty ...
Handling common JavaScript problems - Learn web development
is appearing in recent browsers, which don't work in older browsers, for example: indexeddb api, web storage api, and others for storing website data on the client-side. web workers api for running javascript in a separate thread, helping to improve performance. webgl api for real 3d graphics. web audio api for advanced audio manipulation. webrtc api for multi-person, real-time video/audio connectivity (e.g. video conferencing). there are a few strategies for handling incompatibilities between browsers relating to feature support; let's explore the most common ones. note: these strategies do not exist in separate silos — you can, of course combine them as needed. for example, you could use feature detection to determine whether a feature is supported; if it isn't, you could then run ...
Setting up your own test automation environment - Learn web development
.forbrowser('firefox') .usingserver('http://localhost:4444/wd/hub') .build(); run your test, and you should see it run as expected; this time however you will be runing it on the standalone server: node google_test_remote.js so this is pretty cool. we have tested this locally, but you could set this up on just about any server along with the relevant browser drivers, and then connect your scripts to it using the url you choose to expose it at. integrating selenium with ci tools as another point, it is also possible to integrate selenium and related tools like lambdatest, and sauce labs with continuous integration (ci) tools — this is useful, as it means you can run your tests via a ci tool, and only commit new changes to your code repository if the tests pass. it is out ...
Introducing a complete toolchain - Learn web development
to deploy our test app to. once you've signed up for github (click the sign up link on the homepage if you don't already have an account, and follow the instructions), you can use your github account for authentication on netlify (click sign up, then choose github from the "sign up with one of the following" list), so technically you only need to create one new account. later on you'll need to connect your netlify account to your github repository to deploy this project; we'll see how to do that in the next chapter. three stages of tools as we talked about in chapter 1, the toolchain will be structured into the following phases: safety net: making the software development experience stable and more efficient. we might also refer to this as our development environment. transformation: too...
Android-specific test suites
for android — either a full build or an artifact build. all of the suites are configured by and invoked using gradle. android-test runs android-specific local unit tests. these tests are local — they run on your development machine and do not require an android device or android emulator. local unit tests are the fastest to develop and execute, but they can only test java code; there's no connection to the gecko rendering engine. use these to test java data structures and logic, and to ensure that basic android integration works. they should always be preferred to on-device robocop tests. see https://developer.android.com/training/testing/unit-testing/local-unit-tests.html for more details. running android-test to run android-test, first build firefox for android with your changes; the...
What to do and what not to do in Bugzilla
erent product or component it should be reassigned. when performing bug reassignments, keep the following things in mind: always remember to check the reassign to default owner and qa contact radio button under the comment textbox. mozilla applications like the application suite, thunderbird, or firefox share most of their program code and all of the backend code including things like network connectivity (ftp, http, imap) and html rendering. make sure that you also test thunderbird or firefox bugs with the application suite and move the bug to one of the core products, if the bug also exists in the application suite. if you don't know where a bug belongs, don't touch it! for example, don't move bugs into the js engine component unless you really know they are js engine bugs, and don't leave...
Creating JavaScript callbacks in components
tion: function doload(event) { // do something here } window.addeventlistener("load", doload, false); revealing the magic how is this possible? is nsidomeventlistener magical? well, it actually is a little magical. but you can use the same magic in your own idl callbacks. the nsidomeventlistener interface is "marked" with the function attribute. see it here. the function attribute tells the xpconnect machinery to treat the javascript function as if it was an implementation of the callback interface. note, that since the javascript function is a single method, this magic only works for callback interfaces with a single method, like nsidomeventlistener. the javascript function is passed the same arguments as defined by the callback method. so we could convert the example above to accept javascr...
Capturing a minidump
install debugging tools for windows microsoft distributes the debugging tools for windows for free, those include windbg which you will need here. download it from install debugging tools for windows. (you'll want the 32-bit version of windbg only if you are using a 32-bit version of firefox) then install it, the standard settings in the installation process are fine. capture a minidump connect firefox to the debugger. if firefox is not already running, then open windbg from the start menu (start->all programs->debugging tools for windows->windbg). next, open the "file" menu and choose "open executable...". in the file chooser window that appears, open the firefox.exe executable in your firefox program folder (c:\program files\mozilla firefox). if firefox is al...
Debugging JavaScript
out:config and set the following two prefs: devtools.chrome.enabled: true devtools.debugger.remote-enabled: true after you restart the browser, you can access the browser debugger through tools > web developer > browser toolbox. (note that before firefox 28, this was labeled "browser debugger" and only the debugger was available, not the whole toolbox.) note that you must accept the incoming connection : (you may disable the pop-up above with the devtools.debugger.prompt-connection set to false in about:config. this can be a security risk, especially if you also set the devtools.debugger.force-local preference to false.) then, the browser toolbox displays the available tools for debugging. (note that before firefox 28, only the script debugger was available.) the use of these tools are t...
Simple Thunderbird build
, development version of thunderbird 60 or later. for thunderbird up to 59, see the old build documentation. for additional, more detailed information, see the build documentation. hardware requirements at least 4 gb of ram. 8 gb or more is recommended. while you can build thunderbird on older hardware it can take quite a bit of time to compile on slower machines with less ram. good internet connection for the initial source download. build prerequisites depending on your operating system you will need to carry out a different process to prepare your machine. so firstly complete the instructions for your os and then continue following these build instructions. windows build prerequisites gnu/linux build prerequisites macos build prerequisites mapi headers on windows: check that th...
pymake
e and add the following line in the file (assuming your mozilla-central is at c:/mozilla-central, if not, adjust your path accordingly.) alias pymake=c:/mozilla-central/build/pymake/make.py save your .profile edit and close the shell, then restart the shell. try typing just pymake into the shell and press enter. this should come back with "no makefile found." if it does, your pymake alias is connected and you are ready to type in pymake -f client.mk to start the build. unlike gmake on windows, pymake is capable of doing parallel builds, so you can set a moz_make_flags=-jn in your .mozconfig without risk of deadlocks. note: on windows, if using an absolute path moz_objdir in your .mozconfig, it must be a windows-style (i.e. c:/foo/bar) rather than an msys-style (i.e. /c/foo/bar) path. ...
Eclipse CDT
l workspace preferences section. either set those, or else refresh the project (or an individual directory/file) manually using the refresh item from the context menu in the project explorer tab. old everything that follows is old content that should maybe just be deleted now? gdb timeouts i don't think this old comment from 2007/2008 is an issue anymore. out of the box, you may/will get gdb connection timeouts. this is because eclipse is trying to push every subfolder in gdb's environment. the easiest way to resolve this issue is to remove any source entry from the debug configuration (run->open debug dialog...) in the source tab. doing so will, unfortunately, remove the binding between the binaries and the source code. to keep this feature working, you need to add a "path mapping" by click...
Experimental features in Firefox
in the address bar next to the traditional lock icon when a page is loaded insecurely (that is, using http rather than https). see bug 1335970 for more details. release channel version added enabled by default? nightly 60 no developer edition 60 no beta 60 no release 60 no preference name security.insecure_connection_text.enabled for normal browsing mode; security.insecure_connection_text.pbmode.enabled for private browsing mode upgrading mixed display content when enabled, this preference causes firefox to automatically upgrade requests for media content from http to https on secure pages. the intent is to prevent mixed-content conditions in which some content is loaded securely while other conten...
mozbrowsersecuritychange
non-standard this feature is non-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 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 whe...
Script security
ull principal fails almost all security checks. it has no privileges and can't be accessed by anything but itself and chrome. it subsumes no other principals, even other null principals. (this is what is used when html5 and other specs say "origin is a globally unique identifier".) principal relationships the diagram below summarizes the relationships between the different principals. the arrow connecting principals a and b means "a subsumes b". (a is the start of the arrow, and b is the end.) computing a wrapper the following diagram shows the factors that determine the kind of wrapper that compartment a would get when trying to access an object in compartment b. ...
Geckoview-Junit Tests
the geckoview-junit tests are on-device android junit tests written for geckoview. by default, tests are from org.mozilla.geckoview.test. these tests run on an android device, controlled by a host (typically linux) using mozdevice (adb). in automation, tests normally run in an android emulator. running tests locally if desired, connect an android device to your computer, or start an emulator, and make sure your device is visible to adb: $ adb devices list of devices attached emulator-5554 device if no device is found, 'mach geckoview-junit' will offer to start an emulator. before running tests, install the androidtest apk on your device; otherwise, 'mach geckoview-junit' will offer to install it. mozilla-central$ mach install --app org.mozilla.geckoview.test to run all tests:...
How to get a stacktrace with WinDbg
illa symbol server. to load the symbols, enter the three commands below, pressing enter after each one. (more details are available at using the mozilla symbol server.) .sympath srv*c:\symbols*http://symbols.mozilla.org/firefox;srv*c:\symbols*http://msdl.microsoft.com/download/symbols .symfix+ c:\symbols .reload /f now wait for the symbols to download. this may take some time depending on your connection speed; the total size of the mozilla and microsoft symbols download is around 1.4gb. windbg will show "busy" at the bottom of the application window until the download is complete. once the download is complete, you need to configure windbg to examine child processes, ignore a specific event caused by flash player, and record a log of loaded modules. you will also want to open a log file to s...
IME handling guide
ng has a wavy underline and the only one clause is called "raw input clause"). when a user presses convert key, japanese ime separates the composition string as "わたしの" (my), "なまえは" (name is) and "なかのです" (nakano). then, converts each clause with chinese characters: "私の", "名前は" and "中野です" (in the following screenshot each clause is underlined and not connected adjacently. these clauses are called "converted clause"). if one or more clauses were not converted as expected, the user can choose one of the clauses with arrow keys and look for the expected result form the list in the drop down menu (in the following screenshot, the clause with the thicker underline is called "selected clause"). basically, composition string and each clause style is r...
Internationalized Domain Names (IDN) Support in Mozilla Browsers
to implement standardized support for handling non-ascii characters in domain names. how idn works when a browser sees a host name such as http://developer.mozilla.org, it passes a request to the dns resolver service (usually built into an os), which in turn sends a request to a nearest domain name server to return an ip address that corresponds to the host name. this ip address is then used to connect to the web server in question. idn allows host/domain names with non-ascii characters for user input into a browser's location bar or url's embedded in web pages. at the network protocol level, there is no change in the restriction that only a subset of ascii characters be used in url/uri. if end users input non-ascii characters as part of a domain name or if a web page contains a link using a n...
OS.File for the main thread
unspecified, return immediately once the write is complete. if true, before writing, force the operating system to write its internal disk buffers to the disk. this is considerably slower (not just for the application but for the whole system) and more battery expensive but also safer: if the system shuts down improperly (typically due to a kernel freeze or a power failure) or if the device is disconnected before the buffer is flushed, the file has more chances of not being corrupted. backupto available since firefox 30. if specified, backup the destination file as backupto. note that this function renames the destination file before overwriting it. if the process or the operating system freezes or crashes during the short window between these operations, the destination file will have been mov...
PromiseWorker.jsm
self.addeventlistener('message', msg => worker.handlemessage(msg)); abstractworker is a base class for the worker, and it's designed to be used by derived class, which provides above four methods (dispatch, postmessage, close, and log). but you can instantiate abstractworker itself and set its properties later, instead of creating derived class. main thread file the basepr...
Webapps.jsm
p: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: function() loadandupdateapps: function() updatedatastore: function(aid, aorigin, amanifesturl, amanifest) _registersystemmessagesforentrypoint: function(amanifest, aapp, aentrypoint) _registerinterappconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterappconnections: function(amanifest, aapp) _createactivitiestoregister: function(amanifest, aapp, aentrypoint, arunupdate) _registeractivitiesforapps: function(aappstoregister, arunupdate) _registeractivities: function(amanifest, aapp, arunupdate) _createactivitiestounregister: funct...
Bootstrapping a new locale
wser) $ edit ab-cd/browser/chrome/browser/aboutcerterror.dtd read the top of the file to get any context on how to translate contained in the notes written by the developers or l10n-drivers. localization notes will look like this: <!-- localization notes... --> after the localization notes, you will see a list of <!entity> strings like the following: <!entity certerror.pagetitle "untrusted connection"> you should go through each entity, translating the value in the parameters (e.g. untrusted connection in the example above), like so (example for polish): <!entity certerror.pagetitle "niezaufane połączenie"> once you have translated all the <!entity> strings in this file, you should save your work and open the next .dtd or .property file. you will need to go through each and every f...
Localization content best practices
so update all instances where that entity or property name is used in the source code, including localization comments. if you change the entity or property name of a string, and the string has an accompanying access key, command key, or tooltip, you should update their names as well for consistency. this change is fundamental for access keys, since many localization tools use the entity name to connect an access key to its label. for example, to check if it's using a character not available in the original string, given entities "usebookmark.label" and "usebookmark.accesskey", if you change to "choosebookmark.label" due to a string change, change the access key entity to "choosebookmark.accesskey" to match it. string freeze some repositories are considered to be string-frozen. this means that...
Localizing without a specialized tool
mozilla-1.9.2/x-testing/browser/chrome/browser/aboutcerterror.dtd read the top of the file to get any context on how to translate contained in the notes written by the developers or l10n-drivers. localization notes will look like this: <!-- localization notes... --> after the localization notes, you will see a list of <!entity> strings like the following: <!entity certerror.pagetitle "untrusted connection"> you should go through each entity, translating the value in the parameters (e.g. untrusted connection in the example above), like so (example for polish): <!entity certerror.pagetitle "niezaufane połączenie"> once you have translated all the <!entity> strings in this file, you should save your work and open the next .dtd or .properties file. you will need to go through each and every fi...
QA phase
t like this: comparing with http://hg.mozilla.org/l10n-central/x-testing searching for changes changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings let's now push this changeset. enter the following command: hg push http://hg.mozilla.org/l10n-central/x-testing mercurial will connect to your repo and ask you to provide your account information (i.e., the username and the password). real url is http://hg.mozilla.org/l10n-central/x-testing pushing to http://hg.mozilla.org/l10n-central/x-testing searching for changes http authorization required realm: hg.mozilla.org http user: your_id password: after you enter your account information, the changeset will be pushed. adding c...
SVN for Localizers
directory on your computer and copies into it all of the files from https://svn.mozilla.org/projects/moz...om/trunk/locales/[your locale code]. note: the directory you create will be located inside the directory that you're currently in with your console (or cygwin console). also, we use https instead of http because changes can only be pushed back to the mozilla svn repository through a secure connection. open the files you want to translate with your favorite text editor. translate the content in those files, save them and check for differences by entering this command from the command-line: svn diff this command produces output with every change made to each file. it's a bit hard to read, but you can also create a diff file (aka a diff patch) use svn diff > /path/to/output/file.diff ...
Mozilla Port Blocking
tocol. potential problems caused by port blocking port blocking can cause problems if a site or web application requires access to one of the ports which is blocked in mozilla. if a user attempts to access a uri on a blocked port, mozilla shows one of the following alerts to the user or in the error console. "access to the port number given has been disabled for security reasons." "establishing a connection to an unsafe or otherwise banned port was prohibited" "0x804b0013 (ns_error_port_access_not_allowed)" if your product or web site uses a port which is blocked by mozilla's default port blocking rules, you can either change the port of your service to a unblocked value (recommended if possible) or ask your mozilla users to enable the port. for details on which ports are blocked and how to overr...
Mozilla Web Developer FAQ
there are links to more general web authoring faqs at the end of this document. what are the quirks mode and the standards mode? gecko has two and a half layout modes: quirks, almost standards and standards. in the standards mode gecko aims to treat documents authored in compliance with the applicable web format specifications. in the quirks mode—for the purpose of backwards compatibility—gecko mimics some behaviors of legacy browsers in ways that are spec violations. ...
Profiling with the Firefox Profiler
os x) and stick an export to its location in ~/.bash_profile. the extension will invoke bash to use adb and addr2line. install the latest pre-release build in your host machine's firefox browser that has your phone reachable via adb. this will add a icon in the top right of the browser. set devtools.debugger.remote-enabled to true in about:config for fennec. select target mobile usb and press connect. the first run will take an additional 1 minute or so to pull in the required system libraries. profiling firefox startup start your firefox with the environment variable moz_profiler_startup=1 set. this way the profiler is started as early as possible during startup. then capture the profile using the add-on as usual. startup profiling does not use the settings that you configured in the...
TraceMalloc
locations log, and run leaksoup over the memory dump (which is a dump of all allocations still live at shutdown) with a command such as ./run-mozilla.sh ./leaksoup sdleak.log > sdleak.html. this generates a large html file as output. the output of leaksoup begins with all the leak roots, and then lists all the non-root allocations. the roots are either listed as single objects or as strongly connected components (minimal sets of nodes in the graph in which any node is reachable from all other nodes). (a strongly connected component with only one node is listed as a single object.) any single object listed as a root is really a leak root, and any component listed as a root either (a) contains an object that is a root or (b) contains objects that form an ownership cycle that is a root. other d...
Research and prep
e and/or locale (indexing a smaller portion of the www but producing better local language results). local search a good test is if you were to run a set of comparative queries; the secondary engine should produce the best local language results and the primary/default position should produce the best global results. e-commerce search these search engines should allow users to get connected to new and used products they want to buy as quickly and painlessly as possible in a "trusted" site -- for example, choosing the most popular auction, general shopping, or classified type sites that have the desired user experience are good choices. there should be no more than two. specific interest search where users are using popular search engines to search more specific areas of in...
Debugging out-of-memory problems
rinted to the browser console (note: not web console) when an oom crash is encountered. for more information, see bug 969415. out-of-memory crashes in some cases, running out of memory causes the browser to crash. ideally, memory.dump_reports_on_oom would generate an about:memory dump, but it does not currently. firefox android on firefox android, an about:memory dump may be triggered from a connect desktop machine with the command: adb shell am broadcast -a org.mozilla.gecko.memory_dump the location of the dump file will be printed to the android log (viewed with adb logcat | grep geckoconsole) and can be retrieved via adb pull. note: replace "/storage/emulated/0/download/" in the reported file path with the device's download path (e.g. "/sdcard/download/") when calling adb pull. ...
Named Shared Memory
munication channel. the nspr shared memory api provides a cross-platform named shared-memory interface that is modeled on similar constructs in the unix and windows operating systems. shared memory protocol named shared memory functions shared memory protocol using named shared memory functions pr_opensharedmemory creates the shared memory segment, if it does not already exist, or opens a connection with the existing shared memory segment if it already exists. pr_attachsharedmemory should be called following pr_opensharedmemory to map the memory segment to an address in the application's address space. pr_attachsharedmemory may also be called to remap a shared memory segment after detaching the same prsharedmemory object. be sure to detach it when you're finished. pr_detachsharedmemory ...
PRLinger
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 remaining in the socket send buffer, the runtime attempts to deliver the data to the peer. if polarity is set to pr_true and linger is set to 0 (pr_interval_no_wait), the runtime aborts the connection when it is closed and discards any data remaining in the socket send buffer. if polarity is set to pr_true and linger is nonzero, the runtime lingers when the socket is closed. that is, if any data remains in the socket send buffer, pr_close blocks until either all the data is sent and acknowledged by the peer or the interval specified by linger expires. ...
PRSockOption
_sockopt_mcastloopback, pr_sockopt_nodelay, pr_sockopt_maxsegment, pr_sockopt_last } prsockoption; enumerators the enumeration has the following enumerators: pr_sockopt_nonblocking nonblocking i/o. pr_sockopt_linger time to linger on close if data is present in the socket send buffer. pr_sockopt_reuseaddr allow local address reuse. pr_sockopt_keepalive periodically test whether connection is still alive. pr_sockopt_recvbuffersize receive buffer size. pr_sockopt_sendbuffersize send buffer size. pr_sockopt_iptimetolive ip time-to-live. pr_sockopt_iptypeofservice ip type-of-service and precedence. pr_sockopt_addmember join an ip multicast group. pr_sockopt_dropmember leave an ip multicast group. pr_sockopt_mcastinterface ip multicast interface address. pr_sockopt_mc...
PRSocketOptionData
prmcastrequest add_member; prmcastrequest drop_member; prnetaddr mcast_if; } value; } prsocketoptiondata; fields the structure has the following fields: ip_ttl ip time-to-live. mcast_ttl ip multicast time-to-live. tos ip type-of-service and precedence. non_blocking nonblocking (network) i/o. reuse_addr allow local address reuse. keep_alive periodically test whether connection is still alive. mcast_loopback ip multicast loopback. 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 multic...
PRUint64
this has been fixed. ...
PR_Bind
tion 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_connect is invoked on a socket that is not bound, it implicitly binds an arbitrary address the socket. call pr_getsockname to obtain the address (name) bound to a socket. ...
PR_InitializeNetAddr
any, pr_ipaddrloopback } prnetaddrvalue; the enum has the following enumerators: pr_ipaddrnull do not overwrite the ip address. this allows the caller to change the network address' port number assignment without affecting the host address. pr_ipaddrany assign logical pr_inaddr_any to ip address. this wildcard value is typically used to establish a socket on which to listen for incoming connection requests. pr_ipaddrloopback assign logical pr_inaddr_loopback. a client can use this value to connect to itself without knowing the host's network address. ...
PR_Interrupt
is at most five seconds. in the pthreads-based implementation on unix, the maximum delay is 0.1 seconds. file i/o is considered instantaneous, so file i/o functions cannot be interrupted. unfortunately the standard input, output, and error streams are treated as files by nspr, so a pr_read call on pr_stdin cannot be interrupted even though it may block indefinitely. in the nt implementation, pr_connect cannot be interrupted. in the nt implementation, a file descriptor is not usable and must be closed after an i/o function on the file descriptor is interrupted. see the memo using io timeout and interrupt on nt for details. ...
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 b...
PR OpenUDPSocket
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 socket is no longer needed, it should be closed...
PR_ProcessAttrSetInheritableFileMap
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_QueueJob_Accept
syntax #include <prtpool.h> nspr_api(prjob *) pr_queuejob_accept( prthreadpool *tpool, prjobiodesc *iod, prjobfn fn, void *arg, prbool joinable ); parameters the function has the following parameters: tpool a pointer to a prthreadpool structure previously created by a call to pr_createthreadpool. iod a pointer to a prjobiodesc structure. fn the function to be executed when the job is executed. arg a pointer to an argument passed to fn. joinable if pr_true, the job is joinable. if pr_false, the job is not joinable. see pr_joinjob. ...
PR_Read
unction has the following parameters: fd a pointer to a prfiledesc object for the file or socket. buf a pointer 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_RecvFrom
t always be zero. addr a pointer to the prnetaddr object that will be filled in with the address of the sending peer on return. 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_recvfro...
PR_Send
syntax #include <prio.h> print32 pr_send( prfiledesc *fd, const void *buf, print32 amount, printn flags, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket. buf a pointer to a buffer containing the data to be sent. amount the size of buf (in bytes). flags this obsolete parameter must always be zero. 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. if the parameter fd is a blocking socket, this number must always equal amount. ...
PR_Shutdown
how the kind of disallowed operations on the socket. possible values include the following: 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. returns the function returns one of the following values: upon successful completion of shutdown request, pr_success. if unsuccessful, pr_failure. ...
Thread Pools
o one or more threads. nspr's thread pool is modeled on the thread pools described by david r. ...
Building NSS
to run these are found in the tests directory. run the standard suite by: host=localhost domsuf=localdomain use_64=1 nss/tests/all.sh unit test configuration nss tests are configured using environment variables. the scripts will attempt to infer values for host and domsuf, but can fail. replace localhost and localdomain with the hostname and domain suffix for your host. you need to be able to connect to $host.$domsuf. if you don't have a domain suffix you can add an entry to /etc/hosts (on windows, c:\windows\system32\drivers\etc\hosts) as follows: 127.0.0.1 localhost.localdomain validate this opening a command shell and typing: ping localhost.localdomain. remove the use_64=1 override if using a 32-bit build. test results running all tests can take a considerable amount of time. test o...
NSS FAQ
Mozilla › Projects › NSS › FAQ
the relationship between nss and psm? personal security manager (psm) is built on top of nss. it consists of libraries and a daemon designed to support cross-platform development of security-enabled client applications. the psm binary provides a client module that performs cryptographic operations on behalf of applications. netscape personal security manager ships with netscape 6 and the gateway connected touch pad with instant aol, and is also available for use with communicator 4.7x. where can i get the source? for instructions on how to check out and build the nss source code, see build instructions for nss. how much does it cost? nss source code and binaries (when they become available) are completely free. no license fees, no royalty fees, no subscription fees. developer questions wha...
NSS Key Log Format
wireshark 1.6.0 and above can use these log files to decrypt packets. you can tell wireshark where to find the key file via edit→preferences→protocols→ssl→(pre)-master-secret log filename. key logging is enabled by setting the environment variable sslkeylogfile to point to a file. note: starting with nss 3.24 (used by firefox 48 and 49 only), the sslkeylogfile approach is disabled by default for optimized builds using the makefile (those using gyp via build.sh are not affected). ...
NSS 3.12.4 release notes
bug 470500: firefox 3.1b2 crash report [[@ nssutil3.dll@0x34c0 ] bug 482742: enable building util independently of the rest of nss bug 483653: unable to build certutil.exe for fennec/wince bug 485145: miscellaneous crashes in signtool on windo...
NSS 3.14.2 release notes
ificate validation, applications may now supply additional application-defined trust anchors to be used in addition to those from loaded security tokens, rather than as an alternative to. (https://bugzilla.mozilla.org/show_bug.cgi?id=816853) bug 772144 - basic support for running nss test suites on android devices.this is currently limited to running tests from a linux host machine using an ssh connection. only the sshdroid app has been tested. bug 373108 - fixed a bug where, under certain circumstances, when applications supplied invalid/out-of-bounds parameters for aes encryption, a double free may occur. bug 813857 - modification of certificate trust flags from multiple threads is now a thread-safe operation. bug 618418 - c_decrypt/c_decryptfinal now correctly validate the pkcs #7 padd...
NSS 3.14 release notes
efault (in ssl.h) ssl_versionrangegetsupported (in ssl.h) ssl_versionrangeset (in ssl.h) ssl_versionrangesetdefault (in ssl.h) to better ensure interoperability with peers that support tls 1.1, nss has altered how it handles certain ssl protocol layer events. such changes may present interoperability concerns when enabling tls 1.1. when connecting to a server, the record layer version of the initial clienthello will be at most { 3, 1 } (tls 1.0), even when attempting to negotiate tls 1.1 (https://bugzilla.mozilla.org/show_bug.cgi?id=774547) the choice of client_version sent during renegotiations has changed. see the "changes" section below. experimental support for dtls (rfc 4347) and dtls-srtp (rfc 5764) dt...
NSS 3.17.4 release notes
er. nss 3.17.4 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_17_4_rtm/src/ new in nss 3.17.4 new functionality no new functionality is introduced in this release. this is a patch release to fix multiple bugs. notable changes in nss 3.17.4 bug 1084986: if an ssl/tls connection fails, because client and server don't have any common protocol version enabled, nss has been changed to report error code ssl_error_unsupported_version (instead of reporting ssl_error_no_cypher_overlap). bug 1112461: libpkix was fixed to prefer the newest certificate, if multiple certificates match. bug 1094492: fixed a memory corruption issue during failure of keypair generation. bug 1113...
NSS 3.19.2.4 release notes
leases/nss_3_19_2_4_rtm/src/ new in nss 3.19.2.4 new functionality no new functionality has been introduced in this release. security fixes in nss 3.19.2.4 the following security fixes from nss 3.21 have been backported to nss 3.19.2.4: bug 1185033 / cve-2016-1979 - use-after-free during processing of der encoded keys in nss bug 1209546 / cve-2016-1978 - use-after-free in nss during ssl connections in low memory bug 1190248 / cve-2016-1938 - errors in mp_div and mp_exptmod cryptographic functions in nss compatibility nss 3.19.2.4 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.19.2.4 shared libraries without recompiling or relinking. furthermore, applications that restrict the...
NSS 3.25.1 release notes
tch release to address a tls compatibility issue that some client applications experienced with nss 3.25. notable changes in nss 3.25.1 md5 signature algorithms sent by the server in certificaterequest messages are now properly ignored. previously, with rare server configurations, an md5 signature algorithm might have been selected for client authentication and caused the client to abort the connection soon after. bugs fixed in nss 3.25.1 the following bug has been fixed in nss 3.25.1: ignore md5 signature algorithms in certificate requests compatibility nss 3.25.1 shared libraries are backwards compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.25.1 shared libraries without recompiling or relinking. applicatio...
NSS 3.26.2 release notes
h release to address a tls compatibility issue that some client applications experienced with nss 3.26.1. notable changes in nss 3.26.2 md5 signature algorithms sent by the server in certificaterequest messages are now properly ignored. previously, with rare server configurations, an md5 signature algorithm might have been selected for client authentication and caused the client to abort the connection soon after. bugs fixed in nss 3.26.2 the following bug has been fixed in nss 3.26.2: ignore md5 signature algorithms in certificate requests compatibility nss 3.26.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.26.2 shared libraries without recompiling or relinking. furthermore...
NSS 3.27.1 release notes
aft) to be disabled using nss_disable_tls_1_3, although the maximum version used by default remained tls 1.2. however, some applications query the list of protocol versions that are supported by the nss library, enabling all supported tls protocol versions. because nss 3.27 enabled compilation of tls 1.3 (draft) by default, it caused those applications to enable tls 1.3 (draft). this resulted in connectivity failures, as some tls servers are version 1.3 intolerant, and failed to negotiate an earlier tls version with nss 3.27 clients. nss 3.27.1 once again requires nss_enable_tls_1_3 to be deliberately set to enable tls 1.3 (draft). bugs fixed in nss 3.27.1 the following bug has been fixed in nss 3.27.1: re-disable tls 1.3 by default compatibility nss 3.27.1 shared libraries are backwards...
NSS 3.28.2 release notes
ncorrect version number note the version numbers embedded in the nss 3.28.2 are wrong (it reports itself as version 3.28.1). new in nss 3.28.2 no new functionality is introduced in this release. this is a patch release includes bug fixes and addresses some compatibility issues with tls. bugs fixed in nss 3.28.2 bug 1334114 - nss 3.28 regression in signature scheme flexibility, causes connectivity issue between ios 8 clients and nss servers with ecdsa certificates bug 1330612 - x25519 is the default curve for ecdhe in nss bug 1323150 - crash [@ readdbentry ] compatibility nss 3.28.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.28.2 shared libraries without recompiling or...
NSS 3.29 release notes
the hg tag is nss_3_29_rtm. nss 3.29 requires netscape portable runtime (nspr) 4.13.1 or newer. nss 3.29 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_29_rtm/src/ notable changes in nss 3.29 fixed a nss 3.28 regression in the signature scheme flexibility that causes connectivity issues between ios 8 clients and nss servers with ecdsa certificates (bug1334114). tls 1.3 is now enabled by default in (bug1311296). bugs fixed in nss 3.29 this bugzilla query returns all the bugs fixed in nss 3.29: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.29 compatibility nss 3.29 shared ...
NSS 3.35 release notes
ndsessionticket function. this ticket can include arbitrary application-chosen content. an anti-replay mechanism was added for 0-rtt, through the experimental ssl_setupantireplay function. this mechanism must be enabled for 0-rtt to be accepted when nss is being used as a server. keyupdate can be triggered by the experimental ssl_keyupdate() function. tls servers can screen new tls 1.3 connections, as they are made using the experimental ssl_helloretryrequestcallback function. this function allows for callbacks to be installed, which are called when a server receives a new tls clienthello. the application is then able to examine application-chosen content from the session tickets, or helloretryrequest cookie, and decide whether to proceed with the connection. for an initial clienthe...
NSS 3.36.2 release notes
requires nspr 4.19 or newer. nss 3.36.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/security/nss/releases/nss_3_36_2_rtm/src/ new in nss 3.36.2 new functionality no new functionality is introduced in this release. this is a patch release to fix regression bugs. bugs fixed in nss 3.36.2 bug 1462303 - connecting to a server that was recently upgraded to tls 1.3 would result in a ssl_rx_malformed_server_hello error. bug 1460673 - fix a rare bug with pkcs#12 files. this bugzilla query returns all the bugs fixed in nss 3.36.2: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.36.2 compatibility nss 3.36.2 ...
NSS 3.37.1 release notes
requires nspr 4.19 or newer. nss 3.37.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/security/nss/releases/nss_3_37_1_rtm/src/ new in nss 3.37.1 new functionality no new functionality is introduced in this release. this is a patch release to fix regression bugs. bugs fixed in nss 3.37.1 bug 1462303 - connecting to a server that was recently upgraded to tls 1.3 would result in a ssl_rx_malformed_server_hello error. bug 1460673 - fix a rare bug with pkcs#12 files. this bugzilla query returns all the bugs fixed in nss 3.37.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.37.1 compatibility nss 3.37.1 ...
NSS sources building testing
ld be added as well. you must build nss prior to running the tests. after the build on your computer has succeeded, before you can run the tests on your computer, it might be necessary to set additional environment variables. the nss tests will start tcp/ip server tools on your computer, and in order for that to work, the nss test suite needs to know which hostname can be used by client tools to connect to the server tools. on machines that are configured with a hostname that has been registered in your network's dns, this should work automatically. in other environments (for example in home networks), you could set the host and domsuf (for domain suffix) environment variables to tell the nss suite which hostname to use. as a test, it must be possible to successfully use the command "ping $host.
nss tech note4
cus on essential aspects of the task and often do not illustrate all the cleanup that needs to be done. also, this document does not attempt to be an exhaustive survey of all possible ways to do a certain task; it merely tries to show a certain way. ...
Overview of NSS
has been battle-tested in multiple products. for more information, see the nspr project page. interoperability and open standards you can use nss to support a range of security standards in your application, including the following: ssl v3. the secure sockets layer (ssl) protocol allows mutual authentication between a client and server and the establishment of an authenticated and encrypted connection. tls v1.3 (rfc 8446), tls v1.2 (rfc 5246), tls v1.1 (rfc 4346), tls v1 (rfc 2246). the transport layer security (tls) protocol from the ietf that supersedes ssl. pkcs #1. rsa standard that governs implementation of public-key cryptography based on the rsa algorithm. pkcs #3. rsa standard that governs implementation of diffie-hellman key agreement. pkcs #5. rsa standard that governs passwor...
PKCS11 FAQ
Mozilla › Projects › NSS › PKCS11 › FAQ
subjectaltname must include an email address. the subjectaltname extension is part of the x.509 v3 and pkix specifications. if i have a multipurpose token that supports all required pkcs #11 functions and provides rsa_pkcs and dsa mechanisms but but not aes, des or rc4, will nss use the token for the rsa_pkcs mechanisms and the nss internal pkcs #11 module for aes, des or rc4 when making an ssl connection? once nss starts using a token for a given operation (like s/mime or ssl), it works hard to keep using that same token (so keys don't get moved around). symmetric operations supported by nss include the following: ckm_aes_xxx, ckm_des3_xxx, ckm_des_xxx, ckm_rc2_xxx, and ckm_rc4_xxx. nss knows about all the mechanisms defined in pkcs #11 version 2.01, but will not perform those that aren't def...
NSS PKCS11 Functions
odule 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 specs used by secmod_loadusermodule. module will continue to function in ...
NSPR functions
pi, a lighter-weight method than creating your own nspr i/o layer is to simply import a native file descriptor into nspr. this method is convenient and works for most applications. pr_importtcpsocket socket i/o functions as mentioned above, the ssl library in nss implements the ssl protocol as an nspr i/o layer. users call nspr socket i/o functions to read from, write to, and shut down an ssl connection, and to close an nspr file descriptor. pr_read pr_write pr_recv pr_send pr_getsocketoption pr_setsocketoption pr_shutdown pr_close ...
troubleshoot.html
r. the 64-bit builds don't support gcc. if the build fails early on the gmakein coreconf try updating your cvs tree with -p: cd mozilla cvs update -p building a 32-bit version on a 64-bit may fail with: /usr/include/features.h:324:26: fatal error: bits/predefs.h: no such file or directory in this case remember to set use_64=1 testing nss the ssl stress test opens 2,048 tcp connections in quick succession. kernel data structures may remain allocated for these connections for up to two minutes. some systems may not be configured to allow this many simultaneous connections by default; if the stress tests fail, try increasing the number of simultaneous sockets supported. building jss windows only: the shell invoked by gmake, shmsdos.exe, is likely to crash when invoking ...
TLS Cipher Suite Discovery
they must agree on these items: key establishment algorithm (such as rsa, dh, or ecdh) peer authentication algorithm (such as rsa, dsa, ecdsa) bulk data encryption algorithm (such as rc4, des, aes) and key size digest algorithm for message authentication checking (sha1, sha256) there are numerous available choices for each of those categories, and the number of possible combinations of all those choices is large. ...
NSS Tools
natures on digitally-signed objects. source, documentation, tasks/plans sslstrength ssl strength documentation ssltap 3.2 proxy requests for an ssl server and display the contents of the messages exchanged between the client and server. the ssltap tool does not decrypt data, but it shows things like the type of ssl message (clienthello, serverhello, etc) and connection data (protocol version, cipher suite, etc). this tool is very useful for debugging. source, documentation currently points to the netscape certificate management system administration guide on docs.sun.com. for additional information about this tool, see object signing. currently points to the signver documentation on developer.netscape.com. for additional information about ...
Multithreading in Necko
cks to the main thread. this keeps simple protocol handlers simple :-) more complex protocol handlers (eg. http, ftp) operate partially on the background threads to improve performance. for example, the http protocol handler has code that runs on the socket transport thread to kick off pending requests well before the main thread would get around to doing so. socket transport thread (1) socket connections are processed on a single background thread. this thread is controlled by the nssockettransportservice. it sits in a loop, polling a list of sockets. when a socket can be read, the socket's listener is notified either synchronously (on the same thread) or asynchronously via a nsistreamlistenerproxy impl. file transport threads (1-4) file i/o is processed via a thread pool that has between ...
Proxies in Necko
socks and nsisockettransportservice the aforementioned methods work very well for application-level proxies. however, socks is transparent to upper-level protocols, and can transport any other tcp- or udp-based protocol. therefore, nsisockettransportservice supports creating socket transports using an nsiproxyinfo. this proxy info will only be used if it specifies a socks proxy, through which the connection is then made. note that socks is implemented as an nsisocketprovider, and the socket transport service will therefore use it as as the downmost socket type. proxies and local hosts requires gecko 9.0(firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) starting with gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), proxy servers are not used when accessing hosts with no dots in th...
Personal Security Manager (PSM)
personal security manager (psm) consists of a set of libraries that perform cryptographic operations on behalf of a client application. these operations include setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), and other common pki functions. notes: psm always builds with firefox now, so there aren't separate build instructions. archived information about psm ...
Tutorial: Embedding Rhino
the context and the current thread and is an essential cleanup action. there should be a call to exit for every call to enter. to make sure that it is called even if an exception is thrown, it is put into the finally block corresponding to the try block starting after context.enter(). expose java apis using java apis no additional code in the embedding needed! the javascript feature calledliveconnect allows javascript programs to interact with java objects: $ java runscript "java.lang.system.out.println(3)" 3.0 undefined implementing interfaces using rhino, javascript objects can implement arbitrary java interfaces. there's no java code to write -- it's part of rhino's liveconnect implementation. for example, we can see how to implement java.lang.runnable in a rhino shell session: js> ob...
Rhino requirements and limitations
requirements recent versions of rhino have only been tested with jdk 1.4 and greater. older versions support jdks as early as 1.1. to use the javaadapter feature or an optimization level of 0 or greater, rhino must be running under a security manager that allows the definition of class loaders. ...
The JavaScript Runtime
] as functions. these object types are represented by implementing the function interface. since javascript is a dynamically typed language, the static java type of a javascript value is java.lang.object. the behavior of the javascript engine is undefined if a value of any type other than the ones described above is introduced into javascript. (this caveat does not apply to scripts that use liveconnect; the java values are wrapped and unwrapped as appropriate to conform to the above type constraints.) property access properties in javascript objects may be accessed using either string or numeric identifiers. conceptually, all accessors are converted to strings in order to perform the lookup of the property in the object. however, this is not the implementation used in practice because a numbe...
Rhino scopes and contexts
(): sealedsharedscope.sealobject(); note that currently one needs to explicitly seal any additional properties he adds to the sealed shared scope since although after calling sealedsharedscope.sealobject(); it would no be possible to set the additional properties to different values, one still would be able to alter the objects themselves. note that currently in order to use java classes (liveconnect) from a sealed shared scope you need to pre-load a number of objects needed for liveconnect into the scope before it gets sealed. these objects would normally be lazy loaded but the lazy loading fails if the scope is sealed. scriptableobject sealedsharedscope = cx.initstandardobjects(null, true); // force the liveconnect stuff to be loaded. string loadme = "regexp; getclass; java; packages; ja...
Scripting Java
implementing java interfaces now that we can access java classes, create java objects, and access fields, methods, and properties of those objects, we have a great deal of power at our fingertips. however, there are a few instances where that is not enough: many apis in java work by providing interfaces that clients must implement. one e...
Rhino serialization
simple serialization example the rhino shell has two new top-level functions, serialize and deserialize. ...
Rhino shell
by rhino javascript compiler. print([expr ...]) evaluate and print expressions. evaluates each expression, converts the result to a string, and prints it. readfile(path [, charactercoding]) read given file and convert its bytes to a string using the specified character coding or default character coding if explicit coding argument is not given. readurl(url [, charactercoding]) open an input connection to the given string url, read all its bytes and convert them to a string using the specified character coding or default character coding if explicit coding argument is not given. runcommand(commandname, [arg, ...] [options]) execute the specified command with the given argument and options as a separate process and return the exit status of the process. usage: runcommand(command) runcomma...
Getting SpiderMonkey source code
id getting the full change history, click the zip or gz links at https://hg.mozilla.org/index.cgi/mozilla-central/file/tip. this fetches a snapshot of the current mozilla tree. if you have problems with the instructions above, you can read the full details of using mercurial to get mozilla code here. that page also contains links to several bundles, which can be useful if you have a poor network connection. getting the latest spidermonkey source code from git the following command line downloads the entire mozilla repository, including the full change history and a lot of gecko and firefox source code that isn't part of spidermonkey. it also changes to the spidermonkey directory (js/src). git clone https://github.com/mozilla/gecko-dev.git cd gecko-dev/js/src if you want a faster (about 5 ti...
Index
on, fun. these flags are for the javascript engine’s internal use. most applications can’t do anything useful with them. 298 js_getfunctionid jsapi reference, spidermonkey js_getfunctionid returns the name of a function, fun, as a jsstring, or null if fun is unnamed. 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. 299 js_getfunctionname jsapi reference, obsolete, spidermonkey js_getfunctionname retrieves the function name associated with a function pointer, fun. 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 ...
Invariants
in the same compartment. so it is utterly crucially important that this invariant always be true if objects are being created. the public api for compartment-hopping, jsautoentercompartment, and the internal api, js::autocompartment, both make sure the invariant is maintained. however, there is another internal api, js::switchtocompartment, that lets you break this invariant, and of course in xpconnect we use that from time to time when we know we aren't going to be creating any new objects (other than global objects, which have no parent or prototype) or doing anything that might call back into native code that could create objects. we do this in order to save some cpu cycles (in other words, for no good reason whatsoever). if !js_isrunning(cx) && cx->globalobject == null, then cx->compartmen...
JSClass.flags
s set, each instance of the class has a field for private data. the field can be accessed using js_getprivate and js_setprivate. mxr id search for jsclass_has_private jsclass_private_is_nsisupports mozilla extension. the private field of each object of this class points to an xpcom object (see nsisupports). this is only meaningful if spidermonkey is built with xpconnect and the jsclass_has_private flag is also set. mxr id search for jsclass_private_is_nsisupports jsclass_is_domjsclass added in spidermonkey 17 objects are dom. mxr id search for jsclass_is_domjsclass jsclass_emulates_undefined added in spidermonkey 24 causes objects which have this class to emulate undefined in certain circumstances. an...
JS_ClearNewbornRoots
sing local or global roots. however, the newborn roots can also entrain great gobs of garbage, so the js_gc entry point clears them for the context on which gc is being forced. embeddings may need to do likewise for all contexts. see js_enterlocalrootscope for a better way to manage newborns in cases where native hooks (functions, getters, setters, etc.) create many gc-things, potentially without connecting them to predefined local roots such as *rval or argv[i] in an active jsnative function. using js_enterlocalrootscope disables updating of the context's per-gc-thing-type newborn roots, until control flow unwinds and leaves the outermost nesting local root scope. see also bug 572057 bug 659462 ...
JS_GetFunctionId
n); jsstring * js_getfunctiondisplayid(jsfunction *fun); // added in spidermonkey 17 name type description fun jsfunction * a javascript function. description js_getfunctionid returns the name of a function, fun, as a jsstring, or null if fun is unnamed. 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_getfunctiondisplayid returns the display name of a function, fun. this is the defined name if one was given where the function was defined, or it could be an inferred name by the js engine in the case that the function was defined to be anonymous. this can still return nullptr if a useful display name could n...
JS_SetInterruptCallback
d 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 callbacks can occur inside the callback handler if it re-enters the js engine. the embedding must ensure that the callback is disconnected before attempting such re-entry. js_setinterruptcallback sets a callback that can be called asynchronously. some common uses for an interrupt callback are: to run garbage collection periodically, by calling js_maybegc; to periodically take a break from script execution to update the ui (though note that mozilla does not do this, by design); to enforce application limits on the amount of ...
JS_SetOperationCallback
d 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 callbacks can occur inside the callback handler if it re-enters the js engine. the embedding must ensure that the callback is disconnected before attempting such re-entry. js_setoperationcallback sets a callback that can be called asynchronously. some common uses for an operation callback are: to run garbage collection periodically, by calling js_maybegc; to periodically take a break from script execution to update the ui (though note that mozilla does not do this, by design); to enforce application limits on the amount of ...
JS_SetOptions
t things. the former creates a property on the global object. the latter creates a property on obj. with this flag, both create a global property. mxr id search for jsoption_varobjfix jsoption_private_is_nsisupports mozilla extension. the context's private data points to an xpcom object (see nsisupports). this is only meaningful if spidermonkey is built with xpconnect. mxr id search for jsoption_private_is_nsisupports jsoption_compile_n_go caller of js_compilescript et al promises to execute the compiled script once only, in the same scope object used for compilation. the caller may not modify objects on the scope chain between compilation and execution. this enables compile-time scope chain resolution of consts (a performan...
JS_THREADSAFE
ed, and destroyed by a single thread. this makes sense, as a context can only be used by one thread at a time. however, there are a few cases where an application might need to share contexts across threads. for example: many worker threads need to share a "pool" of reusable contexts, to avoid the performance cost of constantly creating and destroying contexts. (this is analogous to a database connection pool.) the application has a jscontext that it needs to use each time some event happens. but the event could happen on any thread. for such cases, use js_clearcontextthread and js_setcontextthread to transfer the context safely from one thread to another. further info note: spidermonkey internals: thread safety is mostly obsolete. ...
JSDBGAPI
ok js_setnewscripthook js_setdestroyscripthook js_getglobaldebughooks js_setcontextdebughooks memory usage js_getobjecttotalsize js_getfunctiontotalsize js_getscripttotalsize system objects js_issystemobject js_newsystemobject profiling these functions can be used to profile a spidermonkey application using the mac profiler, shark. see profiling javascript with shark. js_connectshark js_disconnectshark js_startchudremote js_stopchudremote the following jsnative functions can be used to expose the above four apis to scripts. js_connectshark js_disconnectshark js_startshark js_stopshark ...
WebReplayRoadmap
lowing a high level of parallelism without impacting users. the cloud should not be the only option by which people can use web replay, however. all features should be accessible to users operating locally. while cloud integration is not in placer, web replay's architecture has recently been redesigned in preparation for cloud support, and communicating with replaying processes over a network connection instead of ipc should work pretty efficiently. recording firefox ui (partially implemented) right now only content tabs can be recorded and replayed. firefox's ui and privileged code is largely written in js, and it would be nice to be able to use web replay to help debug and develop firefox itself, for better dogfooding and gathering internal feedback. this is partially underway and is tr...
Mozilla Projects
e functions. the api is used in the mozilla clients, many of red hat's and oracle's server applications, and other software offerings. personal security manager (psm) personal security manager (psm) consists of a set of libraries that perform cryptographic operations on behalf of a client application. these operations include setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), and other common pki functions. pork pork is a c++ parsing and rewriting tool chain. the core of pork is a c++ parser that provides exact character positions for the start and end of every ast node, as well as the set of macro expansions ...
A Web PKI x509 certificate primer
rchy allows for a relatively simple long term root to be distributed to clients, and some flexibility on the intermediate cert so that you can change parameters based on best practices and security research. generate your ca root update *.example.com and *.example.net below to match your domains. assumptions: you are the domain owner of *.example.com and *.example.net. your computer is not connected to the internet. steps to generate your ca root certificate: generate key "openssl genpkey -algorithm rsa -out rootkey.pem -pkeyopt rsa_keygen_bits:4096" 4096 is considered secure for the next 15 years. generate csr "openssl req -new -key rootkey.pem -days 5480 -extensions v3_ca -batch -out root.csr -utf8 -subj '/c=us/o=orgname/ou=someinternalname' make a new certif...
Browser security
secure development guidelinesthe following content will likely see significant revision, though can be used as a reference for security best practices to follow when developing code for mozilla.security and the jar protocolthis article discusses security concerns with the jar: protocol, which only firefox has ever implemented for web content. ...
Using the Places history service
ctions used by the basic browser like marking pages as typed in the url bar, and removing pages as from the history interface. nsinavhistoryservice: complex query functions, more fine-grained getters and setters. nsiautocompletesearch: url-bar autocomplete from history from 1.9.1 (firefox3.1) on, don't use any places service on (or after) quit-application has been notified, since the database connection will be closed to allow the last sync, and changes will most likely be lost. use quit-application-granted instead. differences from previous implementations the previous nsglobalhistory service stored one entry for each page in history. this entry contained the url, title, visit count, last visit date, first visit date, host name, last referrer, flags for typed, hidden, and gecko flags (geck...
XML Extras
tp:// documents but you need to enable universalbrowserread privilege in your scripts - see the javascript security: signed scripts document for more details. normally your files should reside on a webserver so this shouldn't pose a problem (there you do not need that line either). additionally, "foo.com:80" and "foo.com:313" are considered different hosts for security purposes. you cannot open a connection to a different host. domparser creation not available new domparser() xmlserializer creation not available new xmlserializer() minimal documentation for the components listed above can be found using mozilla documentation generated by doxygen. file new bugs for additional documentation contributions, either specifically aimed at javascript developers or to ...
How to build an XPCOM component in JavaScript
ent slightly. the imported library contains functions for generating the module, factory, and the nsgetmodule and queryinterface functions for you. note: it doesn't do the work of creating your interface definition file or the type library for you, so you still have to go through those steps above if they haven't been done. the library provides a simple example of its use in the source code (js/xpconnect/loader/xpcomutils.jsm), but here's another using this example. to begin, include a line at the top of your interface to import the xpcomutils library: components.utils.import("resource://gre/modules/xpcomutils.jsm"); then implement your interface the same way you did above, except with a few modifications so that xpcomutils can set it up properly: /********************************************...
An Overview of XPCOM
a binary representation of an interface or interfaces. it provides programmatic control and access of the interface, which is crucial for interfaces used in the non c++ world. when components are accessed from other languages, as they can be in xpcom, they use the binary type library to access the interface, learn what methods it supports, and call those methods. this aspect of xpcom is called xpconnect. xpconnect is the layer of xpcom that provides access to xpcom components from languages such as javascript. see connecting to components from the interface for more information about xpconnect. when a component is accessible from a language other than c++, such as javascript, its interface is said to be "reflected" into that language. every reflected interface must have a corresponding type lib...
Component Internals
ed symbol from the components shared library. "native" here includes any language that can generate a platform native dynamically loaded library. scripting languages and other "non-native" languages usually have no way to build native libraries. in order to have "non-native" xpcom components work, xpcom must have a special component loader which knows how to deal with these type of components. xpconnect, for example, provides a component loader that makes the various types, including the interfaces and their parameters, available to javascript. each language supported by xpcom must have a component loader. three parts of a xpcom component library xpcom is like an onionor a parfait! everybody likes parfaits. xpcom components have at least three layers. from the innermost and moving outward thes...
Finishing the Component
= pr_true; return ns_ok; } node = node->next; } return ns_ok; } at this point, all of the backend work is complete. you can of course improve this backend in many ways, but this example presents the basic creation of what is commonly referred to as a "browser helper object" like weblock. the next chapter looks at how to tie this into the front end - specifically, how to use xpconnect to access and control this component from javascript in the user interface. « previousnext » copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distribution of substantively modified versions of this document is prohibited without the explicit permission...
Resources
this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later. distr...
Creating XPCOM components
factories xpidl and type libraries xpcom services xpcom types method types reference counting status codes variable mappings common xpcom error codes using xpcom components component examples cookie manager the webbrowserfind component the weblock component component use in mozilla finding mozilla components using xpcom components in your cpp xpconnect: using xpcom components from script component internals creating components in cpp xpcom initialization xpcom registry manifests registration methods in xpcom autoregistration the shutdown process three parts of a xpcom component library xpcom glue the glue library xpcom string classes creating the component code what we'll be working on component regist...
XPCOM Stream Guide
Mozilla › Tech › XPCOM › Guide › Streams
e io service is available through the services.jsm module as the .io property. stream listeners a stream listener is an object you build to let you know when there is data in a stream ready for you to consume. most streams are asynchronous: they make no assumptions that all the data a resource provides is available immediately. (this is particularly true of streams that reach out over a network connection, like http and ftp channels.) stream listeners implement three methods. from the nsistreamlistener interface, the .ondataavailable(request, context, inputstream, offset, count) method gives you the input stream and the number of bytes available. the stream listener must read exactly count bytes before exiting. from the nsirequestobserver interface, the .onstartrequest(request, context) method...
How To Pass an XPCOM Object to a New Window
...
Components.classes
to access a service (a singleton component, only single instance of which exists at any time), you should use getservice instead of createinstance: var os = components.classes["@mozilla.org/observer-service;1"] .gets...
Components.interfaces
es 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(). the properties of the components.interfaces object can ...
Components.interfacesByID
ead-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.results
introduction components.results is an object whose properties are the names of well-known xpcom result codes, with each value being that of the corresponding result code. elements in this array can be used to test against unknown nsresult variables or they can be 'thrown' to indicate failure... ...
Components.returnCode
n hold an xpcom return code additionally to the value returned by the return statement. note that components.returncode is currently non-functional due to bug 287107. this problem was introduced in mozilla 1.4. usage components.returncode is a property that can be used to indicate to an xpcom caller of the javascript method that the method is returning a specific nsresult code. generally, xpconnect does a fine job of making it unnecessary for javascript code to worry about nsresult codes. by default the successful completion of the javascript method will cause xpconnect to return a result code of ns_ok to the caller. if the javascript code needs to signal failure then that is done by throwing an exception. however, there are a very few xpcom interfaces that specify success code return value...
Components.utils.forceGC
ely necessary. note: nsidomwindowutils.garbagecollect() offers similar functionality but will trigger the cycle collector in addition to the garbage collector in the javascript engine. this will make sure that xpcom components that build cycles with javascript objects also get collected which might be important, for example for testcases that depend on the garbage collector. requires universalxpconnect privileges. if you want to schedule garbage collection to occur in the future, at a time when no javascript code is running, you can use components.utils.scheduleprecisegc() instead. ...
Components.utils.import
ces.mozijssubscriptloader); loader.loadsubscript(someurl, obj1); loader.loadsubscript(someurl, obj2); assert(obj2 === obj1); ...returns false. this means components.utils.import is better suited for efficient sharing of code (and data?) between js scripts running in different scope. additional resources components.utils bug 238324 the documentation in xpccomponents.idl the tests in js/xpconnect/tests/unit/ importing sdk/commonjs modules into other code ...
Components.utils
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. ...
Components.utils.unload
called mymodule.jsm using the following line of code: components.utils.unload("resource://myaddon/modules/mymodule.jsm"); note: currently components.utils.unload clears the global object of an unloaded module. this may cause modules to misbehave after unloading even if you have a reference to them. see bug 769253 see also bug 481603 the documentation in xpccomponents.idl the tests in js/xpconnect/tests/unit/ ...
Other Resources
other resources embedding mozilla xpconnect - javascript-xpcom bridge blackconnect - java-xpcom bridge (no longer supported) xpidl to java types - from blackconnect ...
JavaXPCOM
javaxpcom allows for communication between java and xpcom, such that a java application can access xpcom objects, and xpcom can access any java class that implements an xpcom interface. javaxpcom is not actively maintained. with javaxpcom, a developer can talk to xpcom or embed gecko from a java application. javaxpcom is very similar to xpconnect (javascript-xpcom bridge), and uses xpidl. note: javaxpcom was included in xulrunner up through version 1.9.2. it has been removed in xulrunner 2, and is not actively maintained. documentation javaxpcom development how to get and build the source, as well as how to view and report bugs. sample code there are several java test applications checked in to the tree that give example...
PyXPCOM
pcom allows for communication between python and xpcom, such that a python application can access xpcom objects, and xpcom can access any python class that implements an xpcom interface. pyxpcom is actively used in activestate komodo products, for example. with pyxpcom, a developer can talk to xpcom or embed gecko from a python application. pyxpcom is similar to javaxpcom (java-xpcom bridge) or xpconnect (javascript-xpcom bridge). mozilla defines many external interfaces available to embeddors and component developers. pyxpcom provides access to these interfaces as python interfaces. pyxpcom also contains several classes that provide access to functions for initializing and shutting down xpcom and gecko from python, as well as some xpcom helper functions. documentation ...
Architecture basics
xpcom is like com, for windows. it lets you get pointers to components inside mozilla, and it lets you talk about their interfaces as well. xpconnect is what lets javascript talk with mozilla guts, the xpcom system. you can imagine it like a bridge between javascript code, and mozilla guts. xpcshell is a command line interface to mozilla javascript. it's an interactive interpreter -- it gives you a shell that talks straight to mozilla, via javascript's xpconnect bridge into it. ...
nsIRegistry
...
XPCShell Reference
print(obj1, obj2, …) print() is useful to print something to the screen. it dumps whatever is passed to the screen, putting spaces between arguments and appending a newline at the end. an example print(1, 2, 3) will print 1 2 3<newline>. dump(object) dump() is almost like print. it only handles one parameter and it doesn't append a newline. dumpxpc(depth) this function dumps the xpconnect object. see the documentation on debugdump() for the nsixpconnect interface for more information. version(newversion) version() returns the javascript engine version number. if you pass a number to it, it will set the version number (and return the old version number). see the above documentation on the -v command-line argument for more information. quit(exitcode) quit() exits the shell...
IAccessibleHyperlink
an have either a single link or a collection of links such as when the non-text object is an image map. linked objects and anchors are implementation dependent. this interface is derived from iaccessibleaction. iaccessibleaction.nactions() is one greater than the maximum value for the indices used with the methods of this interface. furthermore, the object that implements this interface has to be connected implicitly or explicitly with an object that implements iaccessibletext. startindex() and endindex() are indices with respect to the text exposed by iaccessibletext. this interface provides access to a single object which can have multiple actions. an example is an image map which is an image with multiple links each of which is associated with a separate non-overlapping area of the image. this...
IDispatch
js/src/xpconnect/idl/xpcidispatch.idlscriptable this interface is not to be used directly, it is to be used internally for xpconnect's idispatch support. inherits from: nsisupports last changed in gecko 1.7 ...
mozIJSSubScriptLoader
66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 28 (firefox 28 / thunderbird 28 / seamonkey 2.25 / firefox os 1.3) implemented by: @mozilla.org/moz/jssubscript-loader;1. to get this service, use: var mozijssubscriptloader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); note: see components.utils.import for another way to import javascript code. ...
mozIStoragePendingStatement
ncel the statement, you will receive no further notifications about results. void cancel(); parameters none. return value in versions of gecko prior to gecko 1.9.2, this returned a boolean value that was true if the query was canceled successfully or false if not. starting with gecko 1.9.2, this information is no longer provided and the method doesn't return a value. see also storage mozistorageconnection mozistoragestatement ...
mozIStorageResultSet
gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview mozistoragerow getnextrow(); methods getnextrow() returns the next row from the result set. mozistoragerow getnextrow(); parameters none. return value a mozistoragerow object containing the next row from the result set, or null if there are no more results. see also storage mozistorageconnection mozistoragestatement ...
mozIStorageRow
ue of the specified column. ...
mozIStorageStatementWrapper
you can then wrap that statement with a wrapper, which implements nsixpcscriptable and provides scriptable helpers letting you execute the statement as a function, access bind variables by name as properties, etc. firefox 3.5 note firefox 3.5 adds support for these features directly into the mozistoragestatement interface, so this interface is essentially deprecated. ...
mozIStorageVacuumParticipant
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_size. note: if the d...
mozIStorageValueArray
eturn value the blob for the specified entry. getisnull() checks if given column index is null. boolean getisnull( in unsigned long aindex ); parameters aindex the zero-based numerical index for the column to get the data from. return value returns true if the column specified by aindex is null, or false otherwise. see also storage introduction and how-to article mozistorageconnection database connection to a specific file or in-memory data storage mozistoragestatement create and execute sql statements on a sqlite database. mozistoragefunction create a new sqlite function. mozistorageaggregatefunction create a new sqlite aggregate function. mozistorageprogresshandler monitor progress during the execution of a statement. mozistoragestatementwrapper storage statement wra...
nsIAuthPrompt2
upports acontext, in pruint32 level, in nsiauthinformation authinfo); boolean promptauth(in nsichannel achannel, in pruint32 level, in nsiauthinformation authinfo); constants constant value description level_none 0 the password will be sent unencrypted. 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 the same semantics as nsiauthprompt.promptusernameandpassword(), but must return immediately after calling and return the entered data in a callback. if the user closes the di...
nsIClassInfo
info implementation. obsolete since gecko 2.0 methods gethelperforlanguage() get a language mapping specific helper object that may assist in using objects of this class in a specific lanaguage. for example, if asked for the helper for nsiprogramminglanguage::javascript this might return an object that can be nsisupports.queryinterface()'d into the nsixpcscriptable interface to assist xpconnect in supplying javascript specific behavior to callers of the instance object. nsisupports gethelperforlanguage( in pruint32 language ); parameters language this parameter selects the language mapping specific helper object to be returned. nsiprogramminglanguage defines language identifiers that may be passed for this parameter. return value should return null if no helper available for...
nsICookieManager2
ng dot will be stripped. to be a domain cookie, the host must have at least two subdomain parts (e.g. '.foo.com', not '.com'), otherwise an exception will be thrown. an empty string is acceptable (e.g. file:// uri's). apath the path within the domain for which the cookie is valid. aname the cookie name. avalue the cookie data. aissecure true if the cookie should only be sent over a secure connection. aishttponly true if the cookie should only be sent to, and can only be modified by, an http connection. aissession true if the cookie should exist for the current session only. aexpiry holds the expiration date, in seconds since the epoch. only relevant if aissession is false. cookieexists() returns whether or not a matching cookie already exists. boolean cookieexists( in nsicooki...
nsIDNSService
1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) implemented by: @mozilla.org/network/dns-service;1. to access the service, use: var dnsservice = components.classes["@mozilla.org/network/dns-service;1"] .createinstance(components.interfaces.nsidnsservice); note: starting in gecko 7.0, the "happy eyeballs" strategy is used to reduce lengthy timeouts when attempting backup connections during attempts to connect from clients that have broken ipv6 connectivity. this is done by disabling ipv6 on backup connections. 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 ahos...
nsIDOMFile
this is also used by the datatransfer object to describe files dragged into a web application using drag and drop. ...
nsIDOMMozNetworkStats
criptable 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
e 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
iseconds 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 mobile long constant for mobile, set to 1 methods getsamples() asynchronously queries network interface statistics. the query may be filtered by connection type and date. nsidomdomrequest getsamples(in nsisupports network, in jsval start, in jsval end, [optional] in jsval options /* networkstatsgetoptions */); parameters network the origin of the data. it can specify wifi, mobile, or null. if null, data measurement from both origins are merged. to know in a...
nsIDOMParser
these matter, feel free to ask questions in mozilla.dev.tech.dom and update this documentation to mention these cases. when a domparser is instantiated by calling new domparser(), it inherits the calling code's principal (except that for chrome callers the principal is set to the null principal) and the documenturi and baseuri of the window the constructor came from. if the caller has universalxpconnect privileges, it can pass parameters to new domparser(). if fewer than three parameters are passed, the remaining parameters will default to null. the first parameter is the principal to use; this overrides the default principal normally inherited. the second parameter is the documenturi to use. the third parameter is the baseuri to use. if you instantiate a domparser by calling createinstance()...
nsIDOMWindow
nsidomwindow the root window for the hierarchy of windows that contain this nsidomwindow. this is the window itself if there is no parent, or if the parent is of a different type. the window hierarchy does not cross chrome-content boundaries. this attribute is "replaceable" in javascript. 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. read only. native code only! note: prior to gecko 7.0 this attribute was part of nsidomwindow2. methods getcomputedstyle() see dom-window-getcomputedstyle for details. nsidomcssstyledeclaration getcomputedstyle( in nsidomelement elt, in domstring pseudoelt optional ); parameters elt ...
nsIDOMWindow2
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 ...
nsIDispatchSupport
inherits from: nsisupports last changed in gecko 1.7 method overview void comvariant2jsval(in comvariantptr comvar, out jsval val); unsigned long gethostingflags(in string acontext); boolean isclassmarkedsafeforscripting(in nscidref cid, out boolean classexists); boolean isclasssafetohost(in jscontextptr cx, in nscidref cid, in boolean capscheck, out boolean classexists); boolean isobjectsafeforscripting(in voidptr theobject, in nsiidref id); void jsval2comvariant(in jsval var, out comvariant comvar); methods comvariant2jsval() converts a com variant to a jsval. ...
nsIDocShell
cipal aprincipal ); parameters aprincipal the principal to use for the new document. createloadinfo() creates a docshellloadinfo object that you can manipulate and then pass to loaduri(). void createloadinfo( out nsidocshellloadinfo loadinfo ); parameters loadinfo the new nsidocshellloadinfo object. violates the xpcom interface guidelines detacheditorfromwindow() disconnects this docshell's editor from its window, and stores the editor data in the open document's session history entry. this should be called only during page transitions. void detacheditorfromwindow(); parameters none. finishrestore() finish firing webprogresslistener notifications and dom events for restoring a page presentation. this should only be called via beginrestore(). void finishrestore(); ...
nsIDownloadManager
ownloaded. 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. datasource nsirdfdatasource read only. obsolete since gecko 1.8 dbconnection mozistorageconnection the database connection to the downloads database. read only. defaultdownloadsdirectory nsilocalfile returns the platform default downloads directory. read only. listener nsidownloadprogresslistener the download manager's progress listener. obsolete since gecko 1.8 userdownloadsdirectory nsilocalfile returns the user co...
nsIEventListenerService
introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/eventlistenerservice;1. to create an instance, use: var eventlistenerservice = components.classes["@mozilla.org/eventlistenerservice;1"] .getservice(components.interfaces.nsieventlistenerservice); universalxpconnect privileges are required to use this service. method overview void geteventtargetchainfor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidomeventtarget aoutarray); void getlistenerinfofor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsieven...
nsIFTPEventSink
ension of nsisupports. it can be used as a notification callback on an ftp channel. netwerk/protocol/ftp/nsiftpchannel.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void onftpcontrollog(in boolean server, in string msg) methods onftpcontrollog allows a consumer to receive a log of the ftp control connection conversation. void onftpcontrollog ( in boolean server, in string msg); parameters server a boolean value specifying whether you are a server or a client. msg a string holding response of the last command which had been sent. ...
nsIFrameMessageManager
d when the message is received. listenwhenclosed default is false. set to oo if you want to receive messages during the short period after a frame has been removed from the dom and before its frame script has finished unloading. this parameter only has an effect for frame message managers in the main process. an alternative method to listen for death of frame script is to use message-manager-disconnect observer: observer notifications :: message manager. removemessagelistener() removes a message listener previously added by calling addmessagelistener(). void removemessagelistener( in astring amessage, in nsiframemessagelistener alistener ); parameters amessage the name of the message for which to remove a listener. alistener an object implementing nsiframemessagelistener to sto...
nsIHttpUpgradeListener
formation needed by the protocol handler to take over the channel that is no longer being used by http. note: to begin a protocol upgrade, call nsihttpchannelinternal.httpupgrade(). void ontransportavailable( in nsisockettransport atransport, in nsiasyncinputstream asocketin, in nsiasyncoutputstream asocketout ); parameters atransport the nsisockettransport describing the socket connection between the browser and the server; this socket can now be used for the new protocol instead of http. asocketin the nsiasyncinputstream object representing the input stream for data coming from the server over the socket connection. asocketout the nsiasyncoutputstream object representing the out stream for sending data to the server over the socket. ...
nsIJSCID
inherits from: nsijsid last changed in gecko 1.7 method overview nsisupports createinstance(); nsisupports getservice(); methods createinstance() nsisupports createinstance(); parameters none. return value getservice() nsisupports getservice(); parameters none. return value see also see components.classes for usage patterns of the createinstance() and getservice() methods. ...
nsIJSID
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) the following methods return objects that implement this interface: components.interfaces.name components.classes[contract] components.interfacesbyid[uuid] components.classesbyid[cid] the first two cases create a named jsid while the last two cases create an unnamed jsid. an unnamed jsid also results 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. ...
nsIMessageListenerManager
details of the message syntax. listenwhenclosed specify true to receive messages during the short period after a frame has been removed from the dom and before its frame script has finished unloading; this is false by default. this parameter only has an effect for frame message managers in the main process. an alternative method to listen for death of frame script is to use a message-manager-disconnect observer; see observer notifications :: message manager. removemessagelistener() undo an addmessagelistener() call; that is, calling this causes listener to stop being invoked when the specified message is received. void removemessagelistener(in astring messagename, in nsimessagelistener listener); removemessagelistener() does not remove a message listener added ...
nsIMimeConverter
onverteroutputcallback output_fn, in void *closure); void encoderdestroy(in mimeencoderdata *data, in boolean abort_p); long encoderwrite(in mimeencoderdata *data, in string buffer, in long size); methods encodemimepartiistr() an variant of encodemimepartiistr_utf8() which treats the header as written in the given charset. this should only be used by native code, as xpconnect translation causes it to not work properly. string encodemimepartiistr(in string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); parameters propertyname the name of the property to retrieve. return value the value of th...
nsIMsgProtocolInfo
the iid of the server-specific interface, used during account creation. read only. showcomposemsglink boolean true if compose ui actions should be enabled for the account type. read only. specialfoldersdeletionallowed boolean true if the user can delete folders like inbox, trash, etc. read only. methods getdefaultserverport() returns the default port for a connection to a server of this account type. long getdefaultserverport( in boolean issecure ); parameters issecure whether or not the connection will be secure. return value the default port number for connections of this account type. remarks this is one of the interfaces that is required to create a new account type. see also nsimsgincomingserver ...
nsIMsgSearchNotify
ews/ base/ search/ public/ nsimsgsearchnotify.idl [scriptable, uuid(ca37784d-352b-4c39-8ccb-0abc1a93f681)] interface nsimsgsearchnotify : nsisupports { void onsearchhit(in nsimsgdbhdr header, in nsimsgfolder folder); // notification that a search has finished. void onsearchdone(in nsresult status); /* * until we can encode searches with a uri, this will be an * out-of-bound way to connect a set of search terms to a datasource */ /* * called when a new search begins */ void onnewsearch(); }; ...
nsIMsgWindow
t the existing message pane and header should be cleared before the html is displayed. stopurls() this is equivalent to calling stop(nsiwebnavigation::stop_network) on the nsiwebnavigation object. void stopurls(); closewindow() when the msg window is being unloaded from the content window, this notification can be used to force a flush on anything the message window hangs on. for some reason xpconnect is still hanging onto the message window even though all of our objects have let go of it. this forces a release. it clears out the content listener, the windowcommands, the statusfeedback and the docshell objects. void closewindow(); remarks see also ...
nsINavHistoryObserver
id onvisit( in nsiuri auri, in long long avisitid, in prtime atime, in long long asessionid, in long long areferringid, in unsigned long atransitiontype, in acstring aguid, out unsigned long aadded ); parameters auri the uri of the page being visited. avisitid id of the visit that was just created. atime time of the visit. asessionid the id of one connected sequence of visits. areferringid the id of the visit the user came from. 0 if empty. atransitiontype the type of the item that is about to be removed; this is one of the nsinavbookmarksservice.constants defined in the nsinavbookmarksservice interface. aguid the unique id associated with the page. aadded incremented by query nodes when the visited uri belongs to ...
nsIProtocolHandler
allows_proxy_http 1<<3 the protocol handler can be proxied using an http proxy (for example, http and ftp). nsiioservice.newchannelfromuri() will feed uris from this protocol handler to the http protocol handler instead. this flag is ignored if allows_proxy is not set. methods allowport() lets a protocol override blacklisted ports. this method is called when there's an attempt to connect to a port that is blacklisted. for example, for most protocols, port 25 (simple mail transfer protocol) is banned. when a uri containing this port number is encountered, this method is called to ask if the protocol handler wants to override the ban. boolean allowport( in long port, in string scheme ); parameters port the port for which an override is being requested. scheme the schem...
nsIProtocolProxyCallback
n nsiuri auri, in nsiproxyinfo aproxyinfo, in nsresult astatus ); parameters arequest the value returned from asyncresolve. auri the uri passed to asyncresolve. aproxyinfo the resulting proxy info or null if there is no associated proxy info for auri. as with the result of nsiprotocolproxyservice's resolve method, a null result implies that a direct connection should be used. astatus the status of the callback. this is a failure code if the request could not be satisfied, in which case the value of astatus indicates the reason for the failure and aproxyinfo will be null. the value returned from asyncresolve. see also nsicancelable nsiuri nsiproxyinfo nsiprotocolproxyservice ...
nsIProtocolProxyFilter
such as newproxyinfo. auri the uri for which these proxy settings apply. aproxy the proxy (or list of proxies) that would be used by default for the given uri. this may be null. return value the proxy (or list of proxies) that should be used in place of aproxy. this can be just be aproxy if the filter chooses not to modify the proxy. it can also be null to indicate that a direct connection should be used. use aproxyservice.newproxyinfo to construct nsiproxyinfo objects. see also nsiproxyinfo nsiprotocolproxyservice ...
nsIProxyInfo
mber of the proxy server. read only. note: prior to gecko 1.8 port was available by the port method. type acstring this attribute specifies the type of the proxy server as a case insensitive ascii string. some special values for this attribute include (but are not limited to) the following: "http" - http proxy (or ssl connect for https) "socks" - socks v5 proxy "socks4" - socks v4 proxy "direct" - no proxy "unknown" - unknown proxy (see nsiprotocolproxyservice.resolve()) 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 ...
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. ...
nsIScriptError2
1.0 66 introduced gecko 2.0 obsolete gecko 12.0 inherits from: nsiscripterror last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) in gecko 12.0 this interface was merged into the nsiscripterror interface. ...
nsITaskbarPreviewController
d on microsoft windows to provide the behavior of taskbar previews. its methods and properties are used by the nsitaskbarpreview interface. 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) clients should provide their own implementation of this interface. depending on whether the controller is connected to an nsitaskbartabpreview or nsitaskbarwindowpreview, only certain methods and attributes 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 nsitaskbarpreviewbu...
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. shortsecuritydescription wstring for secure connections (ssl) gives the common name (cn) of the certifying authority. read only. see also nsisockettransport ...
nsITreeView
n the value of the cell has been set by the user. this method is only called for columns of type other than text. void setcellvalue( in long row, in nsitreecolumn col, in astring value ); parameters row the row of the cell. col the column of the cell. value the value to change the cell to. settree() called when setting or clearing the view on the tree to link the view to or disconnect the front end box object. void settree( in nsitreeboxobject tree ); parameters tree the nsitreeboxobject to attach this view to, or null if the view is being removed from the tree. toggleopenstate() called on the view when an item is opened or closed, e.g., by clicking the twisty, keyboard access, et cetera. note: as of this writing (gecko 2.0), custom nsitreeview implementations mus...
nsIWinTaskbar
atetaskbartabpreview( in nsidocshell shell, in nsitaskbarpreviewcontroller controller ); parameters shell an nsidocshell object representing the top-level window from which to create the preview. controller an nsitaskbarpreviewcontroller you implement. return value an nsitaskbartabpreview object for the new tab preview. ...
nsIXPCException
js/src/xpconnect/idl/xpcexception.idlscriptable these exception objects are the preferred types of exceptions when implementing xpcom interfaces in javascript. inherits from: nsiexception last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void initialize(in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner); xpcexjsval stealjsval(); native code only! void stowjsval(in xpcexjscontextptr cx, in xpcexjsval val); native code only! methods initialize() void initialize( in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner ); parameters amessage aresult aname alocation ...
nsIXmlRpcClient
tionary can only hold any of the supported input types. return value will be converted as follows: i4 or int: nsisupportsprint32 boolean: nsisupportsprbool string: nsisupportscstring double: nsisupportsdouble datetime.iso8601: nsisupportsprtime base64: nsisupportscstring array: nsisupportsarray struct: nsidictionary faults (server side errors) are indicated by returning ns_error_failure. via nsixpconnect::getpendingexception()->data a nsixmlrpcfault object can be retreieved with more information on the fault. parameters listener a nsixmlrpcclientlistener that will get notified of xml-rpc events ctxt a context to be passed on to the listener methodname remote method to call arguments array of arguments to pass to the remote method count void asynccall ( in nsixmlrpcclientlistener lis...
nsIXmlRpcFault
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. extensions/xml-rpc/idl/nsixmlrpcclient.idlscriptable an xml-rpc exception. xml-rpc server fault codes are returned wrapped in this; access it using nsixpconnect.getpendingexception->data. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void init(in print32 faultcode, in string faultsring); string tostring(); attributes attribute type description faultcode print32 read only. faultstring string read only. methods init() void getdata( in print32 fault...
Weak reference
ence; and nsiweakreference::queryreferent gives you the same functionality as queryinterface for getting back. additionally, nscomptr now supports the new key do_queryreferent to simplify life even further. how do i make a class support weak references? in javascript, just make sure that your queryinterface method returns your object for the nsisupportsweakreference interface, and you're set; xpconnect does all the work for you. just roll in nssupportsweakreference, a mix-in class that does all the work, and adjust your queryinterface accordingly, e.g., //... #include "nsweakreference.h" class nsfoo : public nsifoo, ..., public nssupportsweakreference { ... }; // ...if you used the table macros to implement |queryinterface|, add an entry ns_interface_map_begin(nsfoo) // ... ns_interfa...
Working with out parameters
vor, out nsisupports adata, out unsigned long adatalen ) ; ... } the gettransferdata method takes three parameters, aflavor, adata, and adatalen, and returns nothing. adata and adatalen are marked as out, meaning that they act as "return values" for this method, and are changed during the method call. these are so-called out parameters. usage in order to use such a method from javascript via xpconnect, you have to follow a specific rule. to get at the out parameters, you have to pass in an object. after the call, this object will have a new property called value, which contains the out values. assuming you have an object called transferable, you would invoke gettransferdata() as follows: var adata = {}; var adatalen = {}; transferable.gettransferdata("text/unicode", adata, adatalen); var ...
XPIDL
f it chooses to replace it. buffers must be deallocated with ns_free, and interface pointers must be release'd. afterwards, the above rules for out apply. shared out-parameters should not be freed, as they are intended to refer to constant string literals. resources (mostly outdated) some unsorted notes including a keyword list xpidl is a tool for generating c++ headers, java interfaces, xpconnect typelibs, and html documentation from xpidl files generating xpt files on windows a google groups post with instructions on how to use variable-length argument lists using xpidl. ...
Autoconfiguration in Thunderbird
author: ben bucksch please do not change this document without consulting the author thunderbird 3.1 and later (and 3.0 to some degree) includes mail account autoconfiguration functionality. the goal of autoconfiguration is to make it very easy for users to configure the connection of thunderbird to their 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, de...
nsIMsgCloudFileProvider
g 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 quota. uploadexceedsfilelimit 0x8055311c returned when uploading has failed because th...
Filelink Providers
fest. also, you must add the component's contract id to the "cloud-file" category. see cloudfile/cloudfilecomponents.manifest for an example, as well as this document on chrome.manifest files. the account setup dialog the account setup dialog allows the user to select what account type they would like to create from a menulist. some providers require thunderbird to do very little in order to connect a user to their account. other providers however may require the user to fill in additional details in order to connect to the service. hightail, for example, requires a username and password. other services may require the user to fill in a server string or port number. a provider implementation can choose what information it gets from the user from the setup dialog by pointing the settingsurl ...
Creating a Custom Column
up and creation of an extension please read building a thunderbird extension. adding a column by far the easiest part is the physical addition of the column. for this we overlay messenger.xul, by placing the following line in our chrome.manifest file: overlay chrome://messenger/content/messenger.xul chrome://replyto_col/content/replyto_col_overlay.xul now that our overlay is set up we need to connect a column to the current columns that exist. looking in messenger.xul reveals that the columns reside inside a tree with the id "threadtree" whose columns (treecols) reside in "threadcols". to attach our column we add another treecol tag ("colreplyto") with the settings that we would like to use. don't forget to add in a splitter before the column to ensure that the user can easily resize and drag...
Styling the Folder Pane
ags.<name> returns the folder type if it is a special folder (or "none" if it is a regular folder). for example, if the inbox flag is set, this will be "inbox". biffstate-biffstate afolder.biffstate == nsimsgfolder.nsmsgbiffstate_<name> indicates whether or not the folder has new messages. issecure-{true, false} afolder.server.issecure indicates whether or not the connection to the server will be secure. newmessages-true afolder.hasnewmessages subfoldershaveunreadmessages-true afolder.getnumunread(true) > afolder.getnumunread(false) indicates whether or not subfolders have unread messages. noselect-{true, false} afolder.noselect indicates whether or not the folder is selectable. imapshared-{true, false} af...
Working with windows in chrome code
m2: 42 }; args.wrappedjsobject = args; var watcher = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interfaces.nsiwindowwatcher); watcher.openwindow(null, url, windowname, features, args); // in the window code var args = window.arguments[0].wrappedjsobject; this uses the wrappedjsobject trick. by passing args to openwindow xpconnect will automatically wrap it as a generic nsisupports. the opened window can then just get at the underlying javascript object using wrappedjsobject. advanced data sharing the above code is useful when you need to pass data from one window to another or to a set of windows, but sometimes you just want to share a javascript variable in common between different windows. you could declare a local va...
Blocking By Domain - Plugins
site performance and reduce the number of plugin prompts that users see, popular sites that show unnecessary plugin prompts or slow the browser down with unnecessary plugins will be added to the plugin block list. list contents and updates the plugin block lists are freely-licensed lists maintained by mozilla in github. the initial contents of the third-party plugin block list are based on disconnect's open source blocklist. subsequent updates to the list will be made using telemetry from firefox experiments. in general, sites will not be removed from the list unless there is an error that renders a site in a seriously defective manner. any concerns or questions about the plugin block lists should be directed to plugin-blocking-by-domain@mozilla.com. ...
Constants - Plugins
mber; 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 notification of completion. npvers_has_liveconnect 9 liveconnect. npvers_win16_has_liveconnect 9 liveconnect (win16). npvers_68k_has_liveconnect 11 liveconnect (68k). npvers_has_windowless 11 windowless plug-in. npvers_has_xpconnect_scripting 13 plug-in is scriptable using xpconnect. npvers_has_npruntime_scripting 14 plug-in is scriptable using npruntime. np...
Scripting plugins - Plugins
untime, that have been developed by a group of browser and plugin vendors, including the mozilla foundation, adobe, apple, opera, and sun microsystems (see press release). this document also explains how to make a plugin use these new extensions to be scriptable as well as how to access objects in a browser. (a bit of history: npapi plugins that used to take advantage of being scriptable via liveconnect in 4.x netscape browsers lost this possibility in mozilla (due to the jni making the netscape 4.x jri obsolete). as an answer to this large gap in the netscape plugin api, an extension to the api has been developed that lets plugins be scriptable again, independent of java. this extension will also let plugins access the script objects in the browser, and is thus a much stronger and more flexible...
Accessibility Inspector - Firefox Developer Tools
es of the accessibility inspector and how to use it. a (very) brief guide to accessibility accessibility is the practice of making your websites usable by as many people as possible. this means trying your best to not lock anyone out of accessing information because of any disability they may have, or any other personal circumstances such as the device they are using, the speed of their network connection, or their geographic location or locale. you can find more extensive information in the accessibility section of mdn web docs. here we are mainly talking about exposing information to people with visual disabilities — this is done via the accessibility apis available inside web browsers, which expose information on what roles the different elements on your page play (e.g., are they just tex...
DOM Inspector internals - Firefox Developer Tools
ving most of its contents to be added by the overlays. using modular overlays also allows for common xul to be shared across the various documents that make up the dom inspector's ui, although not all overlays are shared by multiple consumers. single-consumer overlays exist solely for organization. in some cases overlays are overlaid by other overlays. if we imagine a tree structure obtained by connecting overlays as children to the files they overlay, while ignoring any overlays used for host integration, we can visualize the host-agnostic overlay tree for a given file. here's the expanded, host-agnostic overlay tree for inspector.xul: chrome://inspector/content/inspector.xul chrome://inspector/content/inspectoroverlay.xul chrome://inspector/content/toolboxoverlay.xul chrome:...
Add-ons - Firefox Developer Tools
developer tools that are not built into firefox, but ship as separate add-ons. websocket monitor examine the data exchanged in a websocket connection. this add-on is no longer available, as it requires older versions of firefox. you might give websocket sniffer a try. it's not as detailed but may help. ...
Browser Toolbox - Firefox Developer Tools
ebugging toolboxes" and "enable remote debugging". opening the browser toolbox open the browser toolbox through the menu button and the menu items "developer" then "browser toolbox". you can also open it with the ctrl + alt +shift + i key combination ( cmd + opt +shift + i on a mac). you will be presented with a dialog like this (it can be removed by setting the devtools.debugger.prompt-connection property to false): click ok, and the browser toolbox will open in its own window: you'll be able to inspect the browser's chrome windows and see, and be able to debug, all the javascript files loaded by the browser itself and by any add-ons that are running. altogether you will have access to the following developer tools: debugger (note: if you want to debug a specific add-on that is ...
The Firefox JavaScript Debugger - Firefox Developer Tools
to find your way around the debugger, here's a quick tour of the ui. ...
Dominators - Firefox Developer Tools
create and use objects, and when the objects are no longer needed, the runtime takes care of cleaning up, and frees the memory the objects occupied. reachability in modern javascript implementations, the runtime decides whether an object is no longer needed based on reachability. in this system the heap is represented as one or more graphs. each node in the graph represents an object, and each connection between nodes (edge) represents a reference from one object to another. the graph starts at a root node, indicated in these diagrams with "r". during garbage collection, the runtime traverses the graph, starting at the root, and marks every object it finds. any objects it doesn't find are unreachable, and can be deallocated. so when an object becomes unreachable (for example, because it is...
Dominators view - Firefox Developer Tools
e dominators tree panel: here, we've selected an object, and can see a single path back to a gc root. the window gc root holds a reference to an htmldivelement object, and that holds a reference to an object, and so on. if you look in the dominators tree panel, you can trace the same path there. if either of these references were removed, the items below them could be garbage-collected. each connection in the graph is labeled with the variable name for the referenced object. sometimes there's more than one retaining path back from a node: here there are three paths back from the documentprototype node to a gc root. if one were removed, then the documentprototype would still not be garbage-collected, because it's still retained by the other two path. example let's see how some simple co...
Throttling - Firefox Developer Tools
throttling the toolbar includes a throttling dropdown, which allows you to throttle your network speed to emulate various different network speed conditions. simply choose an option from the menu, and it will persist across reloads. ...
Network monitor toolbar - Firefox Developer Tools
perties. a set of tool icons: pause (or resume) recording network log search the log request blocking an array of buttons to filter the network request list by type: by the content type of the response xhr requests websocket upgrades and messages (labeled ws) other requests a checkbox that allows you to disable caching. throttling menu, to simulate various connection types a menu of other actions: persist logs: by default, the network monitor is cleared each time you navigate to a new page or reload the current page. when you select persist logs, the log is not cleared on page load. import har imports a har (http archive) file. save all as har opens a file dialog box so you can save the current contents of the network log as a har file with th...
Page Inspector - Firefox Developer Tools
user interface tour to find your way around the inspector, here's a quick tour of the ui. you can split the rules view out into its own pane, separate from the other tabs on the css pane — this is called 3-pane mode. ...
Allocations - Firefox Developer Tools
s were seen directly in these functions. however, removeinner() has 8901 in total count, while setselectioninner() has just 3 in total count. this is telling us that, of the 8904 allocations seen in signallater(), all but three came through the removeinner() branch. allocations and garbage collection of course, the memory allocated by a site is in itself useful information to know. but the main connection between the allocation profile of a site and its responsiveness is the cost of garbage collection (gc). with a garbage-collected language, like javascript, the runtime periodically needs to walk the heap looking for objects that are no longer reachable, and then freeing the memory they occupy. while gc events like this are executing, the javascript engine must be paused, so your program is su...
Remote Debugging - Firefox Developer Tools
you can use the firefox developer tools on your desktop to debug web sites and web apps running in other browsers or runtimes. the other browser might be on the same device as the tools themselves or on a different device, such as a phone connected over usb. the detailed instructions for connecting the developer tools are specific to the runtime. you can connect the developer tools to gecko-based runtimes like firefox desktop, firefox for android, and thunderbird. firefox desktop firefox for android over usb ...
IndexedDB - Firefox Developer Tools
array of indexes present in the object store as shown below. when an object store is selected in the storage tree, all the items in that object store are listed in the table. ...
ANGLE_instanced_arrays.drawArraysInstancedANGLE() - Web APIs
g webgl2, this method is available as gl.drawarraysinstanced() by default. syntax void ext.drawarraysinstancedangle(mode, first, count, primcount); parameters mode a glenum specifying the type primitive to render. possible values are: gl.points: draws a single dot. gl.line_strip: draws a straight line to the next vertex. gl.line_loop: draws a straight line to the next vertex, and connects the last vertex back to the first. gl.lines: draws a line between a pair of vertices. gl.triangle_strip gl.triangle_fan gl.triangles: draws a triangle for a group of three vertices. first a glint specifying the starting index in the array of vector points. count a glsizei specifying the number of indices to be rendered. primcount a glsizei specifying the number of instances of ...
ANGLE_instanced_arrays.drawElementsInstancedANGLE() - Web APIs
his method is available as gl.drawelementsinstanced() by default. syntax void ext.drawelementsinstancedangle(mode, count, type, offset, primcount); parameters mode a glenum specifying the type primitive to render. possible values are: gl.points: draws a single dot. gl.line_strip: draws a straight line to the next vertex. gl.line_loop: draws a straight line to the next vertex, and connects the last vertex back to the first. gl.lines: draws a line between a pair of vertices. gl.triangle_strip gl.triangle_fan gl.triangles: draws a triangle for a group of three vertices. count a glsizei specifying the number of elements to be rendered. type a glenum specifying the type of the values in the element array buffer. possible values are: gl.unsigned_byte gl.unsigned_s...
AddressErrors - Web APIs
ppingaddresserrors.country = invalidcountryerror; updatedetails = { error: genericaddresserror, shippingaddresserrors, ...defaultpaymentdetails }; } ev.updatewith(updatedetails); } see handling address changes for a description of how this code works. 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 donation payment itself. javascript payment request data first, we declare the variables supportedhandlers, which is compatible with paymentmethoddat...
AudioBuffer.getChannelData() - Web APIs
= 0; i < framecount; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } // get an audiobuffersourcenode. // this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); } specification specification status comment web audio apithe definition of 'getchanneldata' in that specification. working draft ...
AudioBuffer - Web APIs
var i = 0; i < myarraybuffer.length; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } // get an audiobuffersourcenode. // this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); specifications specification status comment web audio apithe definition of 'audiobuffer' in that specification. working draft initial definition. ...
AudioBufferSourceNode.detune - Web APIs
working draft ...
AudioBufferSourceNode.loop - Web APIs
buffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } specification s...
AudioBufferSourceNode.loopEnd - Web APIs
loopstartcontrol.oninput = function() { source.loopstart = loopstartcontrol.value; loopstartvalue.i...
AudioBufferSourceNode.loopStart - Web APIs
loopstartcontrol.oninput = function() { source.loopstart = loopstartcontrol.value; loopstartvalue.i...
AudioBufferSourceNode.playbackRate - Web APIs
buffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } stop.onclick = function()...
AudioBufferSourceNode - Web APIs
(var i = 0; i < myarraybuffer.length; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } // get an audiobuffersourcenode. // this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); for a decodeaudiodata() example, see the audiocontext.decodeaudiodata() page. specifications specification status comment web audio apithe definition of 'audiobuffersourcenode' in that specification. working draf...
AudioContext.createJavaScriptNode() - Web APIs
0; // initial sample number this.context = context; this.node = context.createjavascriptnode(1024, 1, 1); this.node.onaudioprocess = function(e) { that.process(e) }; } sinewave.prototype.process = function(e) { var data = e.outputbuffer.getchanneldata(0); for (var i = 0; i < data.length; ++i) { data[i] = math.sin(this.x++); } } sinewave.prototype.play = function() { this.node.connect(this.context.destination); } sinewave.prototype.pause = function() { this.node.disconnect(); } see also generating tones with the web audio api exploring the html5 web audio: visualizing sound ...
AudioContext.createMediaStreamSource() - Web APIs
iosourcenode // feed the htmlmediaelement into it var audioctx = new audiocontext(); var source = audioctx.createmediastreamsource(stream); // create a biquadfilter var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.oninput = function() {...
AudioDestinationNode.maxChannelCount - Web APIs
ount cannot be changed. syntax var audioctx = new audiocontext(); var mydestination = audioctx.destination; mydestination.maxchannelcount = 2; value an unsigned long. example the following would set up a simple audio graph, featuring an audiodestinationnode with maxchannelcount of 2: var audioctx = new audiocontext(); var source = audioctx.createmediaelementsource(mymediaelement); source.connect(gainnode); audioctx.destination.maxchannelcount = 2; gainnode.connect(audioctx.destination); to see a more complete implementation, check out one of our mdn web audio examples, such as voice-change-o-matic or violent theremin. specifications specification status comment web audio apithe definition of 'maxchannelcount' in that specification. working draft ...
AudioDestinationNode - Web APIs
inherits methods from its parent, audionode. example there is no complex set up for using an audiodestinationnode — by default, this simply represents the output of the user's system (e.g. their speakers), so you can get it hooked up inside an audio graph using only a few lines of code: var audioctx = new audiocontext(); var source = audioctx.createmediaelementsource(mymediaelement); source.connect(gainnode); gainnode.connect(audioctx.destination); to see a more complete implementation, check out one of our mdn web audio examples, such as voice-change-o-matic or violent theremin. specifications specification status comment web audio apithe definition of 'audiodestinationnode' in that specification. working draft ...
AudioListener - Web APIs
a double value representing the amount of pitch shift to use when rendering a doppler effect. audiolistener.speedofsound is a double value representing the speed of sound, in meters per second. in a previous version of the specification, the dopplerfactor and speedofsound properties and the setposition() method could be used to control the doppler effect applied to audiobuffersourcenodes connected downstream — these would be pitched up and down according to the relative speed of the pannernode and the audiolistener. these features had a number of problems: only audiobuffersourcenodes were pitched up or down, not other source nodes. the behavior to adopt when an audiobuffersourcenode was connected to multiple pannernodes was unclear. because the velocity of the panner and the liste...
AudioNode.channelInterpretation - Web APIs
re dropped. syntax var oscillator = audioctx.createoscillator(); oscillator.channelinterpretation = 'discrete'; value an enumerated value representing a channelinterpretation. example var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var oscillator = audioctx.createoscillator(); var gainnode = audioctx.creategain(); oscillator.connect(gainnode); gainnode.connect(audioctx.destination); oscillator.channelinterpretation = 'discrete'; specifications specification status comment web audio apithe definition of 'channelinterpretation' in that specification. working draft ...
AudioNode.context - Web APIs
Web › API › AudioNode › context
ng graph the node is participating in. syntax var acontext = anaudionode.context; value the audiocontext or offlineaudiocontext object that was used to construct this audionode. example const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); const oscillator = audioctx.createoscillator(); const gainnode = audioctx.creategain(); oscillator.connect(gainnode).connect(audioctx.destination); console.log(oscillator.context); // audiocontext console.log(oscillator.context === audioctx); // true specifications specification status comment web audio apithe definition of 'context' in that specification. working draft ...
AudioNode.numberOfInputs - Web APIs
nputs property of the audionode interface returns the number of inputs feeding the node. source nodes are defined as nodes having a numberofinputs property with a value of 0. syntax var numinputs = audionode.numberofinputs; value an integer ≥ 0. example const audioctx = new audiocontext(); const oscillator = audioctx.createoscillator(); const gainnode = audioctx.creategain(); oscillator.connect(gainnode).connect(audioctx.destination); console.log(oscillator.numberofinputs); // 0 console.log(gainnode.numberofinputs); // 1 console.log(audioctx.destination.numberofinputs); // 1 specifications specification status comment web audio apithe definition of 'numberofinputs' in that specification. working draft ...
AudioNode.numberOfOutputs - Web APIs
y of the audionode interface returns the number of outputs coming out of the node. destination nodes — like audiodestinationnode — have a value of 0 for this attribute. syntax var numoutputs = audionode.numberofoutputs; value an integer ≥ 0. example const audioctx = new audiocontext(); const oscillator = audioctx.createoscillator(); const gainnode = audioctx.creategain(); oscillator.connect(gainnode).connect(audioctx.destination); console.log(oscillator.numberofoutputs); // 1 console.log(gainnode.numberofoutputs); // 1 console.log(audioctx.destination.numberofoutputs); // 0 specifications specification status comment web audio apithe definition of 'numberofoutputs' in that specification. working draft ...
AudioNodeOptions - Web APIs
by the option objects of the different types of audio node constructors. see for example analysernode.analysernode or gainnode.gainnode. syntax var audionodeoptions = { "channelcount" : 2, "channelcountmode" : "max", "channelinterpretation" : "discrete" } properties channelcount optional represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. (see audionode.channelcount for more information.) its usage and precise definition depend on the value of audionodeoptions.channelcountmode. channelcountmode optional represents an enumerated value describing the way channels must be matched between the node's inputs and outputs. (see audionode.channelcountmode for more information including default values.) cha...
AudioParam.exponentialRampToValueAtTime() - Web APIs
script'); pre.innerhtml = myscript.innerhtml; var exprampplus = document.queryselector('.exp-ramp-plus'); var exprampminus = document.queryselector('.exp-ramp-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set its gain value to 0.5 var gainnode = audioctx.creategain(); // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination gainnode.gain.setvalueattime(0, audioctx.currenttime); source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick exprampplus.onclick = function() { gainnode.gain.exponentialramptovalueattime(1.0, audioctx.currenttime + 2); } exprampminus.onclick = function() { gain...
AudioParam.linearRampToValueAtTime() - Web APIs
e.innerhtml = myscript.innerhtml; var linearrampplus = document.queryselector('.linear-ramp-plus'); var linearrampminus = document.queryselector('.linear-ramp-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination gainnode.gain.setvalueattime(0, audioctx.currenttime); source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick linearrampplus.onclick = function() { gainnode.gain.linearramptovalueattime(1.0, audioctx.currenttime + 2); } linearrampminus.onclick = function() { gai...
AudioParam.setTargetAtTime() - Web APIs
us = document.queryselector('.at-time-plus'); var attimeminus = document.queryselector('.at-time-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); gainnode.gain.value = 0.5; var currgain = gainnode.gain.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick attimeplus.onclick = function() { currgain = 1.0; gainnode.gain.settargetattime(1.0, audioctx.currenttime + 1, 0.5); } attimeminus.onclick = function() { currgain = 0; gainnode.gain.settargetattime(0, au...
AudioParam.setValueAtTime() - Web APIs
'.set-target-at-time-plus'); var targetattimeminus = document.queryselector('.set-target-at-time-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); gainnode.gain.value = 0.5; var currgain = gainnode.gain.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick targetattimeplus.onclick = function() { currgain += 0.25; gainnode.gain.setvalueattime(currgain, audioctx.currenttime + 1); } targetattimeminus.onclick = function() { currgain -= 0.25; gainnode.gain.setv...
AudioParam.setValueCurveAtTime() - Web APIs
'script'); pre.innerhtml = myscript.innerhtml; var valuecurve = document.queryselector('.value-curve'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); gainnode.gain.value = 0.5; var currgain = gainnode.gain.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination source.connect(gainnode); gainnode.connect(audioctx.destination); // set button to do something onclick var wavearray = new float32array(9); wavearray[0] = 0.5; wavearray[1] = 1; wavearray[2] = 0.5; wavearray[3] = 0; wavearray[4] = 0.5; wavearray[5] = 1; wavearray[6] = 0.5; wavearray[7] = 0; wavearray[8] = 0.5; va...
AudioProcessingEvent - Web APIs
// loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } ...
AudioScheduledSourceNode.start() - Web APIs
lue specified for when is negative. example this example demonstrates how to create an oscillatornode which is scheduled to start playing in 2 seconds and stop playing 1 second after that. the times are calculated by adding the desired number of seconds to the context's current time stamp returned by audiocontext.currenttime. context = new audiocontext(); osc = context.createoscillator(); osc.connect(context.destination); /* schedule the start and stop times for the oscillator */ osc.start(context.currenttime + 2); osc.stop(context.currenttime + 3); specifications specification status comment web audio apithe definition of 'start()' in that specification. working draft ...
AudioScheduledSourceNode.stop() - Web APIs
calling start(). rangeerror the value specified for when is negative. example this example demonstrates starting an oscillator node, scheduled to begin playing at once and to stop playing in one second. the stop time is determined by taking the audio context's current time from audiocontext.currenttime and adding 1 second. context = new audiocontext(); osc = context.createoscillator(); osc.connect(context.destination); /* let's play a sine wave for one second. */ osc.start(); osc.stop(context.currenttime + 1); specifications specification status comment web audio apithe definition of 'stop()' in that specification. working draft ...
AudioWorkletGlobalScope.registerProcessor - Web APIs
e done in a separate file. // test-processor.js class testprocessor extends audioworkletprocessor { process (inputs, outputs, parameters) { return true } } registerprocessor('test-processor', testprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode — passing it the processor name that we used when calling registerprocessor — and connect it to an audio graph. const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('test-processor.js') const node = new audioworkletnode(audiocontext, 'test-processor') node.connect(audiocontext.destination) specifications specification status comment web audio apithe definition of 'registerprocessor()' in that specification. working draft ...
AudioWorkletGlobalScope - Web APIs
sole.log(samplerate) // you can declare any variables and use them in your processors // for example it may be an arraybuffer with a wavetable const usefulvariable = 42 console.log(usefulvariable) registerprocessor('test-processor', testprocessor) next, in our main scripts file we'll load the processor, create an instance of audioworkletnode — passing the name of the processor to it — and connect the node to an audio graph. we should see the output of console.log calls in the console: const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('test-processor.js') const testnode = new audioworkletnode(audiocontext, 'test-processor') testnode.connect(audiocontext.destination) specifications specification status comment web audio apithe defi...
BaseAudioContext.createBuffer() - Web APIs
(var i = 0; i < myarraybuffer.length; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } // get an audiobuffersourcenode. // this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); specifications specification status comment web audio apithe definition of 'createbuffer()' in that specification. working draft ...
BaseAudioContext.createBufferSource() - Web APIs
= 0; i < framecount; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } // get an audiobuffersourcenode. // this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); } specifications specification status comment web audio apithe definition of 'createbuffersource()' in that specification. working draft ...
BaseAudioContext.createDelay() - Web APIs
't start playing for a short amount of time. var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var synthdelay = audioctx.createdelay(5.0); ... var synthsource; playsynth.onclick = function() { synthsource = audioctx.createbuffersource(); synthsource.buffer = buffers[2]; synthsource.loop = true; synthsource.start(); synthsource.connect(synthdelay); synthdelay.connect(destination); this.setattribute('disabled', 'disabled'); } stopsynth.onclick = function() { synthsource.disconnect(synthdelay); synthdelay.disconnect(destination); synthsource.stop(); playsynth.removeattribute('disabled'); } ... var delay1; rangesynth.oninput = function() { delay1 = rangesynth.value; synthdelay.delaytime.setvalueattime(delay1, au...
BaseAudioContext.createOscillator() - Web APIs
remin demo (see app.js for relevant code); also see our oscillatornode page for more information. // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(3000, audioctx.currenttime); // value in hertz oscillator.connect(audioctx.destination); oscillator.start(); specifications specification status comment web audio apithe definition of 'createoscillator' in that specification. working draft ...
BaseAudioContext.createPeriodicWave() - Web APIs
ustrates simple usage of createperiodicwave(), to create a periodicwave object containing a simple sine wave. var real = new float32array(2); var imag = new float32array(2); var ac = new audiocontext(); var osc = ac.createoscillator(); real[0] = 0; imag[0] = 0; real[1] = 1; imag[1] = 0; var wave = ac.createperiodicwave(real, imag, {disablenormalization: true}); osc.setperiodicwave(wave); osc.connect(ac.destination); osc.start(); osc.stop(2); this works because a sound that contains only a fundamental tone is by definition a sine wave here, we create a periodicwave with two values. the first value is the dc offset, which is the value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values a...
BaseAudioContext.createScriptProcessor() - Web APIs
// loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specifications specification status comment web audio apithe definition of 'createscriptprocessor' in that specif...
BaseAudioContext.destination - Web APIs
nnode. example note: for a full example implementation, see one of our web audio demos on the mdn github repo, like voice-change-o-matic. var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // older webkit/blink browsers require a prefix var oscillatornode = audioctx.createoscillator(); var gainnode = audioctx.creategain(); oscillatornode.connect(gainnode); gainnode.connect(audioctx.destination); specifications specification status comment web audio apithe definition of 'destination' in that specification. working draft ...
BluetoothCharacteristicProperties - Web APIs
with response is permitted. writewithoutresponseread only returns a boolean that is true if the writing to the characteristic without response is permitted. examples the following example shows how tell if a gatt characteristic supports value change notifications. ...
gattServer - Web APIs
the bluetoothdevice.gattserver read-only property returns a reference to the device's gatt server or null if the device is disconnected. syntax var gattserver = instanceofbluetoothdevice.gattserver returns a reference to the device's gatt server or null if the device is disconnected. ...
BluetoothDevice - Web APIs
the device_information service. bluetoothdevice.productversion read only the 16-bit product version field in the pnp_id characteristic in the device_information service. bluetoothdevice.paired read only a boolean value indicating whether the device is paired with the system. bluetoothdevice.gattserver read only a reference to the device's gatt server or null if the device is disconnected. methods bluetoothdevice.watchadvertisments() a promise that resolves to undefined or is rejected with an error if advetisments can’t shown for any reason. bluetoothdevice.unwatchadvertisments() stops watching for advertisments. bluetoothdevice.connectgatt() a promise that resolves to an instance of bluetoothgattremoteserver. specifications specification statu...
BroadcastChannel() - Web APIs
the broadcastchannel() constructor creates a new broadcastchannel and connects it to the underlying channel. note: this feature is available in web workers. syntax channel = new broadcastchannel(channel); values channel is a domstring representing the name of the channel; there is one single channel with this name for all browsing contexts with the same origin. example // create a new channel listening to the "internal_notification" channel. var bc = new broadcastchannel('internal_notification'); bc.postmessage('new listening connected!'); specifications specification status comment html living standardthe definition of 'broadcastchannel()' in that specification. living standard initial definition. ...
BroadcastChannel.close() - Web APIs
the broadcastchannel.close() terminates the connection to the underlying channel, allowing the object to be garbage collected. this is a necessary step to perform as there is no other way for a browser to know that this channel is not needed anymore. note: this feature is available in web workers. syntax var str = channel.close(); example // connect to a channel var bc = new broadcastchannel('test_channel'); // more operations (like postmessage, …) // when done, disconnect from the channel bc.close(); specifications specification status comment html living standardthe definition of 'broadcastchannel.close()' in that specification. living standard initial definition. ...
BroadcastChannel.name - Web APIs
the read-only broadcastchannel.name property returns a domstring, which uniquely identifies the given channel with its name. this name is passed to the broadcastchannel() constructor at creation time and is therefore read-only. note: this feature is available in web workers. syntax var str = channel.name; examples // connect to a channel var bc = new broadcastchannel('test_channel'); // more operations (like postmessage, …) // log the channel name to the console console.log(bc.name); // "test_channel" // when done, disconnect from the channel bc.close(); specifications specification status comment html living standardthe definition of 'broadcastchannel.name' in that specification. living standard initial definition. ...
CanvasRenderingContext2D.createLinearGradient() - Web APIs
this method returns a linear canvasgradient. to be applied to a shape, the gradient must first be assigned to the fillstyle or strokestyle properties. note: gradient coordinates are global, i.e., relative to the current coordinate space. when applied to a shape, the coordinates are not relative to the shape's coordinates. syntax canvasgradient ctx.createlineargradient(x0, y0, x1, y1); the createlineargradient() method is specified by four parameters defining the start and end points of the gradient line. ...
CloseEvent() - Web APIs
the closeevent() constructor creates a new closeevent. syntax var event = new closeevent(typearg, closeeventinit); values typearg is a domstring representing the name of the event. closeeventinit optional is a closeeventinit dictionary, having the following fields: "wasclean", optional and defaulting to false, of type long, indicates if the connection has been closed cleanly or not. "code", optional and defaulting to 0, of type unsigned short, that is the connection close code sent by the server. "reason", optional and defaulting to '', of type domstring, that is a human-readable reason why the server closed the connection. the closeeventinit dictionary also accepts fields from the eventinit dictionary. specifications specification status comment ...
CloseEvent.initCloseEvent() - Web APIs
asoncode, reason); parameters type the string to set the event's type to. possible types for mouse events include: click, mousedown, mouseup, mouseover, mousemove, mouseout. canbubble whether or not the event can bubble. sets the value of event.bubbles. cancelable whether or not the event's default action can be prevented. sets the value of event.cancelable. wasclean whether or not the connection was cleanly closed. reasoncode the reason of the close. reason a domstring describing the reason of the close in shuman-readable way. specifications this is no part of any specifications, though it was in some early drafts. ...
ConstantSourceNode.offset - Web APIs
sed as the input to a pair of gainnodes; this snippet is derived from the complete example you can find in controlling multiple parameters with constantsourcenode. gainnode2 = context.creategain(); gainnode3 = context.creategain(); gainnode2.gain.value = gainnode3.gain.value = 0.5; volumeslidercontrol.value = gainnode2.gain.value; constantsource = context.createconstantsource(); constantsource.connect(gainnode2.gain); constantsource.connect(gainnode3.gain); first, the gain nodes are created and configured, and a slider control's value is set to match the gain on the two nodes. then we create a new constantsourcenode and make it the source for the two gain nodes' gainnode.gain values. each of those values is also an audioparam. let's say we have an event handler (for click events, in this cas...
Credential Management API - Web APIs
to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out. this interfaces is accessible from navigator.credentials. federatedcredential provides information about credentials from a federated identity provider, which is an entity that a website trusts to correctly authenticate a user, and which provides an api for that purpose. openid connect is an example of such a framework. passwordcredential provides information about a username/password pair. publickeycredential provides a credential for logging in using an un-phishable and data-breach resistant asymmetric key pair instead of a password. specifications specification status comment credential management level 1 working draft initial definition.
CustomElementRegistry.upgrade() - Web APIs
syntax customelements.upgrade(root); parameters root a node instance with shadow-containing descendant elements that are to be upgraded. if there are no descendant elements that can be upgraded, no error is thrown. return value void. ...
CustomElementRegistry - Web APIs
nts and querying registered elements. to get an instance of it, use the window.customelements property. methods customelementregistry.define() defines a new custom element. customelementregistry.get() returns the constuctor for the named custom element, or undefined if the custom element is not defined. customelementregistry.upgrade() upgrades a custom element directly, even before it is connected to its shadow root. customelementregistry.whendefined() returns an empty promise that resolves when a custom element becomes defined with the given name. if such a custom element is already defined, the returned promise is immediately fulfilled. examples the following code is taken from our word-count-web-component example (see it live also). note how we use the customelementregistry.defin...
DataTransfer.effectAllowed - Web APIs
the datatransfer.effectallowed property specifies the effect that is allowed for a drag operation. the copy operation is used to indicate that the data being dragged will be copied from its present location to the drop location. the move operation is used to indicate that the data being dragged will be moved, and the link operation is used to indicate that some form of relationship or connection will be created between the source and drop locations. this property should be set in the dragstart event to set the desired drag effect for the drag source. within the dragenter and dragover event handlers, this property will be set to whatever value was assigned during the dragstart event, thus effectallowed may be used to determine which effect is permitted. assigning a value to effectallowed in eve...
DelayNode.delayTime - Web APIs
't start playing for a short amount of time. var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var synthdelay = audioctx.createdelay(5.0); ... var synthsource; playsynth.onclick = function() { synthsource = audioctx.createbuffersource(); synthsource.buffer = buffers[2]; synthsource.loop = true; synthsource.start(); synthsource.connect(synthdelay); synthdelay.connect(destination); this.setattribute('disabled', 'disabled'); } stopsynth.onclick = function() { synthsource.disconnect(synthdelay); synthdelay.disconnect(destination); synthsource.stop(); playsynth.removeattribute('disabled'); } ... var delay1; rangesynth.oninput = function() { delay1 = rangesynth.value; synthdelay.delaytime.setvalueattime(delay1, au...
DelayNode - Web APIs
Web › API › DelayNode
't start playing for a short amount of time. var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var synthdelay = audioctx.createdelay(5.0); ... var synthsource; playsynth.onclick = function() { synthsource = audioctx.createbuffersource(); synthsource.buffer = buffers[2]; synthsource.loop = true; synthsource.start(); synthsource.connect(synthdelay); synthdelay.connect(destination); this.setattribute('disabled', 'disabled'); } stopsynth.onclick = function() { synthsource.disconnect(synthdelay); synthdelay.disconnect(destination); synthsource.stop(); playsynth.removeattribute('disabled'); } ... var delay1; rangesynth.oninput = function() { delay1 = rangesynth.value; synthdelay.delaytime.setvalueattime(delay1, au...
Document.documentURIObject - Web APIs
for web content this property doesn't have any special meaning and can be used just like any other custom property. privileged code must be careful not to try getting or setting this property on a non-wrapped content object (e.g., on a wrappedjsobject of an xpcnativewrapper). see bug 324464's comments for details. ...
Document.ononline - Web APIs
Web › API › Document › ononline
event is fired on the <body> of each page when the browser switches between online and offline mode. additionally, the events bubble up from document.body, to document, ending at window. both events are non-cancellable (you can't prevent the user from coming online, or going offline). window.navigator.online returns boolean true if the browser is online and false if it is definitely offline (disconnected from the network). the online and offline events are fired when the value of this attribute changes. it is important to note that this event and attribute are inherently unreliable. a computer can be connected to a network without having internet access. you can register listeners for these events in a few familiar ways: using addeventlistener on the window, document, or document.body b...
Document - Web APIs
Web › API › Document
d extensions firefox notes mozilla defines a set of non-standard properties made only for xul content: document.currentscript returns the <script> element that is currently executing. document.documenturiobject (mozilla add-ons only!) returns the nsiuri object representing the uri of the document. this property only has special meaning in privileged javascript code (with universalxpconnect privileges). document.popupnode returns the node upon which a popup was invoked. document.tooltipnode returns the node which is the target of the current tooltip. mozilla also define some non-standard methods: document.execcommandshowhelp()obsolete since gecko 14 this method never did anything and always threw an exception, so it was removed in gecko 14.0 (firefox 14.0 / thunderbird 14.
Introduction to the DOM - Web APIs
om represents an html or xml document in memory and how you use apis to create web content and applications. what is the dom? the document object model (dom) is a programming interface for html and xml documents. it represents the page so that programs can change the document structure, style, and content. the dom represents the document as nodes and objects. that way, programming languages can connect to the page. a web page is a document. this document can be either displayed in the browser window or as the html source. but it is the same document in both cases. the document object model (dom) represents that same document so it can be manipulated. the dom is an object-oriented representation of the web page, which can be modified with a scripting language such as javascript. the w3c dom an...
Document Object Model (DOM) - Web APIs
usually, that means javascript, although modeling html, svg, or xml documents as objects are not part of the core javascript language, as such. the dom represents a document with a logical tree. each branch of the tree ends in a node, and each node contains objects. dom methods allow programmatic access to the tree. with them, you can change the document's structure, style, or content. nodes can also have event handlers attached to them. once an event is triggered, the event handlers get executed. ...
Element.getClientRects() - Web APIs
and generally any elements that are not directly rendered, an empty list is returned. rectangles are returned even for css boxes that have empty border-boxes. the left, top, right, and bottom coordinates can still be meaningful. fractional pixel offsets are possible. examples these examples draw client rects in various colors. note that the javascript function that paints the client rects is connected to the markup via the class withclientrectsoverlay. html example 1: this html creates three paragraphs with a <span> inside, each embedded in a <div> block. client rects are painted for the paragraph in the second block, and for the <span> element in the third block. <h3>a paragraph with a span inside</h3> <p>both the span and the paragraph have a border set. the client rects are in red. n...
Element.shadowRoot - Web APIs
, which creates an element that displays a square of a size and color specified in the element's attributes. inside the <custom-square> element's class definition we include some life cycle callbacks that make a call to an external function, updatestyle(), which actually applies the size and color to the element. you'll see that we are passing it this (the custom element itself) as a parameter. connectedcallback() { console.log('custom square element added to page.'); updatestyle(this); } attributechangedcallback(name, oldvalue, newvalue) { console.log('custom square element attributes changed.'); updatestyle(this); } in the updatestyle() function itself, we get a reference to the shadow dom using element.shadowroot. from here we use standard dom traversal techniques to find the <styl...
EventSource() - Web APIs
the eventsource() constructor returns a newly-created eventsource, which represents a remote resource. syntax eventsource = new eventsource(url, configuration); parameters url a usvstring that represents the location of the remote resource serving the events/messages. configuration optional provides options to configure the new connection. the possible entries are: withcredentials, defaulting to false, indicating if cors should be set to include credentials. examples var evtsource = new eventsource('sse.php'); var eventlist = document.queryselector('ul'); evtsource.onmessage = function(e) { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; eventlist.appendchild(newelement); } note: you can find a full example on github —...
EventSource.close() - Web APIs
Web › API › EventSource › close
the close() method of the eventsource interface closes the connection, if one is made, and sets the eventsource.readystate attribute to 2 (closed). note: if the connection is already closed, the method does nothing. syntax eventsource.close(); parameters none. return value void. examples var button = document.queryselector('button'); var evtsource = new eventsource('sse.php'); button.onclick = function() { console.log('connection closed'); evtsource.close(); } note: you can find a full example on github — see simple sse demo using php. specifications specification status comment html living standardthe definition of 'close()' in that specification. living standard initial definition ...
EventSource: error event - Web APIs
the error event of the eventsource api is fired when a connection with an event source fails to be opened. bubbles no cancelable no interface event or errorevent event handler property eventsource.onerror examples var evtsource = new eventsource('sse.php'); // addeventlistener version evtsource.addeventlistener('error', (e) => { console.log("an error occurred while attempting to connect."); }); // onerror version evtsource.onerror = (e) => { console.log("an error occurred while attempting to connect."); }; specifications specification status html living standardthe definition of 'error event' in that specification. living standard ...
EventSource.onopen - Web APIs
the onopen property of the eventsource interface is an eventhandler called when an open event is received, that is when the connection was just opened. syntax eventsource.onopen = function examples evtsource.onopen = function() { console.log("connection to server opened."); }; note: you can find a full example on github — see simple sse demo using php. specifications specification status comment html living standardthe definition of 'onopen' in that specification. living standard initial definition ...
EventSource: open event - Web APIs
the open event of the eventsource api is fired when a connection with an event source is opened. bubbles no cancelable no interface event event handler property eventsource.onopen examples var evtsource = new eventsource('sse.php'); // addeventlistener version evtsource.addeventlistener('open', (e) => { console.log("the connection has been established."); }); // onopen version evtsource.onopen = (e) => { console.log("the connection has been established."); }; specifications specification status html living standardthe definition of 'open event' in that specification. living standard ...
EventSource.readyState - Web APIs
the readystate read-only property of the eventsource interface returns a number representing the state of the connection. syntax var myreadystate = eventsource.readystate; value a number representing the state of the connection. possible values are: 0 — connecting 1 — open 2 — closed examples var evtsource = new eventsource('sse.php'); console.log(evtsource.readystate); note: you can find a full example on github — see simple sse demo using php. specifications specification status comment html living standardthe definition of 'readystate' in that specification. living standard initial definition ...
ExtendableMessageEvent() - Web APIs
following parameters: data: the event's data — this can be any data type. origin: a domstring that defines the origin of the corresponding service worker's environment settings object. lasteventid: a domstring that defines the last event id of the event source. source: the client, serviceworker or messageport that sent the message. ports: an array containing the messageport objects connected to the channel sending the message. examples var init = { data : 'hello message', source : messageportreference, ports : messageportlistreference } var myeme = new extendablemessageevent('message', init); specifications specification status comment service workersthe definition of 'extendablemessageevent()' in t...
FederatedCredential.protocol - Web APIs
the protocol property of the federatedcredential interface returns a read-only domstring containing a credential's federated identity protocol. if this property is null, the protocol may be inferred from the federatedcredential.provider property. syntax var protocol = federatedcredential.protocol value a domstring containing a credential's federated identity protocol (e.g. openidconnect). examples // tbd specifications specification status comments credential management level 1the definition of 'protocol' in that specification. working draft initial definition. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/br...
FederatedCredential - Web APIs
the federatedcredential interface of the the credential management api provides information about credentials from a federated identity provider. a federated identity provider is an entity that a website trusts to correctly authenticate a user, and that provides an api for that purpose. openid connect is an example of a federated identity provider framework. in browsers that support it, an instance of this interface may be passed in the credential member of the init object for global fetch. constructor federatedcredential() creates a new federatedcredential object. properties inherits properties from its ancestor, credential. federatedcredential.provider read only returns a usvstring containing a credential's federated identity provider. federatedcredential.protocol read...
Using Fetch - Web APIs
a response object). this is just an http response, not the actual json. to extract the json body content from the response, we use the json() method (defined on the body mixin, which is implemented by both the request and response objects.) note: the body mixin also has similar methods to extract other types of body content; see the body section for more. fetch requests are controlled by the connect-src directive of content security policy rather than the directive of the resources it's retrieving. supplying request options the fetch() method can optionally accept a second parameter, an init object that allows you to control a number of different settings: see fetch() for the full options available, and more details. // example post method implementation: async function postdata(url = ''...
FileHandle API - Web APIs
. because the files manipulated through that api can be physically stored on the device, the editing part uses a turn-based locking mechanism in order to avoid race issues. api overview this api is based on the following interfaces: idbdatabase.mozcreatefilehandle (was called idbdatabase.mozcreatefilehandle.) idbmutablefile (was previously filehandle.) lockedfile filerequest it also has connections with the file api, especially the file and blob interfaces. basic operations create a filehandle because the intent is to allow the storage of files through indexeddb, creating a filehandle instance requires an indexeddb database. var idbreq = indexeddb.open("myfilestoragedatabase"); idbreq.onsuccess = function(){ var db = this.result; var buildhandle = db.mozcreatefilehandle("test.
Introduction to the File and Directory Entries API - Web APIs
manage your storage quota. sample use cases the following are just a few examples of how you can use the file and directory entries api: apps with persistent uploader when a file or directory is selected for upload, you can copy the file into a local sandbox and upload a chunk at a time. the app can restart uploads after an interruption, such as the browser being closed or crashing, connectivity getting interrupted, or the computer getting shut down. video game or other apps with lots of media assets the app downloads one or several large tarballs and expands them locally into a directory structure. the app pre-fetches assets in the background, so the user can go to the next task or game level without waiting for a download. audio or photo editor with offline access ...
FontFaceSet - Web APIs
rror an eventlistener called whenever an event of type loadingerror is fired, indicating that an error occurred whilst loading a font-face set. methods fontfaceset.add() adds a font to the font set. fontfaceset.check() a boolean that indicates whether a font is loaded, but doesn't initiate a load when it isn't. fontfaceset.clear() removes all manually-added fonts from the font set. css-connected fonts are unaffected. fontfaceset.delete() removes a manually-added font from the font set. css-connected fonts are unaffected. fontfaceset.load() returns a promise which resolves to a list of font-faces for a requested font. specifications specification status comment css font loading module level 3the definition of 'fontfaceset' in that specification. editor'...
Gamepad.id - Web APIs
Web › API › Gamepad › id
the usb vendor and product id of the controller the name of the controller as provided by the driver. for example, a ps2 controller returned 810-3-usb gamepad. this information is intended to allow you to find a mapping for the controls on the device as well as display useful feedback to the user. syntax readonly attribute domstring id; example window.addeventlistener("gamepadconnected", function() { var gp = navigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at index " + gp.index + ": " + gp.id + "."; }); value a string. specifications specification status comment gamepadthe definition of 'gamepad.id' in that specification. working draft initial definition ...
Gamepad.index - Web APIs
Web › API › Gamepad › index
the gamepad.index property of the gamepad interface returns an integer that is auto-incremented to be unique for each device currently connected to the system. this can be used to distinguish multiple controllers; a gamepad that is disconnected and reconnected will retain the same index. syntax readonly attribute long index; example window.addeventlistener("gamepadconnected", function() { var gp = navigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at index " + gp.index + ": " + gp.id + "."; }); value a number. specifications specification status comment gamepadthe definition of 'gamepad.index' in that specification. working draft initial definition ...
GamepadEvent() - Web APIs
the gamepadevent() constructor creates a new gamepadevent object. syntax var gamepadevent = new gamepadevent(typearg, options) parameters typearg a domstring that must be one of gamepadconnected or gamepaddisconnected. options optional options are as follows: gamepad: an instance of gamepad describing the gamepad associated with the event. specifications specification status comment gamepadthe definition of 'gamepadevent_' in that specification. working draft initial definition. ...
GlobalEventHandlers.onanimationend - Web APIs
next; they describe an animation which causes the box to migrate from the top-left corner of the container to the bottom-right corner. .slideanimation { animation: 5s ease-in-out 0s 1 slidebox; } @keyframes slidebox { from { left:0; top:0; } to { left:calc(100% - var(--boxwidth)); top:calc(100% - var(--boxwidth)) } } since the css describes the animation but doesn't connect it to the box, we'll need some javascript code to do that. we'll get to that shortly. javascript content before we get to the animation code, we define a function which logs information to a box on the user's screen. we'll use this to show information about the events we receive. note the use of animationevent.animationname and animationevent.elapsedtime to get information about the event whic...
GlobalEventHandlers.onanimationstart - Web APIs
next; they describe an animation which causes the box to migrate from the top-left corner of the container to the bottom-right corner. .slideanimation { animation: 5s ease-in-out 0s 1 slidebox; } @keyframes slidebox { from { left:0; top:0; } to { left:calc(100% - var(--boxwidth)); top:calc(100% - var(--boxwidth)) } } since the css describes the animation but doesn't connect it to the box, we'll need some javascript code to do that. we'll get to that shortly. javascript content before we get to the animation code, we define a function which logs information to a box on the user's screen. we'll use this to show information about the events we receive. note the use of animationevent.animationname and animationevent.elapsedtime to get information about the event whic...
HTMLCanvasElement.captureStream() - Web APIs
o a mediastream object, which has a single canvascapturemediastreamtrack in it. exceptions notsupportederror the value of framerate is negative. example // find the canvas element to capture var canvaselt = document.queryselector('canvas'); // get the stream var stream = canvaselt.capturestream(25); // 25 fps // do things to the stream // e.g. send it to another computer using an rtcpeerconnection // pc is an rtcpeerconnection created elsewhere pc.addstream(stream); specifications specification status comment media capture from dom elementsthe definition of 'htmlcanvaselement.capturestream()' in that specification. working draft initial definition ...
HTMLMediaElement.captureStream() - Web APIs
syntax var mediastream = mediaelement.capturestream() parameters none. return value a mediastream object which can be used as a source for audio and/or video data by other media processing code, or as a source for webrtc. ...
HTMLMediaElement: error event - Web APIs
the error event is fired when the resource could not be loaded due to an error (for example, a network connectivity problem). bubbles no cancelable no interface event event handler property onerror examples const video = document.queryselector('video'); const videosrc = 'https://path/to/video.webm'; video.addeventlistener('error', () => { console.error(`error loading: ${videosrc}`); }); video.setattribute('src', videosrc); specifications specification status html living standard living standard html5 recommendation ...
The HTML DOM API - Web APIs
ionality of each of the elements in html, as well as any supporting types and interfaces they rely upon. the functional areas included in the html dom api include: access to and control of html elements via the dom. access to and manipulation of form data. interacting with the contents of 2d images and the context of an html <canvas>, for example to draw on top of them. management of media connected to the html media elements (<audio> and <video>). dragging and dropping of content on webpages. access to the browser navigation history supporting and connective interfaces for other apis such as web components, web storage, web workers, websocket, and server-sent events. html dom concepts and usage in this article, we'll focus on the parts of the html dom that involve engaging with html...
Drag Operations - Web APIs
ntered on the mouse pointer. drag effects when dragging, there are several operations that may be performed. the copy operation is used to indicate that the data being dragged will be copied from its present location to the drop location. the move operation is used to indicate that the data being dragged will be moved, and the link operation is used to indicate that some form of relationship or connection will be created between the source and drop locations. you can specify which of the three operations are allowed for a drag source by setting the effectallowed property within a dragstart event listener. event.datatransfer.effectallowed = "copy"; in this example, only a copy is allowed. you can combine the values in various ways: none no operation is permitted copy copy only move ...
HTML Drag and Drop API - Web APIs
, when the user hovers over a drop target, the browser's cursor may indicate the type of operation that will occur. three effects may be defined: copy indicates that the dragged data will be copied from its present location to the drop location. move indicates that the dragged data will be moved from its present location to the drop location. link indicates that some form of relationship or connection will be created between the source and drop locations. during the drag operation, drag effects may be modified to indicate that certain effects are allowed at certain locations. the following example shows how to use this property. function dragstart_handler(ev) { ev.datatransfer.dropeffect = "copy"; } for more details, see: drag effects define a drop zone by default, the browser...
IDBDatabase: abort event - Web APIs
bubbles yes cancelable no interface event event handler property onabort examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event. ...
IDBDatabase.close() - Web APIs
Web › API › IDBDatabase › close
methods that create transactions throw an exception if a closing operation is pending. note: this feature is available in web workers. syntax idbdatabase.close(); example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // opening a database. ...
IDBDatabase.createObjectStore() - Web APIs
oninactiveerror 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 was misleading; this has now been fixed (see bug 1176165.) constrainterror an object store with the given name (based on case-sensitive comparison) already exists in the connected database. invalidaccesserror if autoincrement is set to true and keypath is either an empty string or an array containing an empty string. example // let us open our database var request = window.indexeddb.open("todolist", 4); // this handler is called when a new version of the database // is created, either when one has not been created before // or when a new version numb...
IDBDatabase.deleteObjectStore() - Web APIs
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. ...
IDBDatabase: error event - Web APIs
the error event is fired on idbdatabase when a request returns an error and the event bubbles up to the connection object. bubbles yes cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain ...
IDBDatabase.onabort - Web APIs
note: this feature is available in web workers. syntax idbdatabase.onabort = function(event) { ... }; example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases. ...
IDBDatabase.onclose - Web APIs
note: this feature is available in web workers. ...
IDBDatabase.onerror - Web APIs
note: consider using idbopendbrequest.onsuccess instead (see idbrequest.onsuccess, where it is inherited from). note: this feature is available in web workers. syntax idbdatabase.onerror = function(event) { ... } example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases. ...
IDBDatabase.transaction() - Web APIs
ose() 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. example in this example we open a database connection, then use transaction() to open a transaction on the database. for a complete example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db vari...
IDBFactory.deleteDatabase() - Web APIs
, and performs the deletion operation asynchronously. if the database is successfully deleted, then a success event is fired on the request object returned from this method, with its result set to undefined. if an error occurs while the database is being deleted, then an error event is fired on the request object that is returned from this method. when deletedatabase() is called, any other open connections to this particular database will get a versionchange event. note: this feature is available in web workers. syntax for the current standard: var request = indexeddb.deletedatabase(name); for the experimental version with options (see below): var request = indexeddb.deletedatabase(name, options); parameters name the name of the database you want to delete. note that attempting to de...
IDBFactory - Web APIs
actory interface of the indexeddb api lets applications asynchronously access the indexed databases. the object that implements the interface is window.indexeddb. you open — that is, create and access — and delete a database with this object, and not directly with idbfactory. note: this feature is available in web workers. methods idbfactory.open the current method to request opening a connection to a database. idbfactory.deletedatabase a method to request the deletion of a database. idbfactory.cmp a method that compares two keys and returns a result indicating which one is greater in value. idbfactory.databases a method that returns a list of all available databases, including their names and versions. example in the following code snippet, we make a request to open a databas...
IDBFactorySync - Web APIs
d 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 domstring name, in domstring description ) raises (idbdatabaseexception); parameters name the name for the database. d...
IDBObjectStore.createIndex() - Web APIs
it creates a new field/column defining a new data point for each database record to contain. bear in mind that indexeddb indexes can contain any javascript data type; indexeddb uses the structured clone algorithm to serialize stored objects, which allows for storage of simple and complex objects. note that this method must be called only from a versionchange transaction mode callback. note: this feature is available in web workers. ...
IDBObjectStore.deleteIndex() - Web APIs
note that this method must be called only from a versionchange transaction 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. ...
IDBObjectStore - Web APIs
urrent records out of an object store. idbobjectstore.count() returns an idbrequest object, and, in a separate thread, returns the total number of records that match the provided key or idbkeyrange. if no arguments are provided, it returns the total number of records in the store. idbobjectstore.createindex() creates a new index during a version upgrade, returning a new idbindex object in the connected database. idbobjectstore.delete() returns an idbrequest object, and, in a separate thread, deletes the store object selected by the specified key. this is for deleting individual records out of an object store. idbobjectstore.deleteindex() destroys the specified index in the connected database, used during a version upgrade. idbobjectstore.get() returns an idbrequest object, and, in a sep...
IDBOpenDBRequest: blocked event - Web APIs
the blocked handler is executed when an open connection to a database is blocking a versionchange transaction on the same database. bubbles no cancelable no interface idbversionchangeevent event handler property onblocked examples using addeventlistener(): // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objects...
IDBOpenDBRequest - Web APIs
> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits methods from its parents idbrequest and eventtarget. methods no methods, but inherits methods from its parents idbrequest and eventtarget. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. blocked fired when an open connection to a database is blocking a versionchange transaction on the same database. also available via the onblocked property. upgradeneeded fired when an attempt was made to open a database with a version number higher than its current version. also available via the onupgradeneeded property. example in the following example you can see the onupgradeneeded handler being used to update the databa...
IDBRequest.transaction - Web APIs
the transaction read-only property of the idbrequest interface returns the transaction for the request, that is, the transaction the request is being made inside. this property can be null for requests not made within transactions, such as for requests returned from idbfactory.open — in this case you're just connecting to a database, so there is no transaction to return. if a version upgrade is needed when opening a database then during the upgradeneeded event handler the transaction property will be an idbtransaction with mode equal to "versionchange", and can be used to access existing object stores and indexes, or abort the the upgrade. following the upgrade, the transaction ​property will again be null. note: this feature is available in web workers. syntax var mytransaction = requ...
IDBRequest - Web APIs
dbrequest.readystate read only the state of the request. every request starts in the pending state. the state changes to done when the request completes successfully or when an error occurs. idbrequest.transaction read only the transaction for the request. this property can be null for certain requests, for example those returned from idbfactory.open unless an upgrade is needed. (you're just connecting to a database, so there is no transaction to return). methods no methods, but inherits methods from eventtarget. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. error fired when an error caused a request to fail. also available via the onerror property. success fired when an idbrequest succeeds.
IDBTransaction - Web APIs
to concern themselves further. if you must ensure durability for some reason (e.g. you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction. properties idbtransaction.db read only the database connection with which this transaction is associated. idbtransaction.error read only returns a domexception indicating the type of error that occured when there is an unsuccessful transaction. this property is null if the transaction is not finished, is finished and successfully committed, or was aborted with theidbtransaction.abort() function. idbtransaction.mode read only the mode for isolating a...
IDBTransactionSync - Web APIs
ocks 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 changes performed to the objects of this database since this t...
IDBVersionChangeRequest.setVersion() - Web APIs
for older webkit browsers, call this method before creating or deleting an object store. warning: the latest draft of the specification has dropped this method. some not up-to-date browsers still implement this method. the new way is to define the version in the idbdatabase.open() method and create and delete object stores in the onupgradeneeded event handler associated with the returned request. ...
IDBVersionChangeRequest - Web APIs
ndler and the newly needed onupgradeneeded one. the idbversionchangerequest interface 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. ...
Using IndexedDB - Web APIs
ntaining the database is removed unexpectedly, or permissions are lost to the database store, the following things happen: each transaction on every affected database (or all open databases, in the case of browser shutdown) is aborted with an aborterror. the effect is the same as if idbtransaction.abort() is called on each transaction. once all of the transactions have completed, the database connection is closed. finally, the idbdatabase object representing the database connection receives a close event. you can use the idbdatabase.onclose event handler to listen for these events, so that you know when a database is unexpectedly closed. the behavior described above is new, and is only available as of the following browser releases: firefox 50, google chrome 31 (approximately). prior to t...
IntersectionObserver - Web APIs
x 0px 0px". intersectionobserver.thresholds read only a list of thresholds, sorted in increasing numeric order, where each threshold is a ratio of intersection area to bounding box area of an observed target. notifications for a target are generated when any of the thresholds are crossed for that target. if no value was passed to the constructor, 0 is used. methods intersectionobserver.disconnect() stops the intersectionobserver object from observing any target. intersectionobserver.observe() tells the intersectionobserver a target element to observe. intersectionobserver.takerecords() returns an array of intersectionobserverentry objects for all observed targets. intersectionobserver.unobserve() tells the intersectionobserver to stop observing a particular target element. exampl...
Key Values - Web APIs
keycode_tv_input_hdmi_3 (245) "tvinputhdmi4" switches to the input "hdmi 4." keycode_tv_input_hdmi_4 (246) "tvinputvga1" switches to the input "vga 1." keycode_tv_input_vga_1 (251) "tvmediacontext" the media context menu key. keycode_tv_media_context_menu (257) "tvnetwork" toggle the tv's network connection on and off. keycode_tv_network (241) "tvnumberentry" put the tv into number entry mode. keycode_tv_number_entry (234) "tvpower" [2] the device's power button. keycode_tv_power (177) "tvradioservice" radio button. keycode_tv_radio_service (232) "tvsatellite" satellite button. ...
KeyboardEvent - Web APIs
n of the macos event model causes caps lock to dispatch only the keydown event. num lock was supported on some older laptop models (2007 models and older), but since then, macos hasn't supported num lock even on external keyboards. on older macbooks with a num lock key, that key doesn't generate any key events. gecko does support the scroll lock key if an external keyboard which has an f14 key is connected. in certain older versions of firefox, this key generated a keypress event; this inconsistent behavior was bug 602812. auto-repeat handling when a key is pressed and held down, it begins to auto-repeat. this results in a sequence of events similar to the following being dispatched: keydown keypress keydown keypress <<repeating until the user releases the key>> keyup this is what the...
LayoutShift - Web APIs
layout shifts without recent user input. if (!entry.hadrecentinput) { cumulativelayoutshiftscore += entry.value; } } }); observer.observe({type: 'layout-shift', buffered: true}); document.addeventlistener('visibilitychange', () => { if (document.visibilitystate === 'hidden') { // force any pending records to be dispatched. observer.takerecords(); observer.disconnect(); console.log('cls:', cumulativelayoutshiftscore); } }); } catch (e) { // do nothing if the browser doesn't support this api. } specifications specification status comment layout instability apithe definition of 'layoutshift' in that specification. editor's draft initial definition. ...
LocalMediaStream - Web APIs
dual mediastreamtrack objects, so this is no longer necessary. instead, media is stopped by calling mediastreamtrack.stop() on each track that needs to be stopped. the example for mediastreamtrack.stop() demonstrates how to stop a multi-track stream, which is what localmediastream.stop() used to be used for. methods localmediastream.stop() stops the stream. when the source of the stream is a connected device (such as a camera or microphone), capture of media from the device is halted. this method is no longer available with the deprecation of localmediastream. see stopping a video stream in mediastreamtrack to learn how to stop an entire stream. specifications not part of any specification. this interface was previously part of media capture and streams but was removed in 2013. ...
MIDIAccess - Web APIs
midiaccess.onstatechange called whenever a new midi port is added or an existing port changes state. examples navigator.requestmidiaccess() .then(function(access) { // get lists of available midi controllers const inputs = access.inputs.values(); const outputs = access.outputs.values(); access.onstatechange = function(e) { // print information about the (dis)connected midi controller console.log(e.port.name, e.port.manufacturer, e.port.state); }; }); specifications specification status comment web midi api working draft initial definition. ...
MIDIMessageEvent - Web APIs
nts the event passed to the onmidimessage event handler of the midiinput interface. a midimessage event is fired every time a midi message is sent from a device represented by a midiinput, for example when a midi keyboard key is pressed, a knob is tweaked, or a slider is moved. constructor midimessageevent.midimessageevent creates a new midimessageevent object instance. properties midiconnectionevent.data a uint8array containing the data bytes of a single midi message. see the midi specification for more information on its form. note: even though the web midi api specifies a receivedtime property that returns a domhighrestimestamp, chrome (the only implementation at the time of writing) does not support that property since the basic event.timestamp property already returns a domhi...
MediaDevices: devicechange event - Web APIs
it's a generic event with no added properties. ...
MediaDevices.getDisplayMedia() - Web APIs
specifications specification status comment screen capturethe definition of 'mediadevices.getdisplaymedia()' in that specification. working draft initial definition ...
MediaDevices.ondevicechange - Web APIs
() promise's fulfillment handler, to initially fill out the list when the stream is opened. the second is in the event handler for devicechange: navigator.mediadevices.ondevicechange = function(event) { updatedevicelist(); } with this code in place, each time the user plugs in a camera, microphone, or other media device, or turns one on or off, we call updatedevicelist() to redraw the list of connected devices. result specifications specification status comment media capture and streamsthe definition of 'ondevicechange' in that specification. candidate recommendation initial specification. ...
MediaDevices - Web APIs
in essence, it lets you obtain access to any hardware source of media data. properties inherits properties from its parent interface, eventtarget. events devicechange fired when a media input or output device is attached to or removed from the user's computer. also available via the ondevicechange property. methods inherits methods from its parent interface, eventtarget. enumeratedevices() obtains an array of information about the media input and output devices available on the system. ...
MediaEncodingConfiguration - Web APIs
on is supported, smooth, and/or power efficient. properties a mediaencodingconfiguration dictionary takes two properties: type — the type of media being tested; takes one of two values: record — represents a configuration for recording of media, e.g. using mediarecorder. transmission — represents a configuration meant to be transmitted over electronic means (e.g. using rtcpeerconnection). a media configuration — a videoconfiguration audioconfiguration dictionary. examples //create media configuration to be tested const mediaconfig = { type : 'record', // or 'transmission' video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrat...
MediaStream.onaddtrack - Web APIs
the mediastream.onaddtrack property is an eventhandler which specifies a function to be called when the addtrack event occurs on a mediastream instance. this happens when a new track of any kind is added to the media stream. this event is fired when the browser adds a track to the stream (such as when a rtcpeerconnection is renegotiated or a stream being captured using htmlmediaelement.capturestream() gets a new set of tracks because the media element being captured loaded a new source. the addtrack event does not get fired when javascript code explicitly adds tracks to the stream (by calling addtrack()). syntax mediastream.onaddtrack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object representing the addtrack event...
MediaStream.onremovetrack - Web APIs
the mediastream.onremovetrack property is an eventhandler which specifies a function to be called when the removetrack event occurs on a mediastream instance. this happens when a track of any kind is removed from the media stream. this event is fired when the browser removes a track from the stream (such as when a rtcpeerconnection is renegotiated or a stream being captured using htmlmediaelement.capturestream() gets a new set of tracks because the media element being captured loaded a new source. the removetrack event does not get fired when javascript code explicitly removes tracks from the stream (by calling removetrack()). syntax mediastream.onremovetrack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object repres...
MediaStreamAudioSourceNode() - Web APIs
working draft ...
MediaStreamEvent.stream - Web APIs
the read-only property mediastreamevent.stream returns the mediastream associated with the event. syntax var stream = event.stream; example pc.onaddstream = function( ev ) { alert("a stream (id: '" + ev.stream.id + "') has been added to this connection."); }; ...
MediaStreamEvent - Web APIs
s two parameters, the first being a domstring representing the type of the event; the second a dictionary containing the mediastream it refers to. methods a mediastreamevent being an event, this event also implements these properties. there is no specific mediastreamevent method. examples pc.onaddstream = function( ev ) { alert("a stream (id: '" + ev.stream.id + "') has been added to this connection."); }; ...
MediaStreamTrack.enabled - Web APIs
y sample's value is 0). for video tracks, every frame is filled entirely with black pixels. the value of enabled, in essence, represents what a typical user would consider the muting state for a track, whereas the muted property indicates a state in which the track is temporarily unable to output data, such as a scenario in which frames have been lost in transit. note: if the track has been disconnected, the value of this property can be changed, but has no effect. syntax const enabledflag = track.enabled track.enabled = [true | false] value when true, enabled indicates that the track is permitted to render its actual media to the output. when enabled is set to false, the track only generates empty frames. empty audio frames have every sample's value set to 0. empty video frames have eve...
MediaStreamTrack.label - Web APIs
when the track is deassociated from its source, the label is not changed. ...
MediaStreamTrack.onended - Web APIs
e mediastreamtrack.onended event handler is used to specify a function which serves as an eventhandler to be called when the ended event occurs on the track. this event occurs when the track will no longer provide data to the stream for any reason, including the end of the media input being reached, the user revoking needed permissions, the source device being removed, or the remote peer ending a connection. syntax mediastreamtrack.onended = function; value a function to serve as an eventhandler for the ended event. the event handler function receives a single parameter: the event object, which is a simple event object. examples this example sets up an event handler for the ended event which changes an on-screen icon to indicate that the track is no longer active. track.onended = function...
MediaStreamTrack.readyState - Web APIs
in that case, the output of data can be switched on or off using the mediastreamtrack.enabled property. ...
MediaStreamTrack.remote - Web APIs
syntax var bool ​= track.remote; ...
MediaStreamTrackAudioSourceNode() - Web APIs
working draft ...
MediaStreamTrackAudioSourceOptions.mediaStreamTrack - Web APIs
working draft ...
MediaTrackConstraints.deviceId - Web APIs
needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { deviceid: constraint }; constraintsobject.deviceid = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) device ids which are acceptable as the source of media content. device ids are unique for a given origin, and are guaranteed to be the same across...
MediaTrackConstraints.echoCancellation - Web APIs
you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.echocancellation as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { echocancellation: constraint }; constraintsobject.echocancellation = constraint; value if this value is a simple true or false, the user agent will attempt to obtain media with echo cancellation enabled or disabled as specified, if possible, but will not fail if this can't be done. if, instead, the value is given as an ob...
MediaTrackConstraints.facingMode - Web APIs
eded, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.facingmode as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { facingmode: constraint }; constraintsobject.facingmode = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) facing modes are acceptable for a video track. an exact value in this case indicates that the specified facing mode is specifically required; ...
MediaTrackConstraints.latency - Web APIs
needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.latency as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { latency: constraint }; constraintsobject.latency = constraint; value a constraindouble describing the acceptable or required value(s) for an audio track's latency, with values specified in seconds. in audio processing, latency is the time between the start of processing (when sound occurs in the real world, or is generate...
MediaTrackSettings.deviceId - Web APIs
needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var deviceid = mediatracksettings.deviceid; value a domstring whose value is an origin-unique identifier for the track's source. this id is valid across multiple browsing sessions for the same origin and is guaranteed to be different for all other origins, so you can safely use it to request the same source be used for multiple sessions, for exampl...
MediaTrackSettings.facingMode - Web APIs
eded, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.facingmode as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var facingmode = mediatracksettings.facingmode; value a domstring whose value is one of the strings in videofacingmodeenum. videofacingmodeenum the following strings are permitted values for the facing mode. these may represent separate cameras, or they may represent directions in which an adjustable camera can be pointed. "user" the video so...
MediaTrackSettings.groupId - Web APIs
needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.groupid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var groupid = mediatracksettings.groupid; value a domstring whose value is a browsing-session unique identifier for a group of devices which includes the source of the track's contents. two devices share the same group id if they belong to the same physical hardware device. for example, a headset has two devices on it: a microphone which can serve ...
MediaTrackSettings.latency - Web APIs
needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.latency as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var latency = mediatracksettings.latency; value a double-precision floating-point number indicating the estimated latency, in seconds, of the audio track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment ...
MediaTrackSettings - Web APIs
zed constraints couldn't be matched. to learn more about how constraints and settings work, see capabilities, constraints, and settings. properties some or all of the following will be included in the object, either because it's not supported by the browser or because it's not available due to context. for example, because rtp doesn't provide some of these values during negotiation of a webrtc connection, a track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid. properties of all media tracks deviceid a domstring indicating the current value of the deviceid property. the device id is a origin-unique string identifying the source of the track; this is usually a guid. this value is specific to the source of the track's data and is not usable...
Using the Media Capabilities API - Web APIs
audio: { contenttype: "audio/ogg", channels: 2, bitrate: 132700, samplerate: 5200 } }; had we been testing encoding capabilities, we would have created a mediaencodingconfiguration, which requires the type of media being tested — either record (for recording media, i.e. a mediarecorder object) or transmission (for media transmitted over electronic means like rtcpeerconnection) — plus either an audio or video configuration as described above. querying the browser about decoding abilities now that we've created a video decoding configuration we can pass it as a paramater of the decodinginfo() method to determine if a video matching this configuration would be decodable and if the playback would be smooth and power efficient. var promise = navigator.mediacapabili...
Media Source API - Web APIs
mmon use cases for dash involve watching content “on demand” or “live.” on demand allows a developer to take their time transcoding the assets into multiple resolutions of various quality. live profile content can introduce latency due to its transcoding and broadcasting, so dash is not suitable for real time communication like webrtc is. it can however support significantly more client connections than webrtc. there are numerous available free and open source tools for transcoding content and preparing it for use with dash, dash file servers, and dash client libraries written in javascript. interfaces mediasource represents a media source to be played via an htmlmediaelement object. sourcebuffer represents a chunk of media to be passed into an htmlmediaelement via a mediasource...
Media Capture and Streams API (Media Stream) - Web APIs
left or right in a stereo audio track. mediastream objects have a single input and a single output. a mediastream object generated by getusermedia() is called local, and has as its source input one of the user's cameras or microphones. a non-local mediastream may be representing to a media element, like <video> or <audio>, a stream originating over the network, and obtained via the webrtc rtcpeerconnection api, or a stream created using the web audio api mediastreamaudiosourcenode. the output of the mediastream object is linked to a consumer. it can be a media elements, like <audio> or <video>, the webrtc rtcpeerconnection api or a web audio api mediastreamaudiosourcenode. interfaces in these reference articles, you'll find the fundamental information you'll need to know about each of the int...
MessageEvent.ports - Web APIs
the ports read-only property of the messageevent interface is an array of messageport objects representing the ports associated with the channel the message is being sent through (where appropriate, e.g. in channel messaging or when sending a message to a shared worker). syntax var myports = messageevent.ports; value an array of messageport objects. example onconnect = function(e) { var port = e.ports[0]; port.addeventlistener('message', function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); }); port.start(); // required when using addeventlistener. otherwise called implicitly by onmessage setter. } specifications specification status comment html living standardthe definition of 'ports' in that spe...
MessageEvent - Web APIs
t.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.port.onmessage = function(e) { result1.textcontent = e.data; console.log('message received from worker'); } inside the worker we use the sharedworkerglobalscope.onconnect handler to connect to the same port discussed above. the ports associated with that worker are accessible in the connect event's ports property — we then use messageport start() method to start the port, and the onmessage handler to deal with messages sent from the main threads. onconnect = function(e) { var port = e.ports[0]; port.addeventlistener('message', function(e) { var workerr...
MessagePort.close() - Web APIs
Web › API › MessagePort › close
this stops the flow of messages to that port. note: this feature is available in web workers. syntax port.close() returns void. parameters none. example in the following code block, you can see a handlemessage handler function, run when a message is sent back to this document using eventtarget.addeventlistener. ...
MessagePort - Web APIs
: this feature is available in web workers. methods inherits methods from its parent, eventtarget postmessage() sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts. start() starts the sending of messages queued on the port (only needed when using eventtarget.addeventlistener; it is implied when using messageport.onmessage.) close() disconnects the port, so it is no longer active. event handlers inherits event handlers from its parent, eventtarget onmessage an eventlistener called when messageevent of type message is fired on the port—that is, when the port receives a message. onmessageerror an eventlistener called when a messageevent of type messageerror is fired—that is, when it receives a message that cannot be deserial...
msPlayToSource - Web APIs
be large incompatibilities between implementations and the behavior may change in the future. msplaytosource is a read-only property which gets the source associated with the media element for use by the playtomanager. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msplaytosource; value playto is a means through which an app can connect local playback/display for audio, video, and img elements to a remote device. for more information, see the windows.media.playto apis. msplaytosource is used in the sourcerequested handler -- get the playtosource object from an audio, video, or img element using the msplaytosource property and pass it to e.setsource, then set the playtosource.next property to the msplaytosource of another elemen...
MutationObserver.MutationObserver() - Web APIs
t of options for the observer is also established in the observeroptions record. in it, we specify values of true for both childlist and attributes, so we get the information we want. then the observer is instantiated, specifying the callback() function. we begin observing the dom nodes of interest by calling observe(), specifying the target node and the options object. from this point until disconnect() is called, callback() will be called each time an element is added to or removed from the dom tree rooted at targetnode, or any of those elements' attributes are changed. specifications specification status comment domthe definition of 'mutationobserver()' in that specification. living standard ...
NDEFReader.scan() - Web APIs
Web › API › NDEFReader › scan
nfc adapter. exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: aborterror the scan operation was aborted with abortsignal passed in options. notallowederror the permission for this operation was rejected. notsupportederror there is no nfc adapter compatible with web nfc, or a connection can not be established. specifications specification status comment web nfc, scan() draft initial definition. ...
NDEFWriter.write() - Web APIs
Web › API › NDEFWriter › write
a domexception whose name is one of the following: aborterror the write operation was aborted with abortsignal passed in options. notallowederror the permission for this operation was rejected or overwrite is false and there are already records on the tag. notsupportederror there is no nfc adapter compatible with web nfc, or the available nfc adapter does not support pushing messages, or connection can not be established. notreadableerror the ua is not allowed to access underlying nfc adapter (e.g., due to user preference). networkerror transfer failed after it already started (e.g., the tag was removed from the reader). specifications specification status comment web nfc, write() draft initial definition. ...
Navigation Timing API - Web APIs
adeventend - perfdata.navigationstart; this subtracts the time at which navigation began (navigationstart) from the time at which the load event handler returns (loadeventend). this gives you the perceived page load time. calculate request response time you can calculate the time elapsed between the beginning of a request and the completion of getting the response using code like this: const connecttime = perfdata.responseend - perfdata.requeststart; here, the time at which the request was initiated (requeststart). from the time at which the response was finished being received (responseend). calculate page render time as another example of an interesting piece of data you can obtain using the navigation timing api that you can't otherwise easily get, you can get the amount of time it too...
Navigator.getGamepads() - Web APIs
the navigator.getgamepads() method returns an array of gamepad objects, one for each gamepad connected to the device. elements in the array may be null if a gamepad disconnects during a session, so that the remaining gamepads retain the same index. syntax var gamepads = navigator.getgamepads(); example window.addeventlistener("gamepadconnected", function(e) { var gp = navigator.getgamepads()[e.gamepad.index]; console.log( "gamepad connected at index %d: %s. %d buttons, %d axes.", gp.index, gp.id, gp.buttons.length, gp.axes.length ); }); specifications specification status comment gamepadthe definition of 'the gamepad api specification' in that specification. working draft initial definition. ...
Navigator.mediaDevices - Web APIs
syntax var mediadevices = navigator.mediadevices; return value the mediadevices singleton object. usually, you just use this object's members directly, such as by calling navigator.mediadevices.getusermedia(). ...
Navigator - Web APIs
Web › API › Navigator
urns a domstring with the official name of the browser. do not rely on this property to return the correct value. navigatorid.appversion read only returns the version of the browser as a domstring. do not rely on this property to return the correct value. navigator.battery read only returns a batterymanager object you can use to get information about the battery charging status. navigator.connection read only provides a networkinformation object containing information about the network connection of a device. navigator.cookieenabled read only returns false if setting a cookie will be ignored and true otherwise. navigator.geolocation read only returns a geolocation object allowing accessing the location of the device. navigatorconcurrenthardware.hardwareconcurrency read only re...
NavigatorOnLine - Web APIs
there is no object of type navigatoronline, but other interfaces, like navigator or workernavigator, implement it. properties the navigatoronline interface doesn't inherit any property. navigatoronline.online read only returns a boolean indicating whether the browser is working online. methods the navigatoronline interface neither implements, nor inherit any method. ...
NetworkInformation.downlink - Web APIs
the downlink read-only property of the networkinformation interface returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. this value is based on recently observed application layer throughput across recently active connections, excluding connections made to a private address space. in the absence of recent bandwidth measurement data, the attribute value is determined by the properties of the underlying connection technology. note that chrome-based browsers do not conform to the specification, and arbitrarily cap the reported downlink at a maximum of 10 mbps as an anti-fingerprinting measure. similar caps exist for the reported latency. syntax var downlink = networkinformation.downlink value a double. specifications ...
NetworkInformation.effectiveType - Web APIs
this value is determined using a combination of recently observed, round-trip time and downlink values. syntax var effectivetype = networkinformation.effectivetype value a string containing one of 'slow-2g', '2g', '3g', or '4g'. ...
NetworkInformation.onchange - Web APIs
the networkinformation.onchange event handler contains the code that is fired when connection information changes, and the change is received by the networkinformation object. syntax netinfo.onchange = function() { ... } examples // get the connection type. var type = navigator.connection.type; function changehandler(e) { // handle change of connection type here. } // register for event changes: navigator.connection.onchange = changehandler; // another way: navigator.connection.addeventlistener('change', changehandler); specifications specification status comment network information apithe definition of 'onchange' in that specification. draft initial definition ...
NetworkInformation.type - Web APIs
note: this feature is available in web workers. ...
Node.baseURIObject - Web APIs
the node.baseuriobject property returns the nsiuri representing the node's (typically a document or an element) base url. it's similar to node.baseuri, except it returns an nsiuri instead of a string. this property exists on all nodes (html, xul, svg, mathml, etc.), but only if the script trying to use it has universalxpconnect privileges. see node.baseuri for details on what the base url is. syntax uriobj = node.baseuriobject value an nsiuri. this property is read-only; attempting to write to it will throw an exception. in addition, this property may only be accessed from privileged code. specification not in any specification. ...
Node.compareDocumentPosition() - Web APIs
the node.comparedocumentposition() method reports the position of the given node relative to another node in any document — not just the given node’s document. the return value is a bitmask of the following values: name value document_position_disconnected 1 document_position_preceding 2 document_position_following 4 document_position_contains 8 document_position_contained_by 16 document_position_implementation_specific 32 syntax comparemask = node.comparedocumentposition(othernode) parameters othernode the other node with which to compare the first node’s document position. return value an integer value whose bits represent the othernode's relationship to the calling node. more than...
Node - Web APIs
Web › API › Node
uri object representing the base uri for the element. node.childnodesread only returns a live nodelist containing all the children of this node. nodelist being live means that if the children of the node change, the nodelist object is automatically updated. node.firstchildread only returns a node representing the first direct child node of the node, or null if the node has no child. node.isconnectedread only a boolean indicating whether or not the node is connected (directly or indirectly) to the context object, e.g. the document object in the case of the normal dom, or the shadowroot in the case of a shadow dom. node.lastchildread only returns a node representing the last direct child node of the node, or null if the node has no child. node.nextsiblingread only returns a node repr...
OscillatorNode.setPeriodicWave() - Web APIs
s undefined example the following example illustrates simple usage of createperiodicwave(), recreating a sine wave from a periodic wave. var real = new float32array(2); var imag = new float32array(2); var ac = new audiocontext(); var osc = ac.createoscillator(); real[0] = 0; imag[0] = 0; real[1] = 1; imag[1] = 0; var wave = ac.createperiodicwave(real, imag); osc.setperiodicwave(wave); osc.connect(ac.destination); osc.start(); osc.stop(2); this works because a sound that contains only a fundamental tone is by definition a sine wave. here, we create a periodicwave with two values. the first value is the dc offset, which is the value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent value...
OscillatorNode.stop() - Web APIs
ying immediately. example the following example shows basic usage of an audiocontext to create an oscillator node. for an applied example, check out our violent theremin demo (see app.js for relevant code). // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.connect(audioctx.destination); oscillator.start(); oscillator.stop(audioctx.currenttime + 2); // stop 2 seconds after the current time specifications specification status comment web audio apithe definition of 'stop' in that specification. working draft ...
OscillatorNode - Web APIs
on it. for an applied example, check out our violent theremin demo (see app.js for relevant code). // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.connect(audioctx.destination); oscillator.start(); specifications specification status comment web audio apithe definition of 'oscillatornode' in that specification. working draft ...
Page Visibility API - Web APIs
dget. the budget regenerates at a rate of 10 ms per second, in both firefox and chrome. some processes are exempt from this throttling behavior. in these cases, you can use the page visibility api to reduce the tabs' performance impact while they're hidden. tabs which are playing audio are considered foreground and aren’t throttled. tabs running code that's using real-time network connections (websockets and webrtc) go unthrottled in order to avoid closing these connections timing out and getting unexpectedly closed. indexeddb processes are also left unthrottled in order to avoid timeouts. example view live example (video with sound). the example, which pauses the video when you switch to another tab and plays again when you return to its tab, was created with the following c...
PannerNode.positionX - Web APIs
left after 1 second, to the right after 2 seconds, and back to the center after 3 seconds. const context = new audiocontext(); const osc = new oscillatornode(context); const panner = new pannernode(context); panner.positionx.setvalueattime(-1, context.currenttime + 1); panner.positionx.setvalueattime(1, context.currenttime + 2); panner.positionx.setvalueattime(0, context.currenttime + 3); osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'positionx' in that specification. working draft ...
PannerNode.positionY - Web APIs
the timbre of the oscillator, as it's a simple mono wave. const context = new audiocontext(); const osc = new oscillatornode(context); const panner = new pannernode(context); panner.panningmodel = 'hrtf'; panner.positiony.setvalueattime(1, context.currenttime + 1); panner.positiony.setvalueattime(-1, context.currenttime + 2); panner.positiony.setvalueattime(0, context.currenttime + 3); osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'positiony' in that specification. working draft ...
PannerNode.positionZ - Web APIs
ainly affect the timbre and perceived volume of the sound. const context = new audiocontext(); const osc = new oscillatornode(context); const panner = new pannernode(context); panner.panningmodel = 'hrtf'; panner.positionz.setvalueattime(1, context.currenttime + 1); panner.positionz.setvalueattime(-1, context.currenttime + 2); panner.positionz.setvalueattime(0, context.currenttime + 3); osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'positionz' in that specification. working draft ...
PannerNode.refDistance - Web APIs
a decrease in volume (decay) const scheduletesttone = (refdistance, starttime) => { const osc = new oscillatornode(context); const panner = new pannernode(context); panner.refdistance = refdistance; // set the initial z position, then schedule the ramp panner.positionz.setvalueattime(0, starttime); panner.positionz.linearramptovalueattime(z_distance, starttime + note_length); osc.connect(panner) .connect(context.destination); osc.start(starttime); osc.stop(starttime + note_length); }; // this tone should decay immediately and fairly quickly scheduletesttone(1, context.currenttime); // this tone should decay slower and later than the previous one scheduletesttone(4, context.currenttime + note_length); // this tone should decay only slightly, and only start decaying fair...
PannerNode.rolloffFactor - Web APIs
ease in volume (decay) const scheduletesttone = (rollofffactor, starttime) => { const osc = new oscillatornode(context); const panner = new pannernode(context); panner.rollofffactor = rollofffactor; // set the initial z position, then schedule the ramp panner.positionz.setvalueattime(0, starttime); panner.positionz.linearramptovalueattime(z_distance, starttime + note_length); osc.connect(panner) .connect(context.destination); osc.start(starttime); osc.stop(starttime + note_length); }; // this tone should decay fairly quickly scheduletesttone(1, context.currenttime); // this tone should decay slower than the previous one scheduletesttone(0.5, context.currenttime + note_length); // this tone should decay only slightly scheduletesttone(0.1, context.currenttime + note_leng...
PannerNode - Web APIs
ner object stored in the audiocontext.listener attribute.) pannernode.setorientation() defines the direction the audio source is playing in. pannernode.setvelocity() defines the velocity vector of the audio source — how fast it is moving and in what direction. in a previous version of the specification, the pannernode had a velocity that could pitch up or down audiobuffersourcenodes connected downstream. this feature was not clearly specified and had a number of issues, so it was removed from the specification. examples in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy i...
Using the Payment Request API - Web APIs
this article is a guide to making use of the payment request api, with examples and suggested best practices. the basics of making a payment this section details the basics of using the payment request api to make a payment. note: the code snippets from this section are from our feature detect support demo. creating a new payment request object a payment request always starts with the creation of a new paymentrequest object — using the paymentrequest() constructor. ...
PerformanceObserver - Web APIs
timeline. note: this feature is available in web workers. constructor performanceobserver() creates and returns a new performanceobserver object. methods performanceobserver.observe() specifies the set of entry types to observe. the performance observer's callback function will be invoked when a performance entry is recorded for one of the specified entrytypes performanceobserver.disconnect() stops the performance observer callback from receiving performance entries. performanceobserver.takerecords() returns the current list of performance entries stored in the performance observer, emptying it out. example function perf_observer(list, observer) { // process the "measure" event } var observer2 = new performanceobserver(perf_observer); observer2.observe({entrytypes: ["mea...
PerformanceResourceTiming.nextHopProtocol - Web APIs
otherwise, this property returns the alpn protocol id of the first hop to the proxy. note: this feature is available in web workers. syntax resource.nexthopprotocol; return value a string representing the network protocol used to fetch the resource, as identified by the alpn protocol id (rfc7301). ...
PerformanceTiming.domainLookupEnd - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the performancenavigationtiming interface instead. the legacy performancetiming.domainlookupend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the domain lookup is finished. if a persistent connection is used, or the information is stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart. syntax time = performancetiming.domainlookupend; specifications specification status comment navigation timingthe definition of 'performancetiming.domainlookupend' in that specification. recommendation initial definition. ...
PerformanceTiming.domainLookupStart - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the performancenavigationtiming interface instead. the legacy performancetiming.domainlookupstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the domain lookup starts. if a persistent connection is used, or the information is stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart. syntax time = performancetiming.domainlookupstart; specifications specification status comment navigation timingthe definition of 'performancetiming.domainlookupstart' in that specification. recommendation initial definition. ...
PerformanceTiming.requestStart - Web APIs
2 specification. please use the performancenavigationtiming interface instead. the legacy performancetiming.requeststart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the browser sent the request to obtain the actual document, from the server or from a cache. if the transport layer fails after the start of the request and the connection is reopened, this property will be set to the time corresponding to the new request. syntax time = performancetiming.requeststart; specifications specification status comment navigation timingthe definition of 'performancetiming.requeststart' in that specification. recommendation initial definition. ...
PerformanceTiming.responseEnd - Web APIs
this interface of this property is deprecated in the navigation timing level 2 specification. please use the performancenavigationtiming interface instead. the legacy performancetiming.responseend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the browser received the last byte of the response, or when the connection is closed if this happened first, from the server from a cache or from a local resource. syntax time = performancetiming.responseend; specifications specification status comment navigation timingthe definition of 'performancetiming.responseend' in that specification. recommendation initial definition. ...
Performance Timeline - Web APIs
ies*() methods as the performance interface. however, note there is one key difference with these methods; the performance observer entry list versions are used to retrieve observed performance entries within the observer callback. besides the performanceobserver's interface's observe() method (which is used to register the entry types to observe), the performanceobserver interface also has a disconnect() method that stops an observer from receiving further events. performance observers were added to the level 2 version of the standard and were not widely implemented. implementation status a summary of the interfaces' implementation status is provided below, including a link to more detailed information. performance interface extensions: as shown in the performance interface's browser comp...
PeriodicWave - Web APIs
ustrates simple usage of createperiodicwave(), to create a periodicwave object containing a simple sine wave. var real = new float32array(2); var imag = new float32array(2); var ac = new audiocontext(); var osc = ac.createoscillator(); real[0] = 0; imag[0] = 0; real[1] = 1; imag[1] = 0; var wave = ac.createperiodicwave(real, imag, {disablenormalization: true}); osc.setperiodicwave(wave); osc.connect(ac.destination); osc.start(); osc.stop(2); this works because a sound that contains only a fundamental tone is by definition a sine wave here, we create a periodicwave with two values. the first value is the dc offset, which is the value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values a...
RTCAnswerOptions - Web APIs
the createoffer() method's options parameter is of this type. properties this dictionary inherits properties from the rtcofferansweroptions dictionary, on which it's based. note: at this time, rtcansweroptions does not have any additional properties defined beyond those included in rtcofferansweroptions. however, this is likely to change in the future, so the type has been defined in preparation for that eventuality. ...
RTCCertificate - Web APIs
properties rtccertificate.expires read only returns the expiration date of the certificate. ...
RTCDTMFSender.insertDTMF() - Web APIs
calling insertdtmf() will append the specified tones to the end of the current tone buffer, so that those tones play after the previously-enqueued tones. syntax rtcdtmfsender.insertdtmf(tones[, duration[, intertonegap]]); parameters tones a domstring containing the dtmf codes to be transmitted to the recipient. ...
RTCDTMFSender.toneBuffer - Web APIs
to place tones into the buffer, call insertdtmf(). tones are removed from the string as they're played, so only upcoming tones are listed. syntax var tonebuffer = rtcdtmfsender.tonebuffer; value a domstring listing the tones to be played. if the string is empty, there are no tones pending. tone buffer format the tone buffer is a string which can contain any combination of the characters that are permitted by the dtmf standard. ...
RTCDataChannel.binaryType - Web APIs
ary messages' contents will be contained in blob objects. "arraybuffer" received binary messages' contents will be contained in arraybuffer objects. example this code configures a data channel to receive binary data in arraybuffer objects, and establishes a listener for message events which constructs a string representing the received data as a list of hexadecimal byte values. ...
RTCDataChannel.bufferedAmount - Web APIs
e's room to buffer them. syntax var amount = adatachannel.bufferedamount; value the number of bytes of data currently queued to be sent over the data channel but have not yet been sent. example the snippet below includes a function which changes the contents of a block with the id "buffersize" to a string indicating the number of bytes currently buffered on an rtcdatachannel. var dc = peerconnection.createdatachannel("file transfer"); /* ... */ function showbufferedamount(channel) { let el = document.getelementbyid("buffersize"); el.innerhtml = channel.bufferedamount + " bytes"; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.bufferedamount' in that specification. c...
RTCDataChannel.bufferedAmountLowThreshold - Web APIs
threshold; value the number of queued outgoing data bytes below which the buffer is considered to be "low." example in this snippet of code, bufferedamountlowthreshold is set to 64kb, and a handler for the bufferedamountlow event is established by setting the rtcdatachannel.onbufferedamountlow property to a function which should send more data into the buffer by calling send(). var dc = peerconnection.createdatachannel("file transfer"); dc.bufferedamountlowthreshold = 65535; dc.onbufferedamountlow = function() { /* use send() to queue more data to be sent */ }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.bufferedamountlowthreshold' in that specification. candidate recom...
RTCDataChannel: bufferedamountlow event - Web APIs
handler property onbufferedamountlow examples this example sets up a handler for bufferedamountlow to request more data any time the data channel's buffer falls below the number of bytes specified by bufferedamountlowthreshold, which we have set to 65536. in other words, we'll try to keep at least 64kb of data in the buffer, reading 64kb at a time from the source. let pc = new rtcpeerconnection(); let dc = pc.createdatachannel("sendfile"); let source = /* source data object */ dc.bufferedamountlowthreshold = 65536; pc.addeventlistener("bufferedamountlow", ev => { if (source.position <= source.length) { dc.send(source.readfile(65536)); } }, false); after creating the rtcpeerconnection, this calls rtcpeerconnection.createdatachannel() to create the data channel. then a list...
RTCDataChannel.maxPacketLifeTime - Web APIs
a message, as set when the data channel was created, or null. this limits how long the browser can continue to attempt to transmit and retransmit the message before giving up. syntax var lifetime = adatachannel.maxpacketlifetime; value the number of milliseconds over which the browser may continue to attempt to transmit the message until it either succeeds or gives up. if not set when rtcpeerconnection.createdatachannel() was called to create the data channel, this value is null. example // tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.maxpacketlifetime' in that specification. candidate recommendation initial specification. ...
RTCDataChannel.maxRetransmits - Web APIs
the read-only rtcdatachannel property maxretransmits returns the maximum number of times the browser should try to retransmit a message before giving up, as set when the data channel was created, or null, which indicates that there is no maximum. this can only be set when the rtcdatachannel is created by calling rtcpeerconnection.createdatachannel(), using the maxretransmits field in the specified options. syntax var tries = adatachannel.maxretransmits; value the maximum number of times the browser will try to retransmit a message before giving up, or null if not set when rtcpeerconnection.createdatachannel() was called. the default is null. example // tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe d...
RTCDataChannel: message event - Web APIs
on an rtcdatachannel object when a message has been received from the remote peer. bubbles no cancelable no interface messageevent event handler property onmessage note: the message event uses as its event object type the messageevent interface defined by the html specification. examples for a given rtcdatachannel, dc, created for a peer connection using its createdatachannel() method, this code sets up a handler for incoming messages and acts on them by adding the data contained within the message to the current document as a new <p> (paragraph) element. dc.addeventlistener("message", ev => { let newparagraph = document.createelement("p"); let textnode = document.createtextnode(event.data); newparagraph.appendchild(textnode); ...
RTCDataChannel.negotiated - Web APIs
the read-only rtcdatachannel property negotiated indicates whether the rtcdatachannel's connection was negotiated by the web app (true) or by the webrtc layer (false). the default is false. see creating a data channel in using webrtc data channels for further information about this property. syntax var negotiated = adatachannel.negotiated; value true if the rtcdatachannel's connection was negotiated by the web app itself; false if the negotiation was handled by the webrtc layer. the default is false. example the code snippet below checks the value of negotiated; if it's true, a function called shutdownremotechannel() is called with the channel's id; presumably this would be implemented to transmit a shutdown signal to the remote peer prior to terminating the connection. if (datachannel...
RTCDataChannel.onbufferedamountlow - Web APIs
l to handle the bufferedamountlow event. this function receives as its only input parameter a simple event object representing the event which has occurred. example this example responds to the bufferedamountlow event by fetching up to 64kb of a file represented by an object source and calling rtcdatachannel.send() to queue up the retrieved data for sending on the data channel. pc = new rtcpeerconnection(); dc = pc.createdatachannel("sendfile"); /* ... */ dc.onbufferedamountlow = function() { if (source.position <= source.length) { dc.send(source.readfile(65536)); } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.onbufferedamountlow' in that specification. candidate re...
RTCDataChannel.onerror - Web APIs
as its only input an errorevent object describing the event which was received. that event object, in turn, describes the error that took place. example in the example below, a data channel is established, and an onerror handler is added to it. the error handler passes information about the error to a ui library's alert box function to present an error message to the user. let pc = new rtcpeerconnection(); let dc = pc.createdatachannel("playercontrol"); dc.onerror = function(event) { myuilibrary.doalertbox({ 'network error', // alert title 'the error "' + event.message + '" occurred while handling player control network messages.', event.filename, event.lineno, event.colno }); } /* ... */ specifications specification status comment...
RTCDataChannel.protocol - Web APIs
your app, for example, use json objects as messages on one channel while another channel is plaintext and another is raw binary or even some other format. syntax var subprotocol = adatachannel.protocol; value a string identifying the app-defined subprotocol being used for exchanging data on the channel. if none has been established, this is an empty string (""). ...
RTCDataChannel.reliable - Web APIs
the read-only rtcdatachannel property reliable indicates whether or not the data channel is reliable. this property is obsolete. use rtcdatachannel.ordered instead in any new code, and update existing code as soon as possible. syntax var reliable = adatachannel.reliable; value true if the rtcdatachannel's connection is reliable; false if it isn't. example // tbd specifications no longer part of any specification. ...
RTCDataChannelEvent.channel - Web APIs
example the first line of code in the datachannel event handler shown below takes the channel from the event object and saves it locally for use by the code handling data traffic. ...
RTCErrorEvent - Web APIs
nformation 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 webrtc 1.0: real-time communication between browsersthe definition of 'rtcerrorevent' in that specification. candidate recommendation initial definition. ...
RTCIceCandidate.address - Web APIs
syntax var address = rtcicecandidate.address; value a domstring providing the ip address from which the candidate comes. note: if port is null — and port is supported by the user agent — passing the candidate to addicecandidate() will fail, throwing an operationerror exception. security notes it's important to note here that although webrtc does not require the two peers on an rtcpeerconnection to know one another's true ip addresses, the address property on rtcicecandidate can expose more information about the source of the remote peer than the user expects. the ip address can be used to derive information about the remote device's location, network topology, and so forth. it can also be used for fingerprinting purposes. the candidate ip addresses are always exposed to the applicat...
RTCIceCandidate.priority - Web APIs
e remote peer; the higher this value is, the better the remote peer considers the candidate to be. as is the case with most of rtcicecandidate's properties, the value of priority is extracted from the candidate a-line string specified when creating the rtcicecandidate. the a-line string is obtained either from the rtcicecandidateinit property candidate or from an a-line string passed into rtcpeerconnection.addicecandidate() instead of an rtcicecandidate. syntax var priority = rtcicecandidate.priority; value a long, unsigned integer value indicating the priority of the candidate according to the remote peer. the larger this value is, the more preferable the remote peer considers this candidate to be. priority is initialized to null if it is not specified in the candidate, or if the candidate...
RTCIceCandidate.protocol - Web APIs
the protocol property's value is set when the rtcicecandidate() constructor is used. ...
RTCIceCandidate.tcpType - Web APIs
ue is set when the rtcicecandidate() constructor is used. you can't directly set its value; instead, its value is automatically extracted from the candidate a-line, if it's formatted properly. syntax var tcptype = rtcicecandidate.tcptype; value a domstring whose value is one of those defined by the rtcicetcpcandidatetype enumerated type. "active" the transport will try to open an outbound connection but won't receive inoming connection requests. "passive" the transport will receive incoming connection requests but won't try to open an outbound connection. "so" the transport will try to open a connection simultaneously with its peer. tcptype is null for udp candidates. example in this example, the candidate's protocol and tcptype are used to adjust the user interface for simultaneo...
RTCIceCandidate.type - Web APIs
te; the ip is an intermediary address assigned by the stun server to represent the candidate's peer anonymously. relay the candidate is a relay candidate, obtained from a turn server. the relay candidate's ip address is an address the turn server uses to forward the media between the two peers. if type is null, that information was missing from the candidate's a-line, which will cause rtcpeerconnection.addicecandidate() to throw an operationerror exception. example in this example, the candidate's type is used to present a modified user interface for host candidates (those where the ip refers directly to the remote peer, rather than an intermediary). if (candidate.type == "host") { showhostcontrols(); } else { hidehostcontrols(); } specifications specification status ...
RTCIceCandidateInit.candidate - Web APIs
if the candidate is an empty string (""), the end of the candidate list has been reached; this candidate is known as the "end-of-candidates" marker. ...
RTCIceCandidateInit - Web APIs
the webrtc api's rtcicecandidateinit dictionary, which contains the information needed to fundamentally describe an rtcicecandidate. rtcicecandidateinit is used when using new rtcicecandidate() to create a new ice candidate object. it's also used as the return value from the rtcicecandidate.tojson() method, and can be passed directly into rtcpeerconnection.addicecandidate() to add a candidate to the peer connection. properties candidate optional the ice candidate-attribute. if the candidate is an indicator that 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 str...
RTCIceCandidatePair.local - Web APIs
the local property of the rtcicecandidatepair dictionary specifies the rtcicecandidate which describes the configuration of the local end of a viable webrtc connection. syntax localcandidate = rtcicecandidatepair.local; value an rtcicecandidate which describes the configuration of the local end of a viable pair of ice candidates. the rtcicecandidatepair is returned by the rtcicetransport method getselectedcandidatepair(). example this one-line example simply obtains the current candidate pair and then from that gets the local candidate. var candidatepair = pc.getsenders()[0].transport.transport.getselectedcandidatepair(); var localcandidate = candidatepair.local; the rtcicetransport is found by getting the list of rtcrtpsender objects for the rtcpeerconnection pc. in the first rtcrtpsen...
RTCIceCandidatePair.remote - Web APIs
the remote property of the rtcicecandidatepair dictionary specifies the rtcicecandidate describing the configuration of the remote end of a viable webrtc connection. syntax remotecandidate = rtcicecandidatepair.remote; value an rtcicecandidate which describes the configuration of the remote end of a viable pair of ice candidates. the rtcicecandidatepair is returned by the rtcicetransport method getselectedcandidatepair(). example this one-line example simply obtains the current candidate pair and then from that gets the remote candidate. var candidatepair = pc.getsenders()[0].transport.transport.getselectedcandidatepair(); var remotecandidate = candidatepair.remote; the rtcicetransport is found by getting the list of rtcrtpsender objects for the rtcpeerconnection pc. in the first rtcrtp...
RTCIceCandidatePair - Web APIs
the rtcicecandidatepair dictionary describes a pair of ice candidates which together comprise a description of a viable connection between two webrtc endpoints. 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. var icetransport = pc.getsenders()[0].transport.icetransport; var localproto = document.getelementb...
RTCIceCandidatePairStats.bytesReceived - Web APIs
the rtcicecandidatepairstats property bytesreceived indicates the total number of payload bytes—that is, bytes which aren't overhead such as headers or padding—that hve been received to date on the connection described by the candidate pair. the bytessent property reports the number of bytes sent so far on the described connection. syntax received = rtcicecandidatepairstats.bytesreceived; value an integer value indicating the total number of bytes received so far on the connection described by this candidate pair. only data bytes are counted; overhead such as padding, headers, and the like are not included in this count. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.bytesreceiv...
RTCIceCandidatePairStats.bytesSent - Web APIs
the rtcicecandidatepairstats property bytessent indicates the total number of payload bytes—that is, bytes which aren't overhead such as headers or padding—that hve been sent so far on the connection described by the candidate pair. the bytesreceived property reports the number of bytes received so far on the described connection. syntax sent = rtcicecandidatepairstats.bytessent; value an integer value indicating the total number of bytes sent so far on the connection described by this candidate pair. only data bytes are counted; overhead such as padding, headers, and the like are not included in this count. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.bytessent' in that speci...
RTCIceCandidatePairStats.circuitBreakerTriggerCount - Web APIs
the rtcicecandidatepairstats property circuitbreakertriggercount indicates the number of times the circuit-breaker has been triggered to indicate a connection timeout or other unexpected connection abort on this specific connection configuration. a circuit breaker trigger is fired each time the connection times out or otherwise needs to be halted automatically. syntax cbtcount = rtcicecandidatepairstats.circuitbreakertriggercount; value an integer value indicating the number of times the circuit-breaker has been triggered for the 5-tuple used by this connection. a 5-tuple defining a tcp connection is made up of the following data: the source ip address. the source port number. the destination ip address. the destination port number. network protocol. specifications specif...
RTCIceCandidatePairStats.consentExpiredTimestamp - Web APIs
if this time has arrived or passed, the bindings have expired. ...
RTCIceCandidatePairStats.consentRequestsSent - Web APIs
the rtcicecandidatepairstats property consentrequestssent specifies the number of consent requests that have been sent by this peer to the remote peer on the connection described by the pair of candidates. syntax consentrequestssent = rtcicecandidatepairstats.consentrequestssent; value an integer indicating the number of consent requests this peer has sent to the other peer over the connection described by the pair of candidates referenced by this rtcicecandidatepairstats object. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.consentrequestssent' in that specification. candidate recommendation initial specification. ...
RTCIceCandidatePairStats.lastPacketReceivedTimestamp - Web APIs
the rtcicecandidatepairstats property lastpacketreceivedtimestamp indicates the time at which the connection described by the candidate pair last received a packet. stun packets are not included. syntax lastpacketreceivedtimestamp = rtcicecandidatepairstats.lastpacketreceivedtimestamp; value a domhighrestimestamp object indicating the timestamp at which the connection described by pair of candidates last received a packet, stun packets excluded. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.lastpacketreceivedtimestamp' in that specification. candidate recommendation initial specification. ...
RTCIceCandidateStats.lastPacketSentTimestamp - Web APIs
the rtcicecandidatepairstats property lastpacketsenttimestamp indicates the time at which the connection described by the candidate pair last sent a packet, not including stun packets. syntax lastpacketsenttimestamp = rtcicecandidatepairstats.lastpacketsenttimestamp; value a domhighrestimestamp object indicating the timestamp at which the connection described by pair of candidates last sent a packet, stun packets excluded. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.lastpacketsenttimestamp' in that specification. candidate recommendation initial specification. ...
RTCIceCandidateStats.lastResponseTimestamp - Web APIs
the rtcicecandidatepairstats property lastresponsetimestamp indicates the time at which the last stun response was received on the described candidate pair. syntax lastresponsetimestamp = rtcicecandidatepairstats.lastresponsetimestamp; value a domhighrestimestamp object indicating the timestamp at which the most recent stun response was received on the connection defined by the described pair of candidates. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.lastresponsetimestamp' in that specification. candidate recommendation initial specification. ...
RTCIceCandidateStats.localCandidateId - Web APIs
the rtcicecandidatepairstats property localcandidateid is a string that uniquely identifies the local ice candidate which was analyzed to generate the rtcicecandidatestats used to compute the statistics for this pair of candidates. syntax localcandidateid = rtcicecandidatepairstats.localcandidateid; value a domstring giving a unique identifier for the local rtcicecandidate for the connection described by this rtcicecandidatepairstats object. this candidate is the source of one of the two rtcicecandidatestats objects that were used to compute the contents of this rtcicecandidatepairstats object. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.localcandidateid' in that specification. ...
RTCIceCandidatePairStats.packetsReceived - Web APIs
the rtcicecandidatepairstats dictionary's packetsreceived property indicates the total number of packets of any kind that have been received on the connection described by the pair of candidates. the number of packets sent to date on the connection can be obtained using packetssent. syntax packetsreceived = rtcicecandidatepairstats.packetsreceived; value an integer value indicating the total number of packets, of any kind, which have been received on the connection described by the two candidates comprising this pair. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.packetsreceived' in that specification. candidate recommendation initial specification. ...
RTCIceCandidatePairStats.packetsSent - Web APIs
the rtcicecandidatepairstats dictionary's packetssent property indicates the total number of packets which have been sent on the connection described by the pair of candidates. the number of packets received to date on the connection can be obtained using packetsreceived. syntax packetssent = rtcicecandidatepairstats.packetssent; value an integer value indicating the total number of packets, of any kind, which have been sent on the connection described by the two candidates comprising this pair. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.packetssent' in that specification. candidate recommendation initial specification. ...
RTCIceCandidatePairStats.priority - Web APIs
the obsolete rtcicecandidatepairstats property priority reports the priority of the candidate pair as an integer value. the higher the value, the more likely the webrtc layer is to select the candidate pair when the time comes to establish (or re-establish) a connection between the two peers. syntax pairpriority = rtcicecandidatepairstats.priority; value an integer value indicating the priority of this pair of candidates as compared to other pairs on the same peer connection. the higher this value, the better the webrtc layer thinks this pair of candidates is compared to the others, and the more likely a pair is to be selelcted for use. note: this property was removed from the specification as its value cannot be guaranteed to be accurately represented in a javascript number. you can cal...
RTCIceCandidatePairStats.requestsReceived - Web APIs
the rtcicecandidatepairstats dictionary's requestsreceived property indicates the total number of stun connectivity check requests that have been received so far on the connection described by this pairing of candidates. syntax requestsreceived = rtcicecandidatepairstats.requestsreceived; value an integer value which specifies the number of stun connectivity and/or consent requests that have been received to date on the connection described by this pair of ice candidates. because there's no way to tell the difference between requests made to check connectivity and requests made to check consent, the returned figure includes both. note: the reported number of requests includes retransmissions. if a request had to be repeated due to network issues, it will be counted multiple times here. th...
RTCIceCandidatePairStats.responsesReceived - Web APIs
the responsesreceived property in the rtcicecandidatepairstats dictionary indicates the total number of stun connectivity check responses that have been received on the connection described by this pair of candidates. syntax responsesreceived = rtcicecandidatepairstats.responsesreceived; value an integer value which specifies the number of stun connectivity request responses that have been received on the connection described by this pair of candidates so far. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.responsesreceived' in that specification. candidate recommendation initial specification. ...
RTCIceCandidatePairStats.responsesSent - Web APIs
the rtcicecandidatepairstats dictionary's responsessent property indicates the total number of stun connectivity check responses that have been sent so far on the connection described by this pair of candidates. syntax responsessent = rtcicecandidatepairstats.responsessent; value an integer value indicating the number of times a repsonse has been sent to a stun connectivity check request. note: since it isn't possible to tell the difference between connectivity check requests and consent requests, this value includes both. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.responsessent' in that specification. candidate recommendation initial specification. ...
RTCIceCandidatePairStats.retransmissionsReceived - Web APIs
the rtcicecandidatepairstats dictionary's retransmissionsreceived property indicates the total number of stun connectivity check request retransmissions that have been received so far on the pair of candidates. the number of retransmissions that have been sent on the connection can be found in retransmissionssent. syntax retransmissionsreceived = rtcicecandidatepairstats.retransmissionsreceived; value an integer value indicating the total number of retransmitted stun connectivity check requests have been received on the connection referenced by this candidate pair so far. note: retransmissions are connectivity check requests with a transaction_transmit_counter attribute whose req field is greater than 1 (indicating that the request has been transmitted more than once). see rfc 7982 for fu...
RTCIceCandidatePairStats.retransmissionsSent - Web APIs
the rtcicecandidatepairstats dictionary's retransmissionssent property indicates the total number of stun connectivity check request retransmissions that have been sent so far on the pair of candidates. the number of retransmissions that have been received on the connection can be found in retransmissionsreceived. syntax retransmissionssent = rtcicecandidatepairstats.retransmissionssent; value an integer value indicating the total number of retransmitted stun connectivity check requests have been sent on the connection referenced by this candidate pair so far. note: retransmissions are connectivity check requests with a transaction_transmit_counter attribute whose req field is greater than 1 (indicating that the request has been transmitted more than once). see rfc 7982 for further detail...
RTCIceCandidatePairStats.selected - Web APIs
dcandidatepairid property indicates whether or not the specified transport is the one being used. example the function shown in this example identifies the currently-selected candidate pair from a statistics report by first iterating over each report, looking for a transport report; when one is found, that transport's selectedcandidatepairid is used to get the rtcicecandidatepair describing the connection. if that fails, then the second section iterates over the reports, looking for a candidate-pair record whose firefox-specific selected property is true. this candidate pair is then returned as the currently-selected one. function getcurrentcandidatepair(statsresults) { statsresults.foreach(report => { if (report.type === "transport") { currentpair = statsresults.get(report.select...
RTCIceCandidatePairStats.totalRoundTripTime - Web APIs
the rtcicecandidatepairstats dictionary's totalroundtriptime property is the total time that has elapsed between sending stun requests and receiving the responses, for all such requests that have been made so far on the pair of candidates described by this rtcicecandidatepairstats object. this value includes both connectivity check and consent check requests. syntax totalrtt = rtcicecandidatepairstats.totalroundtriptime; value this floating-point value indicates the total number of seconds which have elapsed between sending out stun connectivity and consent check requests and receiving their responses, for all such requests made so far on the connection described by this candidate pair. you can calculate the average round-trip time (rtt) by dividing this value by the value of the response...
RTCIceCandidatePairStats.writable - Web APIs
the obsolete rtcicecandidatepairstats property writable reports whether or not the connection described by the candidate pair is writable. syntax iswritable = rtcicecandidatepairstats.writable; value a boolean value which is true if the connection described by this candidate pair has received acknowledgement of receipt (ack) for at least one ice request and that stun consent hasn't expired. note: this property was removed from the specification in early 2017 because you can determine whether or not an incoming ice request is available to read by checking to see if responsesreceived is greater than 0 and that the time specified by consentexpiredtimestamp has not passed: if (icpstats.responsesreceived > 0 && icpstats.consentexpiredtimestamp < performance.now()) { /* at least one ice...
RTCIceCandidateStats.deleted - Web APIs
idate's turn allocation is no longer active. the net result is the same; the candidate is no longer under consideration if this value is true. example in this example, setinterval() is used to set up a function that runs periodically to display the latest statistics for candidates. only candidates which have not been deleted are included in the output. ...
RTCIceCandidateStats.priority - Web APIs
the higher the value, the more desirable the candidate is. syntax priority = rtcicecandidatestats.priority; value a positive integer indicating the priority of the rtcicecandidate described by the rtcicecandidatestats object. ...
RTCIceParameters.usernameFragment - Web APIs
e session for the duration of the current ice session. syntax ufrag = rtciceparameters.usernamefragment; value a domstring containing the username fragment that, in tandem with the password, uniquely identify the ice session being used by the transport. the string may be up to 256 characters long. see rtcicecandidate.usernamefragment to learn more about username fragments and their role in a connection. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceparameters.usernamefragment' in that specification. candidate recommendation initial specification. ...
RTCIceTransport: gatheringstatechange event - Web APIs
tate property, indicates whether or not the ice agent has begun gathering candidates, and if so, if it has finished doing so. bubbles no cancelable no interface event event handler property ongatheringstatechange the key difference between gatheringstatechange and icegatheringstatechange is that the latter represents the overall state of the connection including every rtcicetransport used by every rtcrtpsender and every rtcrtpreceiver on the entire connection. in contrast, gatheringstatechange represents changes to the candidate gathering state for a single transport. examples this example creates a handler for gatheringstatechange events on each rtcrtpsender associated with a given rtcpeerconnection. here, the addeventlistener() method is...
RTCIceTransport.getLocalCandidates() - Web APIs
andidate object for each candidate that has been identified so far during the ice candidate gathering session. you can't correlate these local candidates with matching remote candidates. to find the best match found so far, call rtcicetransport.getselectedcandidatepair(). example this simple example gets the local candidate list from the rtcicetransport for the first rtcrtpsender on the rtcpeerconnection, then outputs to the console all of the candidates in the list. var localcandidates = pc.getsenders()[0].transport.transport.getlocalcandidates(); localcandidates.foreach(function(candidate, index)) { console.log("candidate " + index + ": " + candidate.candidate); }); specifications specification status comment webrtc 1.0: real-time communication between browser...
RTCIceTransport.getLocalParameters() - Web APIs
syntax parameters = rtcicetransport.getlocalparameters(); parameters none. ...
RTCIceTransport.getRemoteParameters() - Web APIs
syntax parameters = rtcicetransport.getremoteparameters(); parameters none. ...
RTCIceTransport.onselectedcandidatepairchange - Web APIs
syntax rtcicetransport.onselectedcandidatepairchange = candidatepairhandler; value this propoerty should be set to reference an event handler function to be called by the ice agent when it discovers a new candidate pair that the rtcicetransport will be using for communication with the remote peer. ...
RTCIceTransport.onstatechange - Web APIs
by the webrtc layer when the rtcicetransport object's state changes. the event handler receives as its sole input an event object describing the statechange event which occurred. to determine the new state, examine the value of state. example this snippet establishes a handler for the statechange event that looks to see if the transport has entered the "failed" state, which indicates that the connection has failed with no chance of being automatically restored. var icetransport = pc.getsenders()[0].transport.icetransport; icetransport.onstatechange = function(event) { if (icetransport.state == "failed") { handlefailure(pc); } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetrans...
RTCIceTransport.role - Web APIs
syntax icerole = rtcicetransport.role; value a domstring specifying whether the rtcicetransport represents the controlling agent or the controlled agent. ...
RTCIceTransport: statechange event - Web APIs
a statechange event occurs when the rtcicetransport changes state. the state can be used to determine how far through the process of examining, verifying, and selecting a valid candidate pair is prior to successfully connecting the two peers for webrtc communications. bubbles no cancelable no interface event event handler property rtcicetransport.onstatechange examples given an rtcpeerconnection, pc, the following code creates an event handler that calls a function named handlefailure() if the ice transport enters a failure state. let icetransport = pc.getsenders()[0].transport.icetransport; icetransport.addeventlistener("statechange", ev => { if (icetransport.state === "failed") { handlefailure(pc); } }, false); the same code,...
RTCIdentityAssertion - Web APIs
if no peer has yet been set and verified this interface returns null. once set it can't be changed. properties rtcidentityassertion.idp indicates the provider of the identity assertion. rtcidentityassertion.name indicates the name of the identity assertion provider. ...
RTCIdentityErrorEvent.idp - Web APIs
the read-only property rtcidentityerrorevent.idp returns the domstring describing the domain name of the identity provider (idp) generating the error response event. firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. syntax var idp = event.idp; event.idp = "developer.mozilla.org"; example pc.onidpassertionerror = function( ev ) { alert("the idp named '" + ev.idp + "' encountered an error " + "while generating an assertion."); } ...
RTCIdentityErrorEvent.loginUrl - Web APIs
the read-only property rtcidentityerrorevent.loginurl is a domstring giving the url where the user can complete the authentication. it can be null and is provided by the identity provider (idp). firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. syntax var loginurl = event.loginurl; event.loginurl = "https://developer.mozilla.org/fakeurl"; example pc.onidpassertionerror = function( ev ) { alert("the idp requested an authentication" + " to be performed at th3 url '" + ev.url + ...
RTCIdentityErrorEvent.protocol - Web APIs
the read-only property rtcidentityerrorevent.protocol is a domstring describing the idp protocol in use. firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. syntax var protocol = event.protocol; event.protocol = "idp.html"; example pc.onidpassertionerror = function( ev ) { alert("the idp uses the following protocol '" + ev.protocol + "."); } ...
RTCIdentityEvent.assertion - Web APIs
the read-only property rtcidentityevent.assertion returns the domstring containing a blob being the coded assertion associated with the event. firefox implements the interface this property belongs to under the following name: rtcpeerconnectionidentityevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. syntax var blob = event.assertion; example pc.onidentityresult = function( ev ) { alert("a new identity assertion (blob: '" + ev.assertion + "') has been generated."); } ...
RTCInboundRtpStreamStats.firCount - Web APIs
reamstats dictionary indicates the number of full intra request (fir) packets have been sent by the receiver to the sender. the receiver sends a fir packet when the stream falls behind and needs to skip frames in order to catch up. syntax var fircount = rtcinboundrtpstreamstats.fircount; value an integer value indicating how many fir packets have been received by the sender during the current connection. this statistic is available only for video tracks. the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. this tells the sender to send a full frame instead of a delta frame, so that the receiver can catch up. the higher fircount is, the more often frames were dropped, which may be an...
RTCInboundRtpStreamStats.packetsFailedDecryption - Web APIs
the packetsfaileddecryption property of the rtcinboundrtpstreamstats dictionary indicates the total number of rtp packets which failed to be decrypted successfully after being received by the local end of the connection during this session. syntax var packetsfaileddecryption = rtcinboundrtpstreamstats.packetsfaileddecryption; value an integer value which indicates how many packets the local end of the rtp connection could not be successfully decrypted. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcinboundrtpstreamstats.packetsfaileddecryption' in that specification. candidate recommendation initial definition. ...
RTCInboundRtpStreamStats - Web APIs
properties the rtcinboundrtpstreamstats dictionary is based on the rtcreceivedrtpstreamstats dictionary, whose properties are also available. averagertcpinterval a floating-point value indicating the average rtcp interval between two consecutive compound rtcp packets. ...
RTCOfferAnswerOptions.voiceActivityDetection - Web APIs
the voiceactivitydetection property of the rtcofferansweroptions dictionary is used to specify whether or not to use automatic voice detection for the audio on an rtcpeerconnection. the default value, true, indicates that voice detection should be used and that if possible, the user agent should automatically disable or mute outgoing audio when the audio source is not sensing a human voice. syntax var options = { voiceactivitydetection: trueorfalse }; value a boolean value indicating whether or not the connection should use voice detection once running. the default value, true, indicates that the user agent should monitor the audio coming from the microphone or other audio source and automatically cease transmitting data or mute when the user isn't speaking into the microphone, a value...
RTCOfferAnswerOptions - Web APIs
each of createoffer() and createanswer() use rtcofferansweroptions as the base type for their options parameter's dictionary. createoffer() uses rtcofferoptions and createanswer() uses rtcansweroptions. ...
RTCOutboundRtpStreamStats.firCount - Web APIs
der. a fir packet is sent when the receiver finds that it has fallen behind and needs to skip frames in order to catch up; the sender should respond by sending a full frame instead of a delta frame. available only on video media. syntax var fircount = rtcoutboundrtpstreamstats.fircount; value an integer value indicating how many fir packets have been received by the sender during the current connection. this statistic is available only for video tracks. the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. this tells the sender to send a full frame instead of a delta frame, so that the receiver can catch up. the higher fircount is, the more often frames were dropped, which may be an...
RTCRtcpParameters - Web APIs
it's used as the value of the rtcp property of the parameters of an rtcrtpsender or rtcrtpreceiver. properties cname the canonical name (cname) being used by rtcp. this is used, for example, in sdes (sdp security descriptions) messages, described in rfc 4568. this property cannot be changed once initialized. reducedsize a boolean value indicating whether or not reduced size rtcp is configured. if this value is true, reduced size rtcp (described in rfc 5506) is in effect. if false, compund rtcp is in use, as found in rfc 3550. this property cannot be changed once initialized. ...
RTCRtpCapabilities - Web APIs
found in rfc 2198. there may be multiple entries for red if different forms are supported; each will have a unique media type in that case. fec (forward error correction) an fec component handles error correction data; its media type may also vary due to there being advanced versions of the standard available, but it will always end with fec. one possible value is video/ulpfec (a generic error connection model). there may also be multiple fec entries if more than one form is supported. rtx (retransmission) this component is responsible for retransmission of data; it's media type should be video/rtx. there will only be one entry for rtx, and it will not have an sdpfmtpline property. don't be surprised to see these show up ijn the list; be prepared to ignore them if you're only interested in...
RTCRtpCodecParameters - Web APIs
the rtcrtpcodecparameters dictionary, part of the webrtc api, is used to describe the configuration parameters for a single media codec. in addition to being the type of the rtcrtpparameters.codecs property, it's used when calling rtcrtptransceiver.setcodecpreferences() to configure a transceiver's codecs before beginning the offer/answer process to establish a webrtc peer connection. most of the fields in this property take values which are defined and maintained by the internet assigned numbers authority (iana). references to relevant iana documents are provided in the see also section at the end of this article. properties payloadtype optional the rtp payload type used to identify this codec. mimetype optional the codec's mime media type and subtype specified as a domstring of the for...
RTCRtpEncodingParameters.scaleResolutionDownBy - Web APIs
inal size. a value of 2.0 would reduce the size of the video by a factor of 2 both horizontally and vertically, resulting in a video 25% the original size. a value less than 1.0 would cause the video to get larger rather than smaller, which is not the intent of this property. therefore, specifying a value less than 1.0 is not permitted and will cause a rangeerror exception to be thrown by rtcpeerconnection.addtransceiver() or rtcrtpsender.setparameters(). specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpencodingparameters.scaleresolutiondownby' in that specification. candidate recommendation initial definition. ...
RTCRtpReceiveParameters - Web APIs
properties this dictionary currently has no properties of its own; it exists for future expansion. it inherits all of the properties of its parent, rtcrtpparameters. examples this example obtains the canonical name (cname) being used for rtcp on an rtcrtpreceiver. ...
RTCRtpReceiver.getStats() - Web APIs
syntax var promise = rtcrtpreceiver.getstats(); return value a javascript promise which is fulfilled once the statistics are available. the promise's fulfillment handler receives as a parameter a rtcstatsreport object containing the collected statistics. ...
RTCRtpReceiver - Web APIs
properties rtcrtpreceiver.track read only returns the mediastreamtrack associated with the current rtcrtpreceiver instance. rtcrtpreceiver.transport read only returns the rtcdtlstransport instance over which the media for the receiver's track is received. obsolete properties rtcptransport this property has been removed; the rtp and rtcp transports have been combined into a single transport. use the transport property instead. ...
RTCRtpSender.dtmf - Web APIs
Web › API › RTCRtpSender › dtmf
the read-only dtmf property on the rtcrtpsender interface returns a rtcdtmfsender object which can be used to send dtmf tones over the rtcpeerconnection . see using dtmf for details on how to make use of the returned rtcdtmfsender object. syntax var dtmfsender = rtcrtpsender.dtmf; value an rtcdtmfsender which can be used to send dtmf over the rtp session, or null if the track being carried by the rtp session or the rtcpeerconnection as a whole doesn't support dtmf. only audio tracks can support dtmf, and typically only one audio track per rtcpeerconnection will have an associated rtcdtmfsender example tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpsender.dtmf' in that specification. ...
RTCRtpSender.getCapabilities() static function - Web APIs
ies(). syntax let rtpcapabilities = rtcrtpsender.getcapabilities(kind); parameters kind a domstring 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 ...
RTCRtpSender.getStats() - Web APIs
syntax var promise = rtcrtpsender.getstats(); return value a javascript promise which is fulfilled once the statistics are available. the promise's fulfillment handler receives as a parameter a rtcstatsreport object containing the collected statistics. ...
RTCRtpSender.setParameters() - Web APIs
the setparameters() method of the rtcrtpsender interface applies changes the configuration of sender's track, which is the mediastreamtrack for which the rtcrtpsender is responsible. in other words, setparameters() updates the configuration of the rtp transmission as well as the encoding configuration for a specific media track on the webrtc connection. syntax var promise = rtcrtpsender.setparameters(parameters) parameters parameters an object conforming with the rtcrtpsendparameters dictionary, specifying options for the rtcrtpsender; these include potential codecs that could be use for encoding the sender's track. the available options are: degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-bandw...
RTCRtpSender - Web APIs
so forth. you can also obtain access to an rtcdtmfsender which can be used to send dtmf codes (to simulate the user pressing buttons on a telephone's dial pad) to the remote peer. properties rtcrtpsender.dtmf read only an rtcdtmfsender which can be used to send dtmf tones using telephone-event payloads on the rtp session represented by the rtcrtpsender object. if null, the track and/or the connection doesn't support dtmf. only audio tracks can support dtmf. rtcrtpsender.track read only the mediastreamtrack which is being handled by the rtcrtpsender. if track is null, the rtcrtpsender doesn't transmit anything. rtcrtpsender.transport read only the rtcdtlstransport over which the sender is exchanging the rtp and rtcp packets used to manage transmission of media and control data. this v...
RTCRtpStreamStats.firCount - Web APIs
of the rtcrtpstreamstats dictionary indicates the number of full intra request (fir) packets have been sent by the receiver to the sender. this is a measure of how often the stream falls behind and has to skip frames in order to catch up. syntax var fircount = rtcrtpstreamstats.fircount; value an integer value indicating how many fir packets have been received by the sender during the current connection. this value is available only on receivers for video tracks. the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. this tells the sender to send a full frame instead of a delta frame, so that the receiver can catch up. the higher fircount is, the more often frames were dropped, which ...
RTCRtpTransceiver.currentDirection - Web APIs
he rtcrtptransceiverdirection enumerated type. the rtcrtptransceiverdirection type is an enumeration of string values. each describes how the transceiver's associated rtcrtpsender and rtcrtpreceiver behave as shown in the table below. value rtcrtpsender behavior rtcrtpreceiver behavior "sendrecv" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1. offers to receive rtp data, and does so if the other peer accepts. "sendonly" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1. does not offer to receive rtp data and will not do so. "recvonly" does not offer to send rtp data...
RTCRtpTransceiverDirection - Web APIs
irection properties are of this type. values the rtcrtptransceiverdirection type is an enumeration of string values. each describes how the transceiver's associated rtcrtpsender and rtcrtpreceiver behave as shown in the table below. value rtcrtpsender behavior rtcrtpreceiver behavior "sendrecv" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1. offers to receive rtp data, and does so if the other peer accepts. "sendonly" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1. does not offer to receive rtp data and will not do so. "recvonly" does not offer to send rtp data...
RTCRtpTransceiverInit - Web APIs
the rtcrtptransceiverinit dictionary is used when calling the webrtc function rtcpeerconnection.addtransceiver() to provide configuration options for the new transceiver. properties direction optional the new transceiver's preferred directionality. this value is used to initialize the new rtcrtptransceiver object's rtcrtptransceiver.direction property. sendencodings optional a list of encodings to allow when sending rtp media from the rtcrtpsender. each entry is of type rtcrtpencodingparameters. streams optional a list of mediastream objects to add to the transceiver'srtcrtpreceiver; when the remote peer's rtcpeerconnection's track event occurs, these are the streams that will be specified by that event. specifications specification status comment webrtc 1.0...
RTCSctpTransport.state - Web APIs
the state read-only property of the rtcsctptransport interface provides information which describes a stream control transmission protocol (sctp) transport state. syntax var mystate = sctptransport.state; value a string whose value is taken from the rtcsctptransportstate enumerated type. its value is one of the following: connecting the initial state when the connection is being estabilished. connected the connection is open for data transmission. closed the connection is closed and can no longer be used. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsctptransport.state' in that specification. candidate recommendation initial definition. ...
RTCSctpTransport - Web APIs
the rtcsctptransport interface provides information which describes a stream control transmission protocol (sctp) transport. this provides information about limitations of the transport, but also provides a way to access the underlying datagram transport layer security (dtls) transport over which sctp packets for all of an rtcpeerconnection's data channels are sent and received. you don't create rtcsctptransport objects yourself; instead, you get access to the rtcsctptransport for a given rtcpeerconnection through its sctp property. possibly the most useful property on this interface is its maxmessagesize property, which you can use to determine the upper limit on the size of messages you can send over a data channel on the peer connection. properties also inherits properties from: eventta...
RTCSessionDescription.sdp - Web APIs
candidate recommendation initial specification. ...
RTCSessionDescription.type - Web APIs
l 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.remotedescription.type); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.type' in that specification. candidate recommendation initial specification. ...
RTCSessionDescriptionCallback - Web APIs
iondescriptioncallback(description); parameters description an rtcsessiondescriptioninit (or rtcsessiondescription) object describing the session being offered or being accepted. this object contains the type and sdp properties which are part of rtcsessiondescription. return value the callback doesn't need to return anything, so the return value is undefined. example var pc = new rtcpeerconnection(); var descriptioncallback = function(offer) { pc.setlocaldescription(offer); } pc.createoffer(descriptioncallback); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescriptioncallback' in that specification. candidate recommendation initial definition. ...
RTCStats.id - Web APIs
Web › API › RTCStats › id
syntax var id = rtcstats.id; value a domstring which uniquely identifies the object for which this rtcstats-based object provides statistics. ...
RTCStats - Web APIs
Web › API › RTCStats
endpoints (that is, both local and remote endpoints, and regardless of whether the endpoint is a sender or a receiver) rtcreceivedrtpstreamstats further adds statistics measured at the receiving end of an rtp stream, regardless of whether it's local or remote. rtcinboundrtpstreamstats contains statistics that can only be measured on a receiver at the local end of the rtp connection. rtcoutboundrtpstreamstats contains statistics related to the receiver at the remote end of the rtp stream. rtcsentrtpstreamstats offers statistics related to the sending end of an rtp stream. rtcoutboundrtpstreamstats contains statistics about the local sending endpoint of an rtp stream. rtcremoteoutboundrtpstreamstats holds statistics related ...
RTCStatsIceCandidatePairState - Web APIs
see ice check lists in rtcicecandidatepairstats.state for further information about how ice check lsits work. values failed a check for this pair has been performed but failed. ...
RTCTrackEvent.streams - Web APIs
syntax var streams = trackevent.streams; value an array of mediastream objects, one for each stream that make up the new track. ...
RTCTrackEvent.track - Web APIs
the webrtc api interface rtctrackevent's read-only track property specifies the mediastreamtrack that has been added to the rtcpeerconnection. syntax var track = trackevent.track; value a mediastreamtrack indicating the track which has been added to the rtcpeerconnection. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtctrackevent.track' in that specification. candidate recommendation initial specification. ...
RTCTrackEventInit.track - Web APIs
ary's track property specifies the mediastreamtrack associated with the track event. syntax var trackeventinit = { receiver: rtpreceiver, track: mediastreamtrack, streams: [videostream], transceiver: rtptransceiver }; var track = trackeventinit.track; value a mediastreamtrack representing the track with which the event is associated. this is the track that's being added to the rtcpeerconnection. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtctrackeventinit.track' in that specification. candidate recommendation initial specification. ...
ReportingObserver - Web APIs
the reportingobserver interface of the reporting api allows you to collect and access reports. constructor reportingobserver() creates a new reportingobserver object instance, which can be used to collect and access reports. properties this interface has no properties defined on it. methods reportingobserver.disconnect() stops a reporting observer that had previously started observing from collecting reports. reportingobserver.observe() instructs a reporting observer to start collecting reports in its report queue. reportingobserver.takerecords() returns the current list of reports contained in the observer's report queue, and empties the queue. events this interface has no events that fire on it. examples in our deprecation_report.html example, we create a simple...
Reporting API - Web APIs
ptions dictionary that allows you to specify the type of reports to collect, and whether the reports that were generated before the observer was able to be created should be observable (buffered: true). methods are then available on the observer to start collecting reports (reportingobserver.observe()), retrieve the reports currently in the report queue (reportingobserver.takerecords()), and disconnect the observer so it can no longer collect records (reportingobserver.disconnect()). reporting api interfaces reportingobserver create reportingobserver instances using its constructor, which can then be used to collect and access reports. report an object representing a single report. reporting api dictionaries reportingobserveroptions allows options to be set in the constructor when ...
ResizeObserver - Web APIs
dependencies that are often created when resizing via a callback function. it does this by only processing elements deeper in the dom in subsequent frames. implementations should, if they follow the specification, invoke resize events before paint and after layout. constructor resizeobserver() creates and returns a new resizeobserver object. properties none. methods resizeobserver.disconnect() unobserves all observed element targets of a particular observer. resizeobserver.observe() initiates the observing of a specified element. resizeobserver.unobserve() ends the observing of a specified element. examples in the resize-observer-text.html (see source) example, we use the resize observer to change the font-size of a header and paragraph as a slider’s value is changed causin...
ScriptProcessorNode.onaudioprocess - Web APIs
// loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specifications specification status comment web audio apithe definition of 'onaudioprocess' in that specification...
ScriptProcessorNode - Web APIs
l); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specifications specification status comment web audio apithe definition of 'scriptprocessornode' in that specification.
Server-sent events - Web APIs
...
ServiceWorkerMessageEvent.ServiceWorkerMessageEvent() - Web APIs
d contain the following parameters: data: the event's data — this can be any type. origin: a domstring that defines the origin of the corresponding service worker's environment settings object. lasteventid: a domstring that defines the last event id of the event source. source: the serviceworker or messageport that sent the message. ports: an array containing the messageport objects connected to the channel sending the message. examples var init = { data : 'hello message', source : messageportreference, ports : messageportlistreference } var myswme = new serviceworkermessageevent('message', init); ...
ServiceWorkerMessageEvent.ports - Web APIs
syntax var myports = serviceworkermessageeventinstance.ports; value an array of messageport objects. ...
ShadowRoot - Web APIs
, which creates an element that displays a square of a size and color specified in the element's attributes. inside the <custom-square> element's class definition we include some life cycle callbacks that make a call to an external function, updatestyle(), which actually applies the size and color to the element. you'll see that we are passing it this (the custom element itself) as a parameter. connectedcallback() { console.log('custom square element added to page.'); updatestyle(this); } attributechangedcallback(name, oldvalue, newvalue) { console.log('custom square element attributes changed.'); updatestyle(this); } in the updatestyle() function itself, we get a reference to the shadow dom using element.shadowroot. from here we use standard dom traversal techniques to find the <styl...
SharedWorker - Web APIs
t.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.port.onmessage = function(e) { result1.textcontent = e.data; console.log('message received from worker'); } inside the worker we use the sharedworkerglobalscope.onconnect handler to connect to the same port discussed above. the ports associated with that worker are accessible in the connect event's ports property — we then use messageport start() method to start the port, and the onmessage handler to deal with messages sent from the main threads. onconnect = function(e) { var port = e.ports[0]; port.addeventlistener('message', function(e) { var workerr...
SpeechRecognition.onend - Web APIs
the onend property of the speechrecognition interface represents an event handler that will run when the speech recognition service has disconnected (when the end event fires.) syntax myspeechrecognition.onend = function() { ... }; examples var recognition = new speechrecognition(); recognition.onend = function() { console.log('speech recognition service disconnected'); } specifications specification status comment web speech apithe definition of 'onend' in that specification. draft ...
SpeechRecognition - Web APIs
e events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. audiostart fired when the user agent has started to capture audio. also available via the onaudiostart property. audioend fired when the user agent has finished capturing audio. also available via the onaudioend property. end fired when the speech recognition service has disconnected. also available via the onend property. error fired when a speech recognition error occurs. also available via the onerror property. nomatch fired when the speech recognition service returns a final result with no significant recognition. this may involve some degree of recognition, which doesn't meet or exceed the confidence threshold. also available via the onnomatch property. result ...
SpeechSynthesisErrorEvent.error - Web APIs
ken and before it completed. audio-busy the operation couldn't be completed at this time because the user-agent couldn't access the audio output device (for example, the user may need to correct this by closing another application.) audio-hardware the operation couldn't be completed at this time because the user-agent couldn't identify an audio output device (for example, the user may need to connect a speaker or configure system settings.) network the operation couldn't be completed at this time because some required network communication failed. synthesis-unavailable the operation couldn't be completed at this time because no synthesis engine was available (for example, the user may need to install or configure a synthesis engine.) synthesis-failed the operation failed because the syn...
Streams API concepts - Web APIs
resource somewhere on the network or elsewhere on your domain that you want to get data from. there are two types of underlying source: push sources constantly push data at you when you’ve accessed them, and it is up to you to start, pause, or cancel access to the stream. examples include video streams and tcp/web sockets. pull sources require you to explicitly request data from them once connected to. examples include a file access operation via a fetch or xhr call. the data is read sequentially in small pieces called chunks. a chunk can be a single byte, or it can be something larger such as a typed array of a certain size. a single stream can contain chunks of different sizes and types. the chunks placed in a stream are said to be enqueued — this means they are waiting in a queu...
TrackEvent - Web APIs
the trackevent interface, which is part of the html dom specification, is used for events which represent changes to a set of available tracks on an html media element; these events are addtrack and removetrack. it's important not to confuse trackevent with the rtctrackevent interface, which is used for tracks which are part of an rtcpeerconnection. events based on trackevent are always sent to one of the media track list types: events involving video tracks are always sent to the videotracklist found in htmlmediaelement.videotracks events involving audio tracks are always sent to the audiotracklist specified in htmlmediaelement.audiotracks events affecting text tracks are sent to the texttracklist object indicated by htmlmediaelement.texttracks. constructor trackevent() creates ...
USBDevice.claimInterface() - Web APIs
device interface returns a promise that resolves when the requested interface is claimed for exclusive access. syntax var promise = usbdevice.claiminterface(interfacenumber) parameters interfacenumber the index of one of the interfaces supported by the device. interfaces are device-specific. return value a promise. example the following example shows claiminterface() in the context of connecting to a usb device. async function connectdevice(usbdevice) { await usbdevice.open(); if (usbdevice.configuration === null) await usbdevice.selectconfiguration(1); await usbdevice.claiminterface(0); } specifications specification status comment webusbthe definition of 'claiminterface()' in that specification. draft initial definition. ...
USBDevice.configuration - Web APIs
perty of the usbdevice interface returns a usbconfiguration object for the currently selected interface for a paired usb device. syntax var usbconfiguration = usbdevice.configuration value a usbconfiguration object. example the following example uses this property to test for the existence of a usbconfiguration property to select a configuration before claiming an interface. async function connectdevice(usbdevice) { await usbdevice.open(); if (usbdevice.configuration === null) await usbdevice.selectconfiguration(1); await usbdevice.claiminterface(0); } specifications specification status comment webusbthe definition of 'configuration' in that specification. draft initial definition. ...
ValidityState.typeMismatch - Web APIs
the typemismatch is only one of the many possible errors and is only relevant for the email and url types. when the value provided doesn't match the expected value based on the type for other input types, you get different errors. for example, if the number input value is not a floating point number, the badi...
WebGL2RenderingContext.drawArraysInstanced() - Web APIs
g webgl 1, the angle_instanced_arrays extension can provide this method, too. syntax void gl.drawarraysinstanced(mode, first, count, instancecount); parameters mode a glenum specifying the type primitive to render. possible values are: gl.points: draws a single dot. gl.line_strip: draws a straight line to the next vertex. gl.line_loop: draws a straight line to the next vertex, and connects the last vertex back to the first. gl.lines: draws a line between a pair of vertices. gl.triangle_strip gl.triangle_fan gl.triangles: draws a triangle for a group of three vertices. first a glint specifying the starting index in the array of vector points. count a glsizei specifying the number of indices to be rendered. instancecount a glsizei specifying the number of instances...
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
the angle_instanced_arrays extension can provide this method, too. syntax void gl.drawelementsinstanced(mode, count, type, offset, instancecount); parameters mode a glenum specifying the type primitive to render. possible values are: gl.points: draws a single dot. gl.line_strip: draws a straight line to the next vertex. gl.line_loop: draws a straight line to the next vertex, and connects the last vertex back to the first. gl.lines: draws a line between a pair of vertices. gl.triangle_strip gl.triangle_fan gl.triangles: draws a triangle for a group of three vertices. count a glsizei specifying the number of elements to be rendered. type a glenum specifying the type of the values in the element array buffer. possible values are: gl.unsigned_byte gl.unsigned_s...
WebGL2RenderingContext.drawRangeElements() - Web APIs
ethod of the webgl api renders primitives from array data in a given range. syntax void gl.drawrangeelements(mode, start, end, count, type, offset); parameters mode a glenum specifying the type primitive to render. possible values are: gl.points: draws a single dot. gl.line_strip: draws a straight line to the next vertex. gl.line_loop: draws a straight line to the next vertex, and connects the last vertex back to the first. gl.lines: draws a line between a pair of vertices. gl.triangle_strip gl.triangle_fan gl.triangles: draws a triangle for a group of three vertices. start a gluint specifying the minimum array index contained in offset. end a gluint specifying the maximum array index contained in offset. count a glsizei specifying the number of elements to be re...
WebGL2RenderingContext.vertexAttribIPointer() - Web APIs
describe the layout of the buffer: //1. position gl.vertexattribpointer(0, 3, gl.float, false, 20, 0); gl.enablevertexattribarray(0); //2. bone weights, normalized to [0, 1] gl.vertexattribpointer(1, 4, gl.unsigned_byte, true, 20, 12); gl.enablevertexattribarray(1); //3. ...
WebGLRenderingContext.drawArrays() - Web APIs
the webglrenderingcontext.drawarrays() method of the webgl api renders primitives from array data. syntax void gl.drawarrays(mode, first, count); parameters mode a glenum specifying the type primitive to render. possible values are: gl.points: draws a single dot. gl.line_strip: draws a straight line to the next vertex. gl.line_loop: draws a straight line to the next vertex, and connects the last vertex back to the first. gl.lines: draws a line between a pair of vertices. gl.triangle_strip gl.triangle_fan gl.triangles: draws a triangle for a group of three vertices. first a glint specifying the starting index in the array of vector points. count a glsizei specifying the number of indices to be rendered. return value none. exceptions if mode is not one of the...
WebGLRenderingContext.drawElements() - Web APIs
lrenderingcontext.drawelements() method of the webgl api renders primitives from array data. syntax void gl.drawelements(mode, count, type, offset); parameters mode a glenum specifying the type primitive to render. possible values are: gl.points: draws a single dot. gl.line_strip: draws a straight line to the next vertex. gl.line_loop: draws a straight line to the next vertex, and connects the last vertex back to the first. gl.lines: draws a line between a pair of vertices. gl.triangle_strip gl.triangle_fan gl.triangles: draws a triangle for a group of three vertices. count a glsizei specifying the number of elements to be rendered. type a glenum specifying the type of the values in the element array buffer. possible values are: gl.unsigned_byte gl.unsigned_s...
WebGLRenderingContext.isContextLost() - Web APIs
t(); return value a boolean which is true if the context is lost, or false if not. usage notes there are several reasons why a webgl context may be lost, making it necessary to re-establish the context before resuming rendering. examples include: two or more pages are using the gpu, but together place too high a demand on the gpu, so the browser tells the two contexts that they've lost the connection, then selects one of the two to restore access for. the user's computer has multiple graphics processors (such as a laptop with both mobile and desktop class gpus, the former used primarily when on battery power), and the user or system decides to switch gpus. in this case, all contexts are lost, then restored after switching gpus. another page running in the user's browser performs an opera...
WebGLRenderingContext.makeXRCompatible() - Web APIs
*/ outputcanvas.addeventlistener("webglcontextrestored", (event) => { loadsceneresources(currentscene); }); async function onstartedxrsession(xrsession) { try { await gl.makexrcompatible(); } catch(err) { switch(err) { case aborterror: showsimplemessagebox("unable to transfer the game to your xr headset.", "cancel"); ...
WebGLRenderingContext.vertexAttribPointer() - Web APIs
16, on lower-end graphics cards, the value will be lower. attribute index for each attribute, you must specify its index. this is independent from the location inside the array buffer, so your attributes can be sent in a different order than how they are stored in the array buffer. you have two options: either you specify the index yourself. in this case, you call gl.bindattriblocation() to connect a named attribute from the vertex shader to the index you want to use. this must be done before calling gl.linkprogram(). you can then provide this same index to gl.vertexattribpointer(). alternatively, you use the index that is assigned by the graphics card when compiling the vertex shader. depending on the graphics card, the index will vary, so you must call gl.getattriblocation() to find out ...
WebGL best practices - Web APIs
imagebitmap creation using the imagebitmapoptions dictionary is essential for properly preparing textures for upload to webgl, but unfortunately there'...
High-level guides - Web APIs
webrtc (web real-time communications) is a broad, multi-component system for setting up and operating complex audio, video, and data channels across networks among two or more peers on the web. the high-level guides listed below introduce webrtc technology from a top-down perspective, describing the overall architecture, the life cycle of a webrtc connection, and basic security and technological issues you might run into as you explore and build web content or apps using the webrtc api. in addition, you'll find suggestions as to tools, libraries, and frameworks that might be helpful and compatibility information so you know which parts of the overall suite of webrtc features can be safely used given your target audience. there are no subpages at this time. when you're ready to explore ...
Taking still photos with WebRTC - Web APIs
mise which we attach success and failure callbacks to. the success callback receives a stream object as input. it is the <video> element's source to our new stream. once the stream is linked to the <video> element, we start it playing by calling htmlmediaelement.play(). the error callback is called if opening the stream doesn't work. this will happen for example if there's no compatible camera connected, or the user denied access. listen for the video to start playing after calling htmlmediaelement.play() on the <video>, there's a (hopefully brief) period of time that elapses before the stream of video begins to flow. to avoid blocking until that happens, we add an event listener to video for the canplay event, which is delivered when the video playback actually begins. at that point, all th...
Improving compatibility using WebRTC adapter.js - Web APIs
the adapter is provided under a bsd-style license. what adapter.js does for each version of each browser that supports webrtc, adapter.js implements the needed polyfills, establishes the non-prefixed names of apis, and applies any other changes needed to make the browser run code written to the webrtc specification. for example, on firefox versions older than 38, the adapter adds the rtcpeerconnection.urls property; firefox doesn't natively support this property until firefox 38, while on chrome, the adapter adds support for the promise based api is added if it's not present. these are just a couple of examples; there are of course other adjustments made for you by the shim. the webrtc adapter currently supports mozilla firefox, google chrome, apple safari, and microsoft edge. using adapt...
WebSocket() - Web APIs
the websocket() constructor returns a new websocket object. syntax var awebsocket = new websocket(url [, protocols]); parameters url the url to which to connect; this should be the url to which the websocket server will respond. protocols optional either a single protocol string or an array of protocol strings. these strings are used to indicate sub-protocols, so that a single server can implement multiple websocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol). if you don't specify a protocol string, an empty string is assumed. exceptions thrown security_err the port to which the connection is being attempted is being blocked. syntaxerror the url is invalid. specifications ...
WebSocket.binaryType - Web APIs
syntax var binarytype = awebsocket.binarytype; value a domstring: "blob" if blob objects are used. "arraybuffer" if arraybuffer objects are used. ...
WebSocket.bufferedAmount - Web APIs
the websocket.bufferedamount read-only property returns the number of bytes of data that have been queued using calls to send() but not yet transmitted to the network. this value resets to zero once all queued data has been sent. this value does not reset to zero when the connection is closed; if you keep calling send(), this will continue to climb. syntax var bufferedamount = awebsocket.bufferedamount; value an unsigned long. specifications specification status comment html living standardthe definition of 'websocket: bufferedamount' in that specification. living standard initial definition ...
WebSocket: error event - Web APIs
the error event is fired when a connection with a websocket has been closed due to an error (some data couldn't be sent for example). bubbles no cancelable no interface event event handler property onerror examples // create websocket connection const socket = new websocket('ws://localhost:8080'); // listen for possible errors socket.addeventlistener('error', function (event) { console.log('websocket error: ', event); }); specifications specification status html living standardthe definition of 'websocket error' in that specification. living standard ...
WebSocket.extensions - Web APIs
syntax var extensions = awebsocket.extensions; value a domstring. ...
WebSocket: message event - Web APIs
the message event is fired when data is received through a websocket. bubbles no cancelable no interface messageevent event handler property onmessage examples // create websocket connection. const socket = new websocket('ws://localhost:8080'); // listen for messages socket.addeventlistener('message', function (event) { console.log('message from server ', event.data); }); specifications specification status html living standardthe definition of 'websocket message' in that specification. living standard ...
WebSocket.onclose - Web APIs
Web › API › WebSocket › onclose
it is called with a closeevent. syntax awebsocket.onclose = function(event) { console.log("websocket is closed now."); }; value an eventlistener. ...
WebSocket.onerror - Web APIs
Web › API › WebSocket › onerror
the websocket interface's onerror event handler property is a function which gets called when an error occurs on the websocket. you can also add an error event handler using addeventlistener(). syntax websocket.onerror = eventhandler; value a function or eventhandler which is executed whenever an error event occurs on the websocket connection. example websocket.onerror = function(event) { console.error("websocket error observed:", event); }; specifications specification status comment html living standardthe definition of 'websocket: onerror' in that specification. living standard initial definition ...
WebSocket: open event - Web APIs
the open event is fired when a connection with a websocket is opened. bubbles no cancelable no interface event event handler property onopen examples // create websocket connection. const socket = new websocket('ws://localhost:8080'); // connection opened socket.addeventlistener('open', (event) => { socket.send('hello server!'); }); specifications specification status html living standardthe definition of 'websocket open' in that specification. living standard ...
WebSocket.protocol - Web APIs
the websocket.protocol read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the websocket object, or the empty string if no connection is established. syntax var protocol = awebsocket.protocol; value a domstring. specifications specification status comment html living standardthe definition of 'websocket: protocol' in that specification. living standard initial definition ...
WebSocket.readyState - Web APIs
the websocket.readystate read-only property returns the current state of the websocket connection. syntax var readystate = awebsocket.readystate; value one of the following unsigned short values: value state description 0 connecting socket has been created. 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. 3 closed the connection is closed or couldn't be opened. specifications specification status comment html living standardthe definition of 'websocket: readystate' in that specification. living standard initial definition ...
Geometry and reference spaces in WebXR - Web APIs
is because of the need to insert virtual objects into the real world, not only placing them correctly but also ensuring that they don't seem to wander around on their own as the user's perspective shifts. in virtual reality (vr), it's all about creating a sense of space in which the user's movements are precisely matched by the imagery presented on the virtual display, to prevent disjoints and disconnects that could cause discomfort or worse. thus it's all about creating a sense of space. from the perspective of an xr developer, designing the stage is the part that matters most to your users. like an architect or a set designer, you have the power to create moods and experiences through a physical environment. how you structure that space will both depend on and influence how users can interact ...
Movement, orientation, and motion: A WebXR example - Web APIs
rtex normals; and the texture coordinates for each vertex. this is all taken directly from the webgl sample code, so refer to lighting in webgl and its preceding articles creating 3d objects using webgl and using textures in webgl. then our loadtexture() function is called to load the texture file. now that the rendering structures and data are loaded, we start preparing to run the xrsession. we connect the session to the webgl layer so it konws what to use as a rendering surface by calling xrsession.updaterenderstate() with a baselayer set to a new xrwebgllayer. we then look at the value of the session_type constant to see whether the webxr context should be immersive or inline. immersive sessions use the local reference space, while inline sessions use the viewer reference space. the glmatr...
Starting up and shutting down a WebXR session - Web APIs
reference space resets and more details and sample code, see the documentation for the reset event. detecting when the available set of webxr input controls changes webxr maintains a list of input controls which is specific to the webxr system. these devices include things such as the handheld controllers, motion-sensing cameras, motion-sensitive gloves and other feedback devices. when the user connects or disconnects a webxr controller device, the inputsourceschange event is dispatched to the xrsession. this is an opportunity to notify the user of the device's availability, begin to monitor it for inputs, offer configuration options, or whatever you need to do with it. ending the webxr session when the user's vr or ar session draws to a close, the session ends. the shutdown of an xrsession c...
Basic concepts behind Web Audio API - Web APIs
, say, just want to visualize some audio data. a simple, typical workflow for web audio would look something like this: create the audio context. inside the context, create sources — such as <audio>, oscillator, or stream. create effects nodes, such as reverb, biquad filter, panner, or compressor. choose the final destination for the audio, such as the user's computer speakers. establish connections from the audio sources through zero or more effects, eventually ending at the chosen destination. channel notation the number of audio channels available on a signal is frequently presented in a numeric format, such as 2.0 or 5.1. this is called channel notation. the first number is the number of full frequency range audio channels that the signal includes. the number after the period indi...
Web Authentication API - Web APIs
registering a new account or for associating a new asymmetric key pair credentials with an existing account. navigator.credentials.get() - when used with the publickey option, uses an existing set of credentials to authenticate to a service, either logging a user in or as a form of second-factor authentication. please note: both create() and get() require a secure context (e.g. - the server is connected by https or is the localhost), and will not be available for use if the browser is not operating in a secure context. in their most basic forms, both create() and get() receive a very large random number called a challenge from the server and they return the challenge signed by the private key back to the server. this proves to the server that a user is in possession of the private key require...
Web Bluetooth API - Web APIs
interfaces bluetooth returns a promise to a bluetoothdevice object with the specified options. bluetoothadvertisingdata provides advertising data about a particular bluetooth device. bluetoothcharacteristicproperties provides properties of a particular bluetoothremotegattcharacteristic. bluetoothdevice represents a bluetooth device inside a particular script execution environment. bluetoothremotegattcharacteristic represents a gatt characteristic, which is a basic data element that provides further information about a peripheral’s service. ...
Using the Web Speech API - Web APIs
the web speech api has a main controller interface for this — speechsynthesis — plus a number of closely-related interfaces for representing text to be synthesised (known as utterances), voices to be used for the utterance, etc. again, most oses have some kind of speech synthesis system, which will be used by the api for this task as available. demo to show simple usage of web speech s...
Window.controllers - Web APIs
lt, a window's controller contains the code that supports the global window commands. ...
Window: offline event - Web APIs
the offline event of the window interface is fired when the browser has lost access to the network and the value of navigator.online switches to false. bubbles no cancelable no interface event event handler property onoffline examples // addeventlistener version window.addeventlistener('offline', (event) => { console.log("the network connection has been lost."); }); // onoffline version window.onoffline = (event) => { console.log("the network connection has been lost."); }; specifications specification status html living standardthe definition of 'offline event' in that specification. living standard ...
Window: online event - Web APIs
uldn't be used to determine the availability of a particular website. network problems or firewalls might still prevent the website from being reached. bubbles no cancelable no interface event event handler property ononline examples // addeventlistener version window.addeventlistener('online', (event) => { console.log("you are now connected to the network."); }); // ononline version window.ononline = (event) => { console.log("you are now connected to the network."); }; specifications specification status html living standardthe definition of 'online event' in that specification. living standard ...
WindowOrWorkerGlobalScope.fetch() - Web APIs
ble in pretty much any context in which you might want to fetch resources. a fetch() promise only rejects when a network error is encountered (which is usually when there’s a permissions issue or similar). a fetch() promise does not reject on http errors (404, etc.). instead, a then() handler must check the response.ok and/or response.status properties. the fetch() method is controlled by the connect-src directive of content security policy rather than the directive of the resources it's retrieving. note: the fetch() method's parameters are identical to those of the request() constructor. syntax const fetchresponsepromise = fetch(resource [, init]) parameters resource this defines the resource that you wish to fetch. this can either be: a usvstring containing the direct url of ...
WorkerNavigator - Web APIs
ace allowed to be accessed from a worker. such an object is initialized for each worker and is available via the workerglobalscope.navigator property obtained by calling window.self.navigator. properties the workernavigator interface implements properties from the navigatorid, navigatorlanguage, navigatoronline, navigatordatastore, and navigatorconcurrenthardware interfaces. workernavigator.connectionread only provides a networkinformation object containing information about the network connection of a device. workernavigator.locks read only returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object. workernavigator.permissions read only returns a permissions object that can be used to query and update permission s...
Using XMLHttpRequest - Web APIs
fercomplete); oreq.upload.addeventlistener("error", transferfailed); oreq.upload.addeventlistener("abort", transfercanceled); oreq.open(); note: progress events are not available for the file: protocol. note: starting in gecko 9.0, progress events can now be relied upon to come in for every chunk of data received, including the last chunk in cases in which the last packet is received and the connection closed before the progress event is fired. in this case, the progress event is automatically fired when the load event occurs for that packet. this lets you now reliably monitor progress by only watching the "progress" event. note: as of gecko 12.0, if your progress event is called with a responsetype of "moz-blob", the value of response is a blob containing the data received so far. one ...
XMLHttpRequest() - Web APIs
parameters (non-standard) objparameters there are two flags you can set: mozanon boolean: setting this flag to true will cause the browser not to expose the origin and user credentials when fetching resources. most important, this means that cookies will not be sent unless explicitly added using setrequestheader. mozsystem boolean: setting this flag to true allows making cross-site connections without requiring the server to opt-in using cors. requires setting mozanon: true, i.e. this can't be combined with sending cookies or other user credentials. this only works in privileged (reviewed) apps (bug 692677); it does not work on arbitrary webpages loaded in firefox ...
XMLHttpRequest.getAllResponseHeaders() - Web APIs
s set-cookie or set-cookie2) separated by crlf, or null if no response has been received. if a network error happened, an empty string is returned. an example of what a raw header string looks like: date: fri, 08 dec 2017 21:04:30 gmt\r\n content-encoding: gzip\r\n x-content-type-options: nosniff\r\n server: meinheld/0.6.1\r\n x-frame-options: deny\r\n content-type: text/html; charset=utf-8\r\n connection: keep-alive\r\n strict-transport-security: max-age=63072000\r\n vary: cookie, accept-encoding\r\n content-length: 6502\r\n x-xss-protection: 1; mode=block\r\n each line is terminated by both carriage return and line feed characters (\r\n). these are essentially delimiters separating each of the headers. note: in modern browsers, the header names are returned in all lower case, as per the la...
XRInputSource - Web APIs
tion. when a primary action begins, a selectstart event is sent to the xrsession. when the action has completed (such as when the user releases the button), a select event is sent. finally, once that is done—or if the user aborts the action—a selectend event is sent to the session object. an action may be aborted either by the user in some device-specific fashion or if the input device is disconnected before the action is completed. local coordinate system each input source has its own local coordinate system, which is described by the gripspace property, which is an xrspace used to map the input's coordinate system into the world coordinate system. the grip space's coordinate system can then be used to render objects so they appear to be held in the user's hand. for more details on the...
XRInputSourceArray - Web APIs
in addition to being able to access the input sources in the list using standard array notation (that is, with index numbers insize square brackets), methods are available to allow the use of iterators and the foreach() method is also available. properties the following properties are available on xrinputsourcearray objects. ...
XRInputSourcesChangeEvent - Web APIs
xrinputsourceschangeevent() creates and returns a new xrinputsourceschangeevent object configured as indicated by the given xrinputsourceschangeeventinit object. the specified type must be inputsourceschange, which is the only event that uses this interface. properties added read only an array of zero or more xrinputsource objects, each representing an input device which has been newly connected or enabled for use. removed read only an array of zero or more xrinputsource objects representing the input devices newly connected or enabled for use. session read only the xrsession to which this input source change event is being directed. methods while xrinputsourceschangeevent defines no methods of its own, it inherits methods from its parent interface, event. event types inpu...
XRReferenceSpace - Web APIs
ce("local").then((refspace) => { xrreferencespace = refspace; /* ... */ }); the other situation in which you may need to acquire a new reference space is if you need to move the origin to a new position; this is commonly done, for example, when your project allows the user to move through the environment using input devices such as the keyboard, mouse, touchpad, or game controls that are not connected through the xr device. since the origin will typically be the user's location in the space, you need to change the origin to reflect their movement and any orientation changes they make. to move or rotate the user's view of the world, you need to change the xrreferencespace used to represent that viewpoint. however, xrreferencespace is immutable, so you need to instead create a new reference s...
XRSession.end() - Web APIs
Web › API › XRSession › end
ethod shuts down the xrsession on which it's called, returning a promise which resolves once the session has fully shut down. syntax xrsession.end(); parameters none. return value a promise that resolves without a value after any platform-specific steps related to shutting down the session have completed. you can use the promise to do things like update ui elements to reflect the shut down connection, trigger application shut down, or whatever else you might need to do. example specifications specification status comment webxr device apithe definition of 'xrsession.end' in that specification. working draft initial definition. ...
XRSession.inputSources - Web APIs
available. these controllers may include handheld controllers, xr-equipped gloves, optically tracked hands, and gaze-based input methods. keyboards, gamepads, and mice are not considered webxr input sources. note: traditional gamepad controllers are supported using the gamepad api. syntax inputsources = xrsession.inputsources; value an xrinputsourcearray object listing all of the currently-connected input controllers which are linked specifically to the xr device currently in use. the returned object is live; as devices are connected to and removed from the user's system, the list's contents update to reflect the changes. usage notes you can add a handler for the xrsession event inputsourceschange to be advised when the contents of the session's connected devices list changes. you can th...
XRSession: selectend event - Web APIs
primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. ...
XRSession: squeezeend event - Web APIs
primary squeeze actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer. ...
XRSession - Web APIs
Web › API › XRSession
after the selectstart event is sent and immediately before the selectend event is sent. if select is not sent, then the select action was aborted before being completed. also available through the onselect event handler property. selectend an event of type xrinputsourceevent which gets sent to the session object when one of its input devices finishes its primary action or gets disconnected while in the process of handling a primary action. for example: for button or trigger actions, this means the button has been released; for spoken commands, it means the user has finished speaking. this is the last of the three select* events to be sent. also available through the onselectend event handler property. selectstart an event of type xrinputsourceevent which is sent t...
Using the alert role - Accessibility
nsitive 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. the alert role is most useful for information that requires the user's immediate attention, for example: an invalid value was entered into a form field the user's login session is about to expire the connection to the server was lost, local changes will not be saved because of its intrusive nature, the alert role must be used sparingly and only in situations where the user's immediate attention is required. dynamic changes that are less urgent should use a less aggressive method, such as aria-live="polite" or other live region roles. possible effects on user agents and assistive technology when ...
@font-face - CSS: Cascading Style Sheets
@font-face makes it possible to design content without being limited to the so-called "web-safe" fonts (that is, the fonts which are so common that they're considered to be universally available). the ability to specify the name of a locally-installed font to look for and use makes it possible to customize the font beyond the basics while making it possible to do so without relying on an internet connection. it's common to use both url() and local() together, so that the user's installed copy of the font is used if available, falling back to downloading a copy of the font if it's not found on the user's device. the @font-face at-rule may be used not only at the top level of a css, but also inside any css conditional-group at-rule. font mime types format mime type true...
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
if it finds an item that will fit in a previous gap it will pick it up and take it out of dom order to place it in the gap. as with any other reordering in grid this does not change the logical order. tab order for example, will still follow the document order. we will take a look at the potential accessibility issues of grid layout in a later guide, but you should take care when creating this disconnect between the visual order and display order. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> ...
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
hose raised regarding css flexbox, which also gives methods of reordering content with flex-direction and the order property. the concept of visual display following document source order is detailed in the wcag techniques for success criteria – technique c27. as a way to start thinking about these issues, as you use css grid layout i would suggest reading flexbox & the keyboard navigation disconnect from léonie watson. also the video of léonie’s presentation from ffconf is helpful to understand more about how screen readers work with the visual representation of things in css. adrian roselli has also posted regarding tab order in various browsers – although this was prior to grid support being fully implemented in firefox. ...
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
id-area: content; } .main-nav { grid-area: nav; } .side { grid-area: sidebar; } .ad { grid-area: ad; } .main-footer { grid-area: footer; } this will not create any layout, however our items now have names we can use to do so. staying outside of any media queries i am now going to set up the layout for the mobile width. here i am keeping everything in source order, trying to avoid any disconnect between the source and display as described in the guide grid layout and accessibility. i have not defined any column or row tracks but this layout dictates a single column, and rows will be created as needed for each of the items in the implicit grid. .wrapper { display: grid; grid-gap: 20px; grid-template-areas: "header" "nav" "content" "sidebar" "ad" "footer"; } ...
border-bottom-style - CSS: Cascading Style Sheets
the border-bottom-style css property sets the line style of an element's bottom border. 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. note: the specification doesn't define how borders of different styles connect in the corners. syntax /* keyword values */ border-bottom-style: none; border-bottom-style: hidden; border-bottom-style: dotted; border-bottom-style: dashed; border-bottom-style: solid; border-bottom-style: double; border-bottom-style: groove; border-bottom-style: ridge; border-bottom-style: inset; border-bottom-style: outset; /* global values */ border-bottom-style: inherit; border-bottom-style: initial;...
border-left-style - CSS: Cascading Style Sheets
the border-left-style css property sets the line style of an element's left border. 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. note: the specification doesn't define how borders of different styles connect in the corners. syntax /* keyword values */ border-left-style: none; border-left-style: hidden; border-left-style: dotted; border-left-style: dashed; border-left-style: solid; border-left-style: double; border-left-style: groove; border-left-style: ridge; border-left-style: inset; border-left-style: outset; /* global values */ border-left-style: inherit; border-left-style: initial; border-left-style: unset; ...
border-right-style - CSS: Cascading Style Sheets
the border-right-style css property sets the line style of an element's right border. 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. note: the specification doesn't define how borders of different styles connect in the corners. syntax /* keyword values */ border-right-style: none; border-right-style: hidden; border-right-style: dotted; border-right-style: dashed; border-right-style: solid; border-right-style: double; border-right-style: groove; border-right-style: ridge; border-right-style: inset; border-right-style: outset; /* global values */ border-right-style: inherit; border-right-style: initial; border-right-...
border-top-style - CSS: Cascading Style Sheets
the border-top-style css property sets the line style of an element's top border. 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 specification doesn't define how borders of different styles connect in the corners. syntax /* keyword values */ border-top-style: none; border-top-style: hidden; border-top-style: dotted; border-top-style: dashed; border-top-style: solid; border-top-style: double; border-top-style: groove; border-top-style: ridge; border-top-style: inset; border-top-style: outset; /* global values */ border-top-style: inherit; border-top-style: initial; border-top-style: unset; the border-top-sty...
font-family - CSS: Cascading Style Sheets
t ms", "liberation sans", "nimbus sans l", sans-serif. monospace all glyphs have the same fixed width. e.g. "fira mono", "dejavu sans mono", menlo, consolas, "liberation mono", monaco, "lucida console", monospace. cursive glyphs in cursive fonts generally have either joining strokes or other cursive characteristics beyond those of italic typefaces. the glyphs are partially or completely connected, and the result looks more like handwritten pen or brush writing than printed letterwork. e.g. "brush script mt", "brush script std", "lucida calligraphy", "lucida handwriting", "apple chancery", cursive. fantasy fantasy fonts are primarily decorative fonts that contain playful representations of characters. e.g. papyrus, herculanum, party let, curlz mt, harrington, fantasy. system-ui...
image-set() - CSS: Cascading Style Sheets
Web › CSS › image-set
ution and bandwidth differ by device and network access. the image-set() function delivers the most appropriate image resolution for a user’s device, providing a set of image options — each with an associated resolution declaration — from which the browser picks the most appropriate for the device and settings. resolution can be used as a proxy for filesize — a user agent on a slow mobile connection with a high-resolution screen may prefer to receive lower-resolution images rather than waiting for a higher resolution image to load. image-set() allows the author to provide options rather than determining what each individual user needs. syntax image-set() = image-set( <image-set-option># ) where <image-set-option> = [ <image> | <string> ] <resolution> and <string> is an <url> va...
letter-spacing - CSS: Cascading Style Sheets
on-specific limits. user agents may not further increase or decrease the inter-character space in order to justify text. accessibility concerns a large positive or negative letter-spacing value will make the word(s) the styling is applied to unreadable. for text styled with a very large positive value, the letters will be so far apart that the word(s) will appear like a series of individual, unconnected letters. for text styled with a very large negative value, the letters will overlap each other to the point where the word(s) may be unrecognizable. legible letter-spacing must be determined on a case-by-case basis, as different font families have different character widths. there is no one value that can ensure all font families automatically maintain their legibility. mdn understanding wc...
Guide to scroll anchoring - CSS: Cascading Style Sheets
this has happened because large images or some other elements have just loaded further up in the content. scroll anchoring is a browser feature that aims to solve this problem of content jumping, which happens if content loads in after the user has already scrolled to a new part of the document. ...
var() - CSS: Cascading Style Sheets
Web › CSS › var
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 var() function cannot be used in property names, selectors or anything else besides property values. (doing so usually produces invalid syntax, or else a value whose meaning has no connection to the variable.) syntax the first argument to the function is the name of the custom property to be substituted. an optional second argument to the function serves as a fallback value. if the custom property referenced by the first argument is invalid, the function uses the second value. var( <custom-property-name> , <declaration-value>? ) note: the syntax of the fallback, like that of ...
Getting Started - Developer guides
full server response was received and it's ok for you to continue processing it. if (httprequest.readystate === xmlhttprequest.done) { // everything is good, the response was received. } else { // not ready yet. } the full list of the readystate values is documented at xmlhttprequest.readystate and is as follows: 0 (uninitialized) or (request not initialized) 1 (loading) or (server connection established) 2 (loaded) or (request received) 3 (interactive) or (processing request) 4 (complete) or (request finished and response is ready) next, check the http response status codes of the http response. the possible codes are listed at the w3c. in the following example, we differentiate between a successful and unsuccessful ajax call by checking for a 200 ok response code. if (httpr...
Ajax - Developer guides
Web › Guide › AJAX
json, or string. this article will show some ajax i/o techniques. xml the extensible markup language (xml) is a w3c-recommended general-purpose markup language for creating special-purpose markup languages. it is a simplified subset of sgml, capable of describing many different kinds of data. its primary purpose is to facilitate the sharing of data across different systems, particularly systems connected via the internet. parsing and serializing xml how to parse an xml document from a string, a file or via javascript and how to serialize xml documents to strings, javascript object trees (jxon) or files. xpath xpath stands for xml path language, it uses a non-xml syntax that provides a flexible way of addressing (pointing to) different parts of an xml document. as well as this, it can also b...
Mutation events - Developer guides
}, false); the event object is pass...
Mobile-friendliness - Developer guides
example of this is alaska air’s website. their desktop site focuses on getting visitors to book trips. mobile users, however, are probably more interested in checking-in for a flight or seeing if their flight is delayed. they’ve adjusted their site’s content to reflect this, and it meets the needs of mobile users. goal #3 (performance) “give your users a smooth experience, even on a slow connection.” though things have been getting better in recent years, browsing the internet over a wireless data connection can still be pretty painful. this makes it more essential than ever to practice good performance practices, only sending the user the bits they will actually need. know your audience while not strictly a part of the definition of being mobile friendly, defining who your target audi...
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
es inline rather than in a separate block, use the <q> (quotation) element. example this example demonstrates the use of the <blockquote> element to quote a passage from rfc 1149, a standard for the transmission of ip datagrams on avian carriers. <blockquote cite="https://tools.ietf.org/html/rfc1149"> <p>avian carriers can provide high delay, low throughput, and low altitude service. the connection topology is limited to a single point-to-point path for each carrier, used with standard carriers, but many carriers can be used without significant interference with each other, outside of early spring. this is because of the 3d ether space available to the carriers, in contrast to the 1d ether used by ieee802.3. the carriers have an intrinsic collision avoidance system, which ...
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
link types: noreferrer attribute, html, link types, reference the noreferrer keyword for the rel attribute of the <a>, <area>, and <form> elements instructs the browser, when navigating to the target resource, to omit the referer header and otherwise leak no referrer information — and additionally to behave as if the noopener keyword were also specified. 229 link types: preconnect attribute, html, link, link types, reference the preconnect keyword for the rel attribute of the <link> element is a hint to browsers that the user is likely to need resources from the target resource's origin, and therefore the browser can likely improve the user experience by preemptively initiating a connection to that origin. 230 link types: prefetch attribute, html,...
HTTP authentication - HTTP
enge. a client that wants to authenticate itself with the server can then do so by including an authorization request header with the credentials. usually a client will present a password prompt to the user and will then issue the request including the correct authorization header. in the case of a "basic" authentication like shown in the figure, the exchange must happen over an https (tls) connection to be secure. proxy authentication the same challenge and response mechanism can be used for proxy authentication. as both resource authentication and proxy authentication can coexist, a different set of headers and status codes is needed. in the case of proxies, the challenging status code is 407 (proxy authentication required), the proxy-authenticate response header contains at least one c...
Identifying resources on the Web - HTTP
it indicates which web server is being requested. alternatively, it is possible to directly use an ip address, but because it is less convenient, it is not often used on the web. port :80 is the port in this instance. it indicates the technical "gate" used to access the resources on the we...
MIME types (IANA media types) - HTTP
d file: <input type="file" name="myfile" value="test.txt"></label> <button>send the file</button> </form> will send this message: post / http/1.1 host: localhost:8000 user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate connection: keep-alive upgrade-insecure-requests: 1 content-type: multipart/form-data; boundary=---------------------------8721656041911415653955004498 content-length: 465 -----------------------------8721656041911415653955004498 content-disposition: form-data; name="mytextfield" test -----------------------------8721656041911415653955004498 content-disposition: form-data; name="mycheckbox" on -------...
Resource URLs - HTTP
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. resource urls, urls prefixed with the resource: scheme, are used by firefox and firefox browser extensions to load resources internally, but some of the information is available to sites the browser connects to as well. syntax resource urls are composed of two parts: a prefix (resource:), and a url pointing to the resource you want to load: resource://<url> an example: resource://gre/res/svg.css when arrows are found in the resource url's ('->'), it means that the first file loaded the next one: resource://<file-loader> -> <file-loaded> please refer to identifying resources on the web for mo...
Reason: CORS request did not succeed - HTTP
the error is not directly related to cors, but is a fundamental network error of some kind. in many cases, it is caused by a browser plugin (e.g. an ad blocker or privacy protector) blocking the request. other possible causes include: trying to access an https resource that has an invalid certificate will cause this error. trying to access an http resource from a page with an https origin will also cause this error. ...
Reason: CORS preflight channel did not succeed - HTTP
the preflight request simply suffered any kind of networking error that might ordinarily occur. ...
Content Security Policy (CSP) - HTTP
Web › HTTP › CSP
y standpoint), a server can specify that all content must be loaded using https. a complete data transmission security strategy includes not only enforcing https for data transfer, but also marking all cookies with the secure attribute and providing automatic redirects from http pages to their https counterparts. sites may also use the strict-transport-security http header to ensure that browsers connect to them only over an encrypted channel. using csp configuring content security policy involves adding the content-security-policy http header to a web page and giving it values to control what resources the user agent is allowed to load for that page. for example, a page that uploads and displays images could allow images from anywhere, but restrict a form action to a specific endpoint. a prope...
Using HTTP cookies - HTTP
Web › HTTP › Cookies
personalization user preferences, themes, and other settings tracking recording and analyzing user behavior cookies were once used for general client-side storage. while this was legitimate when they were the only way to store data on the client, it is now recommended to use modern storage apis. cookies are sent with every request, so they can worsen performance (especially for mobile data connections). modern apis for client storage are the web storage api (localstorage and sessionstorage) and indexeddb. to see stored cookies (and other storage that a web page can use), you can enable the storage inspector in developer tools and select cookies from the storage tree. creating cookies after receiving an http request, a server can send one or more set-cookie headers with the response. t...
Access-Control-Allow-Headers - HTTP
specifications specification status comment fetchthe definition of 'access-control-allow-headers' in that specification. living standa...
Alt-Svc - HTTP
Web › HTTP › Headers › Alt-Svc
override, a colon, and a mandatory port number. ma=<max-age>optional the number of seconds for which the alternative service is considered fresh. if omitted, it defaults to 24 hours. alternative service entries can be cached for up to <max-age> seconds, minus the age of the response (from the age header). if the cached entry expires, the client can no longer use this alternative service for new connections. persist=1optional usually cached alternative service entries are cleared on network configuration changes. use of the persist=1 parameter ensures that the entry is not deleted through such changes. multiple entries can be specified in a single alt-svc header using comma as separator. in that case, early entries are considered more preferable. example alt-svc: h2=":443"; ma=2592000; alt...
Cache-Control - HTTP
ation. in firefox, immutable is only honored on https:// transactions. for more information, see also this blog post. other no-transform an intermediate cache or proxy cannot edit the response body, content-encoding, content-range, or content-type. it therefore forbids a proxy or browser feature, such as google’s web light, from converting images to minimize data for a cache store or slow connection. only-if-cached set by the client to indicate "do not use the network" for the response. the cache should either respond using a stored response, or respond with a 504 status code. conditional headers such as if-none-match should not be set. there is no effect if only-if-cached is set by a server as part of a response. examples preventing caching to disable caching of a resource, you can...
Public-Key-Pins-Report-Only - HTTP
the header is silently ignored in modern browsers as support for hpkp has been removed. ...
Save-Data - HTTP
a value of on indicates explicit user opt-in into a reduced data usage mode on the client, and when communicated to origins allows them to deliver alternative content to reduce the data downloaded such as smaller image and video resources, different markup and styling, disabled polling and automatic updates, and so on. ...
Sec-WebSocket-Accept - HTTP
the sec-websocket-accept header is used in the websocket opening handshake. it would appear in the response headers. that is, this is header is sent from server to client to inform that server is willing to initiate a websocket connection. header type response header forbidden header name no syntax sec-websocket-accept: <hashed key> directives <hashed key> the server takes the value of the sec-websocket-key sent in the handshake request, appends 258eafa5-e914-47da-95ca-c5ab0dc85b11, takes sha-1 of the new value, and is then base64 encoded. examples sec-websocket-accept: s3pplmbitxaq9kygzzhzrbk+xoo= specification specification title rfc 6455, section 11.3.3: sec-websocket-accept the websocket protocol ...
Transfer-Encoding - HTTP
transfer-encoding header specifies the form of encoding used to safely transfer the payload body to the user. http/2 doesn't support http 1.1's chunked transfer encoding mechanism, as it provides its own, more efficient, mechanisms for data streaming. transfer-encoding is a hop-by-hop header, that is applied to a message between two nodes, not to a resource itself. each segment of a multi-node connection can use different transfer-encoding values. if you want to compress data over the whole connection, use the end-to-end content-encoding header instead. when present on a response to a head request that has no body, it indicates the value that would have applied to the corresponding get message. header type response header forbidden header name yes syntax trans...
Warning - HTTP
Web › HTTP › Headers › Warning
arning 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 cache heuristically chose a freshness lifetime greater than 24 hours and the response's age is greater than 24 hours. 199 miscellaneous warning arbitrary, non-specific warning 214 transformation applied added by a proxy if it applies any transforma...
X-Forwarded-For - HTTP
when traffic is intercepted between clients and servers, server access logs contain the ip address of the proxy or load balancer only. to see the original ip address of the client, the x-forwarded-for request header is used. this header is used for debugging, statistics, and generating location-dependent content and by design it exposes privacy sensitive information, such as the ip address of the client. therefore the user's privacy must be kept in mind when deploying this header. ...
X-Forwarded-Proto - HTTP
your server access logs contain the protocol used between the server and the load balancer, but not the protocol used between the client and the load balancer. to determine the protocol used between the client and the load balancer, the x-forwarded-proto request header can be used. a standardized version of this header is the http forwarded header. ...
101 Switching Protocols - HTTP
Web › HTTP › Status › 101
client which sent the message including the upgrade request header. the server includes in this response an upgrade response header to indicate the protocol it switched to. ...
205 Reset Content - HTTP
Web › HTTP › Status › 205
...
408 Request Timeout - HTTP
Web › HTTP › Status › 408
the hypertext transfer protocol (http) 408 request timeout response status code means that the server would like to shut down this unused connection. it is sent on an idle connection by some servers, even without any previous request by the client. a server should send the "close" connection header field in the response, since 408 implies that the server has decided to close the connection rather than continue waiting. this response is used much more since some browsers, like chrome, firefox 27+, and ie9, use http pre-connection mechanisms to speed up surfing. note: some servers merely shut down the connection without sending this message. status 408 request timeout specifications specification title rfc 7231, section 6.5.7: 408 request timeout hypertext transfer...
413 Payload Too Large - HTTP
Web › HTTP › Status › 413
the http 413 payload too large response status code indicates that the request entity is larger than limits defined by server; the server might close the connection or return a retry-after header field. status 413 payload too large specifications specification title rfc 7231, section 6.5.11: 413 payload too large hypertext transfer protocol (http/1.1): semantics and content ...
426 Upgrade Required - HTTP
Web › HTTP › Status › 426
http 426 upgrade required client error response code indicates that the server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. ...
Introduction - JavaScript
ake webpages interactive (e.g., having complex animations, clickable buttons, popup menus, etc.). there are also more advanced server side versions of javascript such as node.js, which allow you to add more functionality to a website than simply downloading files (such as realtime collaboration between multiple computers). inside a host environment (for example, a web browser), javascript can be connected to the objects of its environment to provide programmatic control over them. javascript contains a standard library of objects, such as array, date, and math, and a core set of language elements such as operators, control structures, and statements. core javascript can be extended for a variety of purposes by supplementing it with additional objects; for example: client-side javascript exte...
Array - JavaScript
ary. the 2 in years[2] is coerced into a string by the javascript engine through an implicit tostring conversion. as a result, '2' and '02' would refer to two different slots on the years object, and the following example could be true: console.log(years['2'] != years['02']) relationship between length and numerical properties a javascript array's length property and numerical properties are connected. several of the built-in array methods (e.g., join(), slice(), indexof(), etc.) take into account the value of an array's length property when they're called. other methods (e.g., push(), splice(), etc.) also result in updates to an array's length property. const fruits = [] fruits.push('banana', 'apple', 'peach') console.log(fruits.length) // 3 when setting a property on a javascript arr...
Lexical grammar - JavaScript
terals 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 byte order mark <bom> used at the start of the script to mark it as unicode and the text's byte order ...
Media container formats (file types) - Web media technologies
longer necessary to choose between mp3's broad compatibility and the need to pay royalties when using it. video files if you need... consider using this container format general purpose video, preferably in an open format webm (ideally with mp4 fallback) general purpose video mp4 (ideally with webm or ogg fallback) high compression optimized for slow connections 3gp (ideally with mp4 fallback) compatibility with older devices/browsers quicktime (ideally with avi and/or mpeg-2 fallback) these suggestions make a number of assumptions. you should carefully consider the options before making a final decision, especially if you have a lot of media that will need to be encoded. maximizing compatibility with multiple containers to op...
Image file type and format guide - Web media technologies
mation support caused a resurgence in its popularity in the social media era, when animated gifs began to be widely used for short "videos", memes, and other simple animation sequences. another popular feature of gif is support for interlacing, where rows of pixels are stored out of order so that partially-received files can be displayed in lower quality. this is particularly useful when network connections are slow. gif is a good choice for simple images and animations, although converting full color images to gif can result in unsatisfactory dithering. typically, modern content should use png for lossless and indexed still images, and should consider using apng for lossless animation sequences. mime type image/gif file extension(s) .gif specification gif87...
Handling media support issues in web content - Web media technologies
tself but contains imagery and/or text which gives the reader a useful idea of the video's contents. in the case of an action movie, for example, the poster frame might be an iconic exemplar image from one of the film's best-known scenes. a similar concept can be applied to still images; if an image you wish to present is very large and may take time to download (especially for slower devices or connections), you can offer a lower-resolution or alternate version that will be displayed until the full-quality version is available to be displayed. we'll look at both of these scenarios and how to implement them. poster frames for video progressive images images—whether embedded using <img> or <picture>—don't support a concept similar to poster frames. however, there are ways to present an im...
Critical rendering path - Web Performance
complete, the page is rendered, or 'painted' on the screen. document object model dom construction is incremental. the html response turns into tokens which turns into nodes which turn into the dom tree. a single dom node starts with a starttag token and ends with an endtag token. nodes contain all relevant information about the html element. the information is described using tokens. nodes are connected into a dom tree based on token hierarchy. if another set of starttag and endtag tokens come between a set of starttag and endtags, you have a node inside a node, which is how we define the hierarchy of the dom tree. the greater the number of nodes, the longer the following events in the critical rendering path will take. measure! a few extra nodes won't make a difference, but divitis can lead ...
Recommended Web Performance Timings: How long is too long? - Web Performance
content, it is important to provide feedback and acknowledge the user's response or interaction and to do so within 100ms, preferably within 50ms. 50ms seconds feels immediate. the acknowledgment of user interaction should often feel immediate, such as a hover or button press, but that doesn't mean the completed response should be instantaneous. while a slower than 100ms reaction may create a disconnect between the user interaction and the response, a 100 to 200ms transition for a response may help the user notice the response their interaction initiated, such as a menu opening. if a response takes longer than 100ms to complete, provide some form of feedback to inform the user the interaction has occurred. ...
Optimizing startup performance - Web Performance
should be. don't do one chunk of data after another; do them all at once when possible! don't include scripts or stylesheets that don't participate in the critical path in your startup html file. load them only when needed. reduce the side of your javascript files. try to send the minify version of the file to the browser and use compression like gzip or brotli. utilize resource hints (like preconnect or preload) whenever possible to indicate to the browser which files are more critical for your application. the more stuff you can do asynchronously, the better advantage your app can take of multicore processors. porting issues once the initial loading is done and the app's main code starts to run, it's possible your app may necessarily be single-threaded,especially if it's a port. the most...
Performance budgets - Web Performance
d to solve a common problem). how do i define a performance budget? a budget should include 2 levels: warning. error. the warning level allows you to be proactive and plan any tech debt, while not blocking development or deploys. the error level is an upper bound limit, where changes will have a negative and noticeable impact. in order to begin, you need to first measure the devices and connection speeds where your users are coming from (e.g. a ~$200 android device over a 3g connection), using multiple tools. these time-based metrics will translate into file-size budgets. a default baseline to reduce bounce rate is to achieve time to interactive under 5 seconds in 3g/4g, and under 2 seconds for subsequent loads. however, based on the specific goals and content of your site, you might c...
Progressive web app structure - Progressive web apps (PWAs)
that way, the next time someone visits the app from the device, the ui loads from the cache immediately and any new content is requested from the server (if it isn’t available in the cache already). this structure is fast, and also feels fast as the user sees "something" instantly, instead of a loading spinner or a blank page. it also allows the website to be accessible offline if the network connection is not available. we can control what is requested from the server and what is retrieved from the cache with a service worker, which will be explained in detail in the next article — for now let's focus on the structure itself. why should i use it? this architecture allows a website to benefit the most from all the pwa features — it caches the app shell and manages the dynamic content i...
The building blocks of responsive design - Progressive web apps (PWAs)
ge on screen. yes, you want the images to be contained inside the app ui whether you are using it on desktop or mobile, but you should also consider that mobile apps have much smaller viewport dimensions available than desktop apps, so you should try to give mobile devices a smaller image to download. mobiles in general (more commonly in some parts of the world than others) are on lower bandwidth connections and have less memory available than desktop devices, so yes, those extra kilobytes really do count. another challenge is dealing with high resolution screens — raster graphics designed for low resolutions are in danger of appearing tiny when displayed on a high resolution screen, so devices often apply a default zoom factor to rendered pages to avoid this. the trouble with this, then, is t...
Structural overview of progressive web apps - Progressive web apps (PWAs)
that way, the next time someone visits the app from the device, the ui loads from the cache immediately and any new content is requested from the server (if it isn’t available in the cache already). this structure is fast, and also feels fast as the user sees "something" instantly, instead of a loading spinner or a blank page. it also allows the website to be accessible offline if the network connection is not available. we can control what is requested from the server and what is retrieved from the cache with a service worker, which will be explained in detail in the next article — for now let's focus on the structure itself. benefits of the app shell pattern this architecture allows a web site to benefit the most from all the pwa features — it caches the app shell and manages the dy...
d - SVG: Scalable Vector Graphics
Web › SVG › Attribute › d
14,10" /> <path fill="none" stroke="purple" d="m 6,10 a 6 4 10 0 1 14,10" /> <path fill="none" stroke="pink" d="m 6,10 a 6 4 10 0 0 14,10" /> </svg> closepath closepath instructions draw a straight line from the current position to the first point in the path. command parameters notes z, z close the current subpath by connecting the last point of the path with its initial point. if the two points are at different coordinates, a straight line is drawn between those two points. note: the appearance of a shape closed with closepath may be different to that of one closed by drawing a line to the origin, using one of the other commands, because the line ends are joined together (according to the stroke-linejoin sett...
method - SVG: Scalable Vector Graphics
Web › SVG › Attribute › method
extpath>, method indicates the method by which text should be rendered along the path. value align | stretch default value align animatable yes align this value indicates that the characters should be rendered so that they are not stretched or warped. the characters are rotated, scaled and stretched when they are rendered. as a result, for fonts with connected characters (e.g. cursive fonts), the connections may not align properly when text is rendered along the path. stretch this value indicates that the character outlines will be converted into paths, and then stretched and possibly warped. with this approach, connected characters, such as in cursive fonts, will maintain their connections. specifications specification status com...
<line> - SVG: Scalable Vector Graphics
Web › SVG › Element › line
html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <line x1="0" y1="80" x2="100" y2="20" stroke="black" /> <!-- if you do not specify the stroke color the line will not be visible --> </svg> attributes x1 defines the x-axis coordinate of the line starting point. value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes x2 defines the x-axis coordinate of the line ending point. value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes y1 defines the y-axis coordinate of the line starting point. ...
<polygon> - SVG: Scalable Vector Graphics
Web › SVG › Element › polygon
for open shapes, see the <polyline> element. html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- example of a polygon with the default fill --> <polygon points="0,100 50,25 50,75 100,0" /> <!-- example of the same polygon shape with stroke and no fill --> <polygon points="100,100 150,25 150,75 200,0" fill="none" stroke="black" /> </svg> attributes points this attribute defines the list of points (pairs of x,y absolute coordinates) required to draw the polygon. ...
SVG: Scalable Vector Graphics
Web › SVG
ers to create rich animations and interactive images. ...
Certificate Transparency - Web security
(weak, 512 bit certificate issuance by digicert sdn bhd of malaysia). implementation when certificates are submitted to a ct log, a signed certificate timestamp (sct) is generated and returned. this serves as a proof that the certificate has been submitted and will be added to the log. the specification states that compliant servers must provide a number of these scts to tls clients when they connect. this can be accomplished via a number of different mechanisms: x.509v3 certificate extension which embeds signed certificate timestamps directly into the leaf certificate a tls extension of type signed_certificate_timestamp sent during the handshake ocsp stapling (that is, the status_request tls extension) and providing a signedcertificatetimestamplist with one or more scts with the x.509...
Mixed content - Web security
an https page that includes content fetched using cleartext http is called a mixed content page. pages like this are only partially encrypted, leaving the unencrypted content accessible to sniffers and man-in-the-middle attackers. that leaves the pages unsafe. types of mixed content there are two categories for mixed content: mixed passive/display content and mixed active content. the difference lies in the threat level of the worst case scenario if content is rewritten as part of a man-in-the-middle attack. ...
Same-origin policy - Web security
al method to determine if a domain is a public suffix. the browser will make a cookie available to the given domain including any sub-domains, no matter which protocol (http/https) or port is used. when you set a cookie, you can limit its availability using the domain, path, secure, and httponly flags. when you read a cookie, you cannot see from where it was set. even if you use only secure https connections, any cookie you see may have been set using an insecure connection. ...
Types of attacks - Web security
ack. when the user visits a page on the parent domain (or another subdomain), the application may trust the existing value sent in the user's cookie. this could allow an attacker to bypass csrf protection or hijack a session after the user logs in. alternatively, if the parent domain does not use http strict-transport-security with includesubdomains set, a user subject to an active mitm (perhaps connected to an open wifi network) could be served a response with a set-cookie header from a non-existent sub-domain. the end result would be much the same, with the browser storing the illegitimate cookie and sending it to all other pages under example.com. session fixation should primarily be mitigated by regenerating session cookie values when the user authenticates (even if a cookie already exists)...
Tutorials
hese provide much of the functionality you need for interacting with websites, e.g. registering and logging in, sending feedback, buying products, and more. this module gets you started with creating the client-side parts of forms. tips for authoring fast-loading html pages optimize web pages to provide a more responsive site for visitors and reduce the load on your web server and internet connection. css tutorials introductory level css basics css (cascading style sheets) is the code you use to style your webpage. css basics takes you through what you need to get started. we'll answer questions like: how do i make my text black or red? how do i make my content show up in such-and-such a place on the screen? how do i decorate my webpage with background images and colors? css ...
Using shadow DOM - Web Components
to an element. this article covers the basics of using the shadow dom. note: shadow dom is supported by default in firefox (63 and onwards), chrome, opera, and safari. the new chromium-based edge (75 and onwards) supports it too; the old edge didn't. high-level view this article assumes you are already familiar with the concept of the dom (document object model) — a tree-like structure of connected nodes that represents the different elements and strings of text appearing in a markup document (usually an html document in the case of web documents). as an example, consider the following html fragment: <!doctype html> <html> <head> <meta charset="utf-8"> <title>simple dom example</title> </head> <body> <section> <img src="dinosaur.png" alt="a red tyrannosaurus r...
WebAssembly Concepts - WebAssembly
cript glue code needed to achieve this. note: there are future plans to allow webassembly to call web apis directly. the javascript glue code is not as simple as you might imagine. for a start, emscripten implements popular c/c++ libraries like sdl, opengl, openal, and parts of posix. these libraries are implemented in terms of web apis and thus each one requires some javascript glue code to connect webassembly to the underlying web api. so part of the glue code is implementing the functionality of each respective library used by the c/c++ code. the glue code also contains the logic for calling the above-mentioned webassembly javascript apis to fetch, load and run the .wasm file. the generated html document loads the javascript glue file and writes stdout to a <textarea>. if the applicatio...
Using the WebAssembly JavaScript API - WebAssembly
r exception. the engine takes advantage of this supplied upper-bounds to reserve memory ahead of time, which can make resizing more efficient. note: since an arraybuffer’s bytelength is immutable, after a successful memory.prototype.grow() operation the buffer getter will return a new arraybuffer object (with the new bytelength) and any previous arraybuffer objects become “detached”, or disconnected from the underlying memory they previously pointed to. just like functions, linear memories can be defined inside a module or imported. similarly, a module may also optionally export its memory. this means that javascript can get access to the memory of a webassembly instance either by creating a new webassembly.memory and passing it in as an import or by receiving a memory export (via instanc...