Search completed in 0.95 seconds.
237 results for "signal":
Your results are loading. Please wait...
Signaling and video calling - Web APIs
webrtc allows real-time, peer-to-peer, media exchange between two devices. a connection is established through a discovery and negotiation process called signaling. this tutorial 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...
...s. 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. note: if you try out the example on glitch, please note that any changes made to the code will immediately reset any connections. in addition, there is a short timeout period; the glitch instance is for quick experiments and testing only. ...
...t as well. you can also look at the full project on github. note: if you try out the example on glitch, please note that any changes made to the code will immediately reset any connections. in addition, there is a short timeout period; the glitch instance is for quick experiments and testing only. the signaling server establishing a webrtc connection between two devices requires the use of a signaling server to resolve how to connect them over the internet. a signaling server's job is to serve as an intermediary to let two peers find and establish a connection while minimizing exposure of potentially private information as much as possible. how do we create this server and how does the signaling process actually work? first we need the signaling server itself. webrtc doesn't specify a tran...
...And 34 more matches
RTCPeerConnection.signalingState - Web APIs
the read-only signalingstate property on the rtcpeerconnection interface returns one of the string values specified by the rtcsignalingstate enum; these values describe the state of the signaling process on the local end of the connection while connecting or reconnecting to another peer. 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. ...
...ocal end of the connection while connecting or reconnecting to another peer. 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. for example, if you receive an answer while the signalingstate isn't "have-local-offer", you know that something is wrong, since you should only receive answers after creating an offer but before an answer has been received and passed into rtcpeerconnection.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 ad...
...mething is wrong, since you should only receive answers 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. ...
...And 4 more matches
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 ...
... 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. ...
...nction 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. ...
...And 3 more matches
AbortSignal - Web APIs
the abortsignal interface represents a signal object that allows you to communicate with a dom request (such as a fetch) and abort it if required via an abortcontroller object. properties the abortsignal interface also inherits properties from its parent interface, eventtarget. abortsignal.aborted read only a boolean that indicates whether the request(s) the signal is communicating with is/are aborted (true) or not (false). events listen to this event using addeventlistener() or by assigning an event listener to the oneventname property of this interface. abort invoked when the dom request(s) the signal is communicating with is/are aborted. also available via the onabort property. ...
... that indicates whether the request(s) the signal is communicating with is/are aborted (true) or not (false). events listen to this event using addeventlistener() or by assigning an event listener to the oneventname property of this interface. abort invoked when the dom request(s) the signal is communicating with is/are aborted. also available via the onabort property. methods the abortsignal interface inherits methods from its parent interface, eventtarget. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. ...
... the abortsignal interface inherits methods from its parent interface, eventtarget. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. ...
...And 2 more matches
AbortController.signal - Web APIs
the signal read-only property of the abortcontroller interface returns an abortsignal object instance, which can be used to communicate with/abort a dom request as desired. syntax var signal = abortcontroller.signal; value an abortsignal object instance. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). ...
...he following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. ...
...ect using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetchvideo); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetchvideo() { ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) ...
...{signal}).then(function(response) { ... }).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror. you can find a full working example on github — see abort-api (see it running live also). specifications specification status comment domthe definition of 'signal' in that specification. living standard initial definition ...
AbortSignal: abort event - Web APIs
the abort event of the fetch api is fired when a fetch request is aborted, i.e. using abortcontroller.abort(). bubbles no cancelable no interface event event handler onabort examples in the following snippets, we create a new abortcontroller object, and get its abortsignal (available in the signal property). ...
...rt event of the fetch api is fired when a fetch request is aborted, i.e. using abortcontroller.abort(). bubbles no cancelable no interface event event handler onabort examples in the following snippets, we create a new abortcontroller object, and get its abortsignal (available in the signal property). ...
...ler onabort examples in the following snippets, we create a new abortcontroller object, and get its abortsignal (available in the signal property). later on we check whether or not it the signal has been aborted using the onabort property, and send an appropriate log to the console. ...
... examples in the following snippets, we create a new abortcontroller object, and get its abortsignal (available in the signal property). later on we check whether or not it the signal has been aborted using the onabort property, and send an appropriate log to the console. you can use the abort event in an addeventlistener method: var controller = new abortcontroller(); var signal = controller.signal; signal.addeventlistener('abort', function() { console.log('request aborted'); }; or use the onabort event handler property: var controller = new abortcontroller(); var signal = controller.signal; signal.onabort = function() { console.log('request aborted'); }; specifications specification status domthe definition of 'abort' in that specification. living standard...
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. ...
... 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. ...
...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. ...
... 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 => { switch(pc.signalingstate) { case "stable": updatestatus("ice negotiation complete"); break; } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'signalingstatechange' in that specification. candidate recommend...
DTMF (Dual-Tone Multi-Frequency signaling) - MDN Web Docs Glossary: Definitions of Web-related terms
dual-tone multi-frequency (dtmf) signaling is a system by which audible tones are used to represent buttons being pressed on a keypad. frequently referred to in the united states as "touch tone" (after the touch-tone trademark used when the transition from pulse dialing to dtmf began), dtmf makes it possible to signal the digits 0-9 as well as the letters "a" through "d" and the symbols "#" and "*". few telephone keypads include the letters, which are typically used for control signaling by the telephone network. computers may make use of dtmf when dialing a modem, or when sending commands to a menu system for teleconferencing or other purposes. ...
... the digits 0-9 as well as the letters "a" through "d" and the symbols "#" and "*". few telephone keypads include the letters, which are typically used for control signaling by the telephone network. ...
AbortSignal.aborted - Web APIs
the aborted read-only property returns a boolean that indicates whether the dom request(s) the signal is communicating with is/are aborted (true) or not (false). syntax var isaborted = abortsignal.aborted; value a boolean examples in the following snippet, we create a new abortcontroller object, and get its abortsignal (available in the signal property). later on we check whether or not it the signal has been aborted using the aborted property, and send an appropriate log to the console. var controller = new abortcontroller(); var signal = controller.signal; // ... ...
...ted = abortsignal.aborted; value a boolean examples in the following snippet, we create a new abortcontroller object, and get its abortsignal (available in the signal property). later on we check whether or not it the signal has been aborted using the aborted property, and send an appropriate log to the console. var controller = new abortcontroller(); var signal = controller.signal; // ... signal.aborted ? console.log('request has been aborted') : console.log('request not aborted'); specifications specification status comment domthe definition of 'onabort' in that specification. living standard initial definition ...
AbortSignal.onabort - Web APIs
the onabort read-only property of the fetchsignal interface is an event handler invoked when an abort event fires, i.e. when the fetch request(s) the signal is communicating with is/are aborted. syntax abortsignal.onabort = function() { ... }; examples in the following snippet, we create a new abortcontroller object, and get its abortsignal (available in the signal property). later on we check whether or not it the signal has been aborted using the onabort property, and send an appropriate log to the console. var controller = new abortcontroller(); var signal = controller.signal; signal.onabort = function() { console.log('request aborted'); }; specifications specification status comment domthe definition of 'onabort' in that specification. living ...
Index - Web APIs
Web › API › Index
creates a new abortcontroller object instance. 8 abortcontroller.abort() api, abortcontroller, experimental, fetch, method, reference, abort() the abort() method of the abortcontroller interface aborts a dom request (e.g. a fetch request) before it has completed. this is able to abort fetch requests, consumption of any response body, and streams. ...
...r.abort() api, abortcontroller, experimental, fetch, method, reference, abort() the abort() method of the abortcontroller interface aborts a dom request (e.g. a fetch request) before it has completed. this is able to abort fetch requests, consumption of any response body, and streams. ...
..., abortcontroller, experimental, fetch, method, reference, abort() the abort() method of the abortcontroller interface aborts a dom request (e.g. a fetch request) before it has completed. this is able to abort fetch requests, consumption of any response body, and streams. ...
...And 35 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
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. ...
...any time a collision occurs, the impolite peer wins. this way, both peers know exactly what should happen if there are collisions between offers that have been sent. responses to error conditions become far more predictable. how you determine which peer is polite and which is impolite is generally up to you. it could be as simple as assigning the polite role to the first peer to connect to the signaling server, or you could do something more elaborate like having the peers exchange random numbers and assigning the polite role to the winner. however you make the determination, once these roles are assigned to the two peers, they can then work together to manage signaling in a way that doesn't deadlock and doesn't require a lot of extra code to manage. an important thing to keep in mind is thi...
...d it sends an offer but there's a collision with the impolite peer, the polite peer drops its offer and instead replies to the offer it has received from the impolite peer. by doing so, the polite peer has switched from being the caller to the callee! implementing perfect negotiation let's take a look at an example that implements the perfect negotiation pattern. the code assumes that there's a signalingchannel class defined that is used to communicate with the signaling server. your own code, of course, can use any signaling technique you like. note that this code is identical for both peers involved in the connection. create the signaling and peer connections first, the signaling channel needs to be opened and the rtcpeerconnection needs to be created. the stun server listed here is obvio...
...And 27 more matches
RTCPeerConnection - Web APIs
ssiondescription 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.sctp 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. ...
... (which includes configuration and media information) for the remote end of the connection. if this hasn't been set yet, this is null.sctp 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. ...
...set yet, this is null.sctp 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. ...
...And 14 more matches
Digital audio concepts - Web media technologies
e of audio frequencies the a/d converter is capable of capturing and converting into digital form. the audio bandwidth is also affected by the codec, if it chooses to discard any frequency bands while encoding the sound. sound enters the computer through a microphone or other input in the form of a stream of electrons whose voltage varies to represent the amplitude of the sound wave. this analog signal is then converted into digital form by a circuit that captures the incoming wave's amplitude at regular intervals, converting that data into a number in a form that is understood by the audio recording system. each of these captured moments is a sample. by chaining all the samples together, you can approximately represent the original wave, as seen in the diagram below. in this example, the bl...
... a form that is understood by the audio recording system. each of these captured moments is a sample. by chaining all the samples together, you can approximately represent the original wave, as seen in the diagram below. in this example, the blue line represents the samples taken from the audio waveform, which is black. at regular intervals, the a/d converter circuitry reads the voltage of the signal as a value between (in this case) -1.0 and +1.0. since the amplitude varies over the duration of that time slice, the a/d converter must choose a value to represent that slice, whether by simply taking the value at a particular moment (in the diagram above, the midpoint of each slice is used as the value), or by averaging the amplitude over the duration of each sample. those sample values are the...
...e, and how much different the blue, digital wave would look if you took samples twice as often. or ten times as often. the more samples you take, the smoother the wave becomes. audio data format and structure at the most basic level, audio is represented by a stream of samples, each specifying the amplitude of the audio waveform as measured for a given slice of the overall waveform of the audio signal. there are several formats used for the individual samples within an audio file. most audio files use 16-bit signed integers for each sample, but others use 32-bit floating-point values or 24-bit or 32-bit integers. some older audio file formats—which you won't find in use on the web—used 8-bit integer samples. in addition, samples may use signed or unsigned values, as well. the size of an in...
...And 12 more matches
Lifetime of a WebRTC session - Web APIs
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 the connection the internet is big. really big. it’s so big that years ago, smart people saw how big it was, how fast it was grow...
... 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 wondering why you forgot her birthday again. this is where signaling comes in. signaling signaling is the process of sending control information between two devices to determine the communication protocols, channels, media codecs and formats, and method of data transfer, as well as any required routing information. the most important thing to know about the signaling process for webrtc: it is not defined in the specification. why, you may wonder, is somethin...
...orking technology and messaging protocol. in particular, if a developer already has a method in place for connecting two devices, it doesn’t make sense for them to have to use another one, defined by the specification, just for webrtc. since webrtc doesn’t live in a vacuum, there is likely other connectivity in play, so it makes sense to avoid having to add additional connection channels for signaling if an existing one can be used. in order to exchange signaling information, you can choose to send json objects back and forth over a websocket connection, or you could use xmpp or sip over an appropriate channel, or you could use xmlhttprequest over https with polling, or any other combination of technologies you can come up with. you could even use email as the signaling channel. it’s al...
...And 9 more matches
RTCPeerConnection.addIceCandidate() - Web APIs
when a web site or app using rtcpeerconnection receives a new ice candidate from the remote peer over its signaling channel, it delivers the newly-received candidate to the browser's ice agent by calling rtcpeerconnection.addicecandidate(). this adds this new remote candidate to the rtcpeerconnection's remote description, which describes the state of the remote end of the connection. if the candidate parameter is missing or a value of null is given when calling addicecandidate(), the added ice candidate is an "end-of-candidates" indicator. the same is the case if the value of the specified object's candidate is either missing or an empty string (""), it signals that all remote candidates have been delivered. the end-of-candidates notification is transmitted to the remote peer using a candidat...
... 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. ...
...tail 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 constructed from a message received over the signaling channel, describing a newly received ice candidate that's ready to be delivered to the local ice agent. ...
...And 8 more matches
Using DTMF with WebRTC - Web APIs
y 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. ...
...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. ...
...lements, 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 rfc 3550: rtp: a transport protocol for real-time applications and rfc 4733: rtp payload for dtmf digits, telephony tones, and telephony signals. the details of how dtmf payloads are handled on rtp are beyond the scope of this article. instead, we'll focus on how to use dtmf within the context of an rtcpeerconnection by studying how an example works. simple example this simple example constructs two rtcpeerconnections, establishes a connection between them, then waits for the user to click a "dial" button. when the button is clicked, a...
...And 7 more matches
RTCPeerConnection.setRemoteDescription() - Web APIs
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 by calling setremotedescription() does not immediately take effect. instead, the current connec...
... details on this process. exceptions the following exceptions are reported to the rejection handler for the promise returned by setremotedescription(): invalidaccesserror the content of the description is invalid. invalidstateerror the rtcpeerconnection is closed, or it's in a state which isn't compatible with the specified description's type. for example, if the type is rollback and the signaling state is one of stable, have-local-pranswer, or have-remote-pranswer, this exception is thrown, because you can't roll back a connection that's either fully established or is in the final stage of becoming connected. operationerror any errors that occur which don't match the others specifeid here are reported as operationerror. this includes identity validation errors. rtcerror an rtcerror...
...y indicates the line number within the sdp on which the syntax error was detected. typeerror the specified rtcsessiondescriptioninit or rtcsessiondescription object is missing the type property, or no description parameter was provided at all. usage notes when you call setremotedescription(), the ice agent checks to make sure the rtcpeerconnection is in either the stable or have-remote-offer signalingstate. these states indicate that either an existing connection is being renegotiated or that an offer previously specified by an earlier call to setremotedescription() is to be replaced with the new offer. in either of those two cases, we're at the beginning of the negotiation process, and the offer is set as the remote description. on the other hand, if we're in the middle of an ongoing nego...
...And 5 more matches
RTCPeerConnection.setLocalDescription() - Web APIs
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. implicit description if you don't explicity provide a session description, the webrtc runtime will try to handle it correctly. if the signaling state is one of stable, have-local-offer, or have-remote-pranswer, the webrtc runtime automatically creates a new offer and sets that as the new local description. otherwise, setlocaldescription() creates an answer, which becomes the new local description. type of the description parameter the description is of type rtcsessiondescriptioninit, which is a serialized version of a rtcsessiondesc...
...y existing code to use the promise-based version of setlocaldescription() instead. the parameters for the older form of setlocaldescription() are described below, to aid in updating existing code. successcallback a javascript function which accepts no input parameters to be be called once the description has been successfully set. at that time, the offer can be sent to a remote peer via the signaling server. errorcallback a function matching the signature rtcpeerconnectionerrorcallback which gets called if the description can't be set. it is passed a single domexception object explaining why the request failed. this deprecated form of the method returns instantaneously without waiting for the actual setting to be done: in case of success, the successcallback will be called; in case o...
.... this deprecated form of the method returns instantaneously without waiting for the actual setting to be done: in case of success, the successcallback will be called; in case of failure, the errorcallback will be called. deprecated exceptions when using the deprecated callback-based version of setlocaldescription(), the following exceptions may occur: invalidstateerror the connection's signalingstate is "closed", indicating that the connection is not currently open, so negotiation cannot take place. invalidsessiondescriptionerror the rtcsessiondescription specified by the sessiondescription parameter is invalid. examples implicit descriptions one of the advantages of the parameter-free form of setlocaldescription() is that it lets you simplify your negotiation code substantial...
...And 4 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 belo...
...ny 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 the kind of media being sent, its format, the transfer protocol being used, the endpoint's ip...
...connection.addtrack() (since addstream is deprecating) the caller calls rtcpeerconnection.createoffer() to create an offer. the caller calls rtcpeerconnection.setlocaldescription() to set that offer as the local description (that is, the description of the local end of the connection). after setlocaldescription(), the caller asks stun servers to generate the ice candidates the caller uses the signaling server to transmit the offer to the intended receiver of the call. the recipient receives the offer and calls rtcpeerconnection.setremotedescription() to record it as the remote description (the description of the other end of the connection). the recipient does any setup it needs to do for its end of the call: capture its local media, and attach each media tracks into the peer connection vi...
...And 4 more matches
Basic concepts behind Web Audio API - Web APIs
te 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 indicates the number of those channels which are reserved for low-frequency effect (lfe) outputs; these are often referred to as subwoofers. each input or output is composed...
...btained in a number of ways: sound can be generated directly in javascript by an audio node (such as an oscillator). created from raw pcm data (the audio context has methods to decode supported audio formats). taken from html media elements (such as <video> or <audio>). taken directly from a webrtc mediastream (such as a webcam or microphone). audio data: what's in a sample when an audio signal is processed, sampling means the conversion of a continuous signal to a discrete signal; or put another way, a continuous sound wave, such as a band playing live, is converted to a sequence of samples (a discrete-time signal) that allow a computer to handle the audio in distinct blocks. a lot more information can be found on the wikipedia page sampling (signal processing). audio buffers: frames...
...l audio, 44,100 hz (alternately represented as 44.1 khz) is a common sampling frequency. why 44.1khz? firstly, because the hearing range of human ears is roughly 20 hz to 20,000 hz. via the nyquist–shannon sampling theorem, the sampling frequency must be greater than twice the maximum frequency one wishes to reproduce. therefore, the sampling rate has to be greater than 40 khz. secondly, signals must be low-pass filtered before sampling, otherwise aliasing occurs. while an ideal low-pass filter would perfectly pass frequencies below 20 khz (without attenuating them) and perfectly cut off frequencies above 20 khz, in practice a transition band is necessary, where frequencies are partly attenuated. the wider this transition band is, the easier and more economical it is to make an anti-ali...
...And 4 more matches
RTCPeerConnection: icecandidate event - Web APIs
an icecandidate event is sent to an rtcpeerconnection when an rtcicecandidate has been identified and added to the local peer by a call to rtcpeerconnection.setlocaldescription(). the event handler should transmit the candidate to the remote peer over the signaling channel so the remote peer can add it to its set of remote candidates. ...
...nterface rtcpeerconnectioniceevent event handler property rtcpeerconnection.onicecandidate description there are three reasons why the icecandidate event is fired on an rtcpeerconnection. sharing a new candidate the majority of icecandidate events are fired to indicate that a new candidate has been gathered. this candidate needs to be delivered to the remote peer over the signaling channel your code manages. rtcpeerconnection.onicecandidate = (event) => { if (event.candidate) { sendcandidatetoremotepeer(event.candidate) } else { /* there are no more candidates coming during this negotiation */ } } the remote peer, upon receiving the candidate, will add the candidate to its candidate pool by calling addicecandidate(), passing in the candidate string you h...
...es. rtcpeerconnection.onicecandidate = (event) => { if (event.candidate) { sendcandidatetoremotepeer(event.candidate) } else { /* there are no more candidates coming during this negotiation */ } } the remote peer, upon receiving the candidate, will add the candidate to its candidate pool by calling addicecandidate(), passing in the candidate string you have passed along using the signaling server. indicating the end of a generation of candidates when an ice negotiation session runs out of candidates to propose for a given rtcicetransport, it has completed gathering for a generation of candidates. that this has occurred is indicated by an icecandidate event whose candidate string is empty (""). you should deliver this to the remote peer just like any standard candidate, as des...
...And 3 more matches
RTCPeerConnection.createOffer() - Web APIs
offer() 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. syntax apromise = mypeerconnection.createoffer([options]); mypeerconnection.createoffer(successcallback, failurecallback, [optio...
... object explaining why the request to create an offer failed. options optional an optional rtcofferoptions dictionary providing options requested for the offer. return value a promise whose fulfillment handler will receive an object conforming to the rtcsessiondescriptioninit dictionary which contains the sdp describing the generated offer. that received offer should be delivered through the signaling server to a remote peer. exceptions these exceptions are returned by rejecting the returned promise. your rejection handler should examine the received exception to determine which occurred. invalidstateerror the rtcpeerconnection is closed. notreadableerror no certificate or set of certificates was provided for securing the connection, and createoffer() was unable to create a new one.
...createoffer() was unable to create a new one. since all webrtc connections are required to be secured, that results in an error. operationerror examining the state of the system to determine resource availability in order to generate the offer failed for some reason. example here we see a handler for the negotiationneeded event which creates the offer and sends it to the remote system over a signaling channel. note: 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-offer" to the other peer. the contents of the object being passed to the sendtoserver() function, along with everything else in t...
...And 2 more matches
Request.cache - Web APIs
Web › API › Request › cache
e */ }); // download a resource with economics in mind! prefer a cached // albeit stale response to conserve as much bandwidth as possible. fetch("some.json", {cache: "force-cache"}) .then(function(response) { /* consume the response */ }); // naive stale-while-revalidate client-level implementation. // prefer a cached albeit stale response; but update if it's too old. ...
...ent-level implementation. // prefer a cached albeit stale response; but update if it's too old. // abortcontroller and signal to allow better memory cleaning. ...
...ation. // prefer a cached albeit stale response; but update if it's too old. // abortcontroller and signal to allow better memory cleaning. ...
...And 2 more matches
WebRTC API - Web APIs
using webrtc 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 connec...
...sport for the rtcdatachannel has been successfully opened or re-opened. selectedcandidatepairchange the currently-selected pair of ice candidates has changed for the rtcicetransport on which the event is fired. track the track event, of type rtctrackevent is sent to an rtcpeerconnection when a new track is added to the connection following the successful negotiation of the media's streaming. signalingstatechange sent to the peer connection when its signalingstate has changed. this happens as a result of a call to either setlocaldescription() or setremotedescription(). statechange the state of the rtcdtlstransport has changed. statechange the state of the rtcicetransport has changed. statechange the state of the rtcsctptransport has changed. types rtcsctptransportstate indicates...
...hat an rtcpeerconnection uses to authenticate. telephony these interfaces and events are related to interactivity with public-switched telephone networks (ptsns). they're primarily used to send tone dialing sounds—or packets representing those tones—across the network to the remote peer. interfaces rtcdtmfsender manages the encoding and transmission of dual-tone multi-frequency (dtmf) signaling for an rtcpeerconnection. rtcdtmftonechangeevent used by the tonechange event to indicate that a dtmf tone has either begun or ended. this event does not bubble (except where otherwise stated) and is not cancelable (except where otherwise stated). events tonechange either a new dtmf tone has begun to play over the connection, or the last tone in the rtcdtmfsender's tonebuffer has been ...
...And 2 more matches
Codecs used by WebRTC - Web media technologies
e video and audio synchronized, so that the movements and any ancillary information (such as slides or a projection) are presented at the same time as the audio that corresponds. general codec requirements before looking at codec-specific capabilities and requirements, there are a few overall requirements that must be met by any codec configuration used with webrtc. unless the sdp specifically signals otherwise, the web browser receiving a webrtc video stream must be able to handle video at at least 20 fps at a minimum resolution of 320 pixels wide by 240 pixels tall. it's encouraged that video be encoded at a frame rate and size no lower than that, since that's essentially the lower bound of what webrtc generally is expected to handle. sdp supports a codec-independent way to specify preferr...
...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 subset of the main profi...
... some special requirement when used. packetization-mode all endpoints are required to support mode 1 (non-interleaved mode). support for other packetization modes is optional, and the parameter itself 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 i...
...And 2 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
tions. it's based on the stream-focused transport layer security (tls), providing a similar level of security. as a datagram protocol, dtls doesn't guarantee the order of message delivery, or even that messages will be delivered at all. however, dtls gains the benefits of datagram protocols, too; in particular, the lower overhead and reduced latency. ...
...ding a similar level of security. as a datagram protocol, dtls doesn't guarantee the order of message delivery, or even that messages will be delivered at all. however, dtls gains the benefits of datagram protocols, too; in particular, the lower overhead and reduced latency. 104 dtmf (dual-tone multi-frequency signaling) dtmf, glossary, webrtc dual-tone multi-frequency (dtmf) signaling is a system by which audible tones are used to represent buttons being pressed on a keypad. frequently referred to in the united states as "touch tone" (after the touch-tone trademark used when the transition from pulse dialing to dtmf began), dtmf makes it possible to signal the digits 0-9 as well as the letters "a" through "d" and the symbols "#" and "*". few telephone keypads include the le...
...sed to represent buttons being pressed on a keypad. frequently referred to in the united states as "touch tone" (after the touch-tone trademark used when the transition from pulse dialing to dtmf began), dtmf makes it possible to signal the digits 0-9 as well as the letters "a" through "d" and the symbols "#" and "*". few telephone keypads include the letters, which are typically used for control signaling by the telephone network. 105 data structure codingscripting, data structure, glossary data structure is a particular way of organizing data so that it can be used efficiently. 106 decryption cryptography, glossary, privacy, security in cryptography, decryption is the conversion of ciphertext into cleartext. 107 delta delta, glossary, di...
...on top of that to further enrich the user experience as the screen size increases. the mobile-first approach contrasts with the older approach of designing for desktop screen sizes first, and then only later adding some support for small screen sizes. 274 modem infrastructure, navigation a modem ("modulator-demodulator") is a device that converts digital information to analog signals and vice-versa, for sending data through networks. 275 modern web apps composing, glossary, modern web apps see progressive web apps 276 modularity codingscripting, glossary the term modularity refers to the degree to which a system's components may be separated and recombined, it is also division of a software package into logical units. the advantage o...
Secure Development Guidelines
tains a race condition the file may change between the call top stat() and open() this opens the possibility of writing arbitrary content to any file race conditions occur when two separate execution flows share a resource and its access is not synchronized properly race condition types include file (previously covered) thread (two threads share a resource but don’t lock it) signal race conditions example char *ptr; void sighandler() { if (ptr) free(ptr); _exit(0); } int main() { signal(sigint, sighandler); ptr = malloc(1000); if (!ptr) exit(0); ... do stuff ... free(ptr); ptr = null; } race conditions previous example is vulnerable to a signal race condition what would happen if the applicati...
...onditions example char *ptr; void sighandler() { if (ptr) free(ptr); _exit(0); } int main() { signal(sigint, sighandler); ptr = malloc(1000); if (!ptr) exit(0); ... do stuff ... ...
...c(1000); if (!ptr) exit(0); ... do stuff ... ...
... free(ptr); ptr = null; } race conditions previous example is vulnerable to a signal race condition what would happen if the application received a signal in the middle of free(ptr)? ...
Allocations - Firefox Developer Tools
ing. it includes the following columns: self count: the number of allocation-samples that were taken in this function (also shown as a percentage of the total) self bytes: the total number of bytes allocated in the allocation-samples in this function (also shown as a percentage of the total) rows are sorted by the "self bytes" column. so in the example above: 8904 samples were taken in signallater(), which is 28.57% of the total number of samples taken those samples allocated 1102888 bytes, which is 30.01% of the total memory allocated in all samples next to each function name is a disclosure arrow. click this to see the places this function was called from: here you can see that signallater() was called from two places: removeinner() and setselectioninner(). in this way you can...
... samples taken only in this function. "total" records samples taken in this function or in functions called by this function. at the top level, these are always the same, since the view presents "leaf" functions at the top level (that is, it presents an inverted view of the call stack). ...
... in this function. "total" records samples taken in this function or in functions called by this function. at the top level, these are always the same, since the view presents "leaf" functions at the top level (that is, it presents an inverted view of the call stack). but if you start walking back up the call stack, you'll see the difference: here, 8904 samples were taken in signallater(). ...
... 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). ...
AbortController.AbortController() - Web APIs
the abortcontroller() constructor creates a new abortcontroller object instance. syntax var controller = new abortcontroller(); parameters none. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. ...
...bject instance. syntax var controller = new abortcontroller(); parameters none. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). ...
...he following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. ...
...ect using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetchvideo); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetchvideo() { ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) ...
RTCIceCandidate.usernameFragment - Web APIs
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 candidates. however, let's imagine that we do need ...
...dates. 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 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 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. ...
...owever, 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. ...
RTCPeerConnection: negotiationneeded event - Web APIs
a negotiationneeded event is sent to the rtcpeerconnection when negotiation of the connection through the signaling channel is required. this occurs both during the initial setup of the connection as well as any time a change to the communication environment requires reconfiguring the connection. bubbles no cancelable no interface event event handler property rtcpeerconnection.onnegotiationneeded the negotiationneeded event is first dispatched to the rtcpeerconnection when media is first added to the connection. ...
...nection. bubbles no cancelable no interface event event handler property rtcpeerconnection.onnegotiationneeded the negotiationneeded event is first dispatched to the rtcpeerconnection when media is first added to the connection. this starts the process of ice negotiation by instructing your code to begin exchanging ice candidates through the signaling server. see signaling transaction flow in signaling and video calling for a description of the signaling process that begins with a negotiationneeded event. examples in this example, we use addeventlistener() to create an event handler for negotiationneeded. its role is to create an sdp offer and send it through the signaling channel to the remote peer. pc.addeventlistener("negotiationneede...
...ling process that begins with a negotiationneeded event. examples in this example, we use addeventlistener() to create an event handler for negotiationneeded. its role is to create an sdp offer and send it through the signaling channel to the remote peer. pc.addeventlistener("negotiationneeded", ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocaldescription(); then a signaling message is created and sent to the remote peer through the signaling server, to share that offer with the other peer. the other peer should recog...
... remote description with setremotedescription(), and then creating an answer to send back to the offering peer. you can also set an event handler for the negotiationneeded event by assigning the event handler function to the rtcpeerconnection.onnegotiationneeded property: pc.onnegotiationneeded = ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }; for a more detailed example, see starting negotiation in signaling and video calling. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'negotiationneeded' in that specification. cand...
Using WebRTC data channels - Web APIs
ying data transport used by the rtcdatachannel 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 pro...
...et datachannel = pc.createdatachannel("myapp channel"); datachannel.addeventlistener("open", (event) => { begintransmission(datachannel); }); manual negotiation to manually negotiate the data channel connection, you need to first create a new rtcdatachannel object using the createdatachannel() method on the rtcpeerconnection, specifying in the options a negotiated property set to true. this signals to the peer connection to not attempt to negotiate the channel on your behalf. then negotiate the connection out-of-band, using a web server or other means. this process should signal to the remote peer that it should create its own rtcdatachannel with the negotiated property also set to true, using the same id. this will link the two objects across the rtcpeerconnection. let datachannel = pc.
... handle them the same way. beyond that, things get more complicated. concerns with large messages currently, it's not practical to use rtcdatachannel for messages larger than 64kib (16kib if you want to support cross-browser exchange of data). the problem arises from the fact that sctp—the protocol used for sending and receiving data on an rtcdatachannel—was originally designed for use as a signaling protocol. it was expected that messages would be relatively small. support for messages larger than the network layer's mtu was added almost as an afterthought, in case signaling messages needed to be larger than the mtu. this feature requires that each piece of the message have consecutive sequence numbers, so they have to be transmitted one after another, without any other data interleaved b...
...y other data interleaved between them. this eventually became a problem. over time, various applications (including those implementing webrtc) began to use sctp to transmit larger and larger messages. eventually it was realized that when the messages become too large, it's possible for the transmission of a large message to block all other data transfers on that data channel—including critical signaling messages. this will become an issue when browsers properly support the current standard for supporting larger messages—the end-of-record (eor) flag that indicates when a message is the last one in a series that should be treated as a single payload. this is implemented in firefox 57, but is not yet implemented in chrome (see chromium bug 7774). with eor support in place, rtcdatachannel payl...
WritableStream.WritableStream() - Web APIs
properties that define how the constructed stream instance will behave. underlyingsink can contain the following: start(controller) optional this is a method, called immediately when the object is constructed. the contents of this method are defined by the developer, and should aim to get access to the underlying sink. if this process is to be done asynchronously, it can return a promise to signal success or failure. the controller parameter passed to this method is a writablestreamdefaultcontroller. this can be used by the developer to control the stream during set up. write(chunk, controller) optional this method, also defined by the developer, will be called when a new chunk of data (specified in the chunk parameter) is ready to be written to the underlying sink. it can return a pro...
... or failure. the controller parameter passed to this method is a writablestreamdefaultcontroller. this can be used by the developer to control the stream during set up. write(chunk, controller) optional this method, also defined by the developer, will be called when a new chunk of data (specified in the chunk parameter) is ready to be written to the underlying sink. it can return a promise to signal success or failure of the write operation. the controller parameter passed to this method is a writablestreamdefaultcontroller that can be used by the developer to control the stream as more chunks are submitted for writing. this method will be called only after previous writes have succeeded, and never after the stream is closed or aborted (see below). close(controller) optional this method,...
... parameter passed to this method is a writablestreamdefaultcontroller that can be used by the developer to control the stream as more chunks are submitted for writing. this method will be called only after previous writes have succeeded, and never after the stream is closed or aborted (see below). close(controller) optional this method, also defined by the developer, will be called if the app signals that it has finished writing chunks to the stream. the contents should do whatever is necessary to finalize writes to the underlying sink, and release access to it. if this process is asynchronous, it can return a promise to signal success or failure. this method will be called only after all queued-up writes have succeeded. the controller parameter passed to this method is a writablestreamdefau...
... process is asynchronous, it can return a promise to signal success or failure. this method will be called only after all queued-up writes have succeeded. the controller parameter passed to this method is a writablestreamdefaultcontroller, which can be used to control the stream at the end of writing. abort(reason) optional this method, also defined by the developer, will be called if the app signals that it wishes to abruptly close the stream and put it in an errored state. it can clean up any held resources, much like close(), but abort() will be called even if writes are queued up — those chunks will be thrown away. if this process is asynchronous, it can return a promise to signal success or failure. the reason parameter contains a domstring describing why the stream was aborted. ...
Using gdb on wimpy computers - Archive of obsolete content
ying" to see the conditions. there is absolutely no warranty for gdb. type "show warranty" for details. this gdb was configured as "i386-redhat-linux"... (gdb) b main breakpoint 1 at 0x804ec45: file nsapprunner.cpp, line 811. (gdb) r starting program: /home/blizzard/src/mozilla/mozilla/dist/bin/./mozilla-bin breakpoint 1, main (argc=1, argv=0xbffff894) at nsapprunner.cpp:811 811 installunixsignalhandlers(argv[0]); (gdb) set auto-solib-add 0 (gdb) c continuing. nsnativecomponentloader: autoregistering begins. [...] it's easy to define a function for gdb to do this for you automatically. you can add this function to the .gdbinit file in your home directory: def prun tbreak main run set auto-solib-add 0 end how do i load shared libraries? if you have turned off auto...
... off automatic shared library loading, you will have to load them when you need them. gdb has a command to load libraries while the program is running. this is the sharedlibrary command. it can be shortened to shar when used in gdb. the argument to the command is a regular expression for the libraries to be loaded. here's what it looks like in the 4.18 version of the debugger: ^c program received signal sigint, interrupt. 0x404ccdeb in __sigsuspend (set=0xbf5ffbc0) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 48 ../sysdeps/unix/sysv/linux/sigsuspend.c: no such file or directory. current language: auto; currently c (gdb) shar glib reading symbols from /usr/lib/libglib-1.2.so.0...done. (gdb) here's what it looks like in a version 5.x of the debugger ( yet unreleased ): ^c program recei...
...int, interrupt. 0x404ccdeb in __sigsuspend (set=0xbf5ffbc0) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 48 ../sysdeps/unix/sysv/linux/sigsuspend.c: no such file or directory. current language: auto; currently c (gdb) shar glib reading symbols from /usr/lib/libglib-1.2.so.0...done. (gdb) here's what it looks like in a version 5.x of the debugger ( yet unreleased ): ^c program received signal sigint, interrupt. [switching to thread 2051 (runnable)] 0x404ccdeb in __sigsuspend (set=0xbf5ffbac) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 48 ../sysdeps/unix/sysv/linux/sigsuspend.c: no such file or directory. current language: auto; currently c (gdb) shar gtk reading symbols from /usr/lib/libgtk-1.2.so.0...done. loaded symbols for /usr/lib/libgtk-1.2.so.0 reading symbols from /...
AbortController - Web APIs
the abortcontroller interface represents a controller object that allows you to abort one or more web requests as and when desired. you can create a new abortcontroller object using the abortcontroller.abortcontroller() constructor. communicating with a dom request is done using an abortsignal object. constructor abortcontroller() creates a new abortcontroller object instance. properties abortcontroller.signal read only returns a abortsignal object instance, which can be used to communicate with/abort a dom request. methods abortcontroller.abort() aborts a dom request before it has completed. this is able to abort fetch requests, consumption of any response body, and streams. examples in the following snippet, we aim to download a video using the fetch api. we f...
...te with/abort a dom request. methods abortcontroller.abort() aborts a dom request before it has completed. this is able to abort fetch requests, consumption of any response body, and streams. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. var controller = new abortcontroller(); ...
...ect using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetchvideo); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetchvideo() { ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) ...
LockManager.request() - Web APIs
available optional: if true, the lock request will only be granted if it is not already held. if it cannot be granted, the callback will be invoked with null instead of a lock instance. the default value is false. steal optional: if true, then any held locks with the same name will be released, and the request will be granted, preempting any queued requests for it. the default value is false. signal optional: an abortsignal (the signal property of an abortcontroller); if specified and the abortcontroller is aborted, the lock request is dropped if it was not already granted. callback … return value a promise that resolves with undefined when the request is granted. examples general example the following example shows the basic use of the request() method with an asynchronous fun...
...nly granted if it was available, this call avoids needing to wait on the lock being released elsehwere. await navigator.locks.request('my_resource', {ifavailable: true}, async lock => { if (!lock) { // the lock was not granted - get out fast. return; } // the lock was granted, and no other running code in this origin is holding // the 'my_res_lock' lock until this returns. ...
...k being released elsehwere. await navigator.locks.request('my_resource', {ifavailable: true}, async lock => { if (!lock) { // the lock was not granted - get out fast. return; } // the lock was granted, and no other running code in this origin is holding // the 'my_res_lock' lock until this returns. }); signal example to only wait for a lock for a short period of time, use the signal option. const controller = new abortcontroller(); // wait at most 200ms. settimeout(() => controller.abort(), 200); try { await navigator.locks.request('my_resource', {signal: controller.signal}, async lock => { // the lock was acquired! }); } catch (ex) { if (ex.name === 'aborterror') { // the request aborted before it could be granted. } } specifications specificat...
MediaSource.endOfStream() - Web APIs
this can be used create a custom error handler related to media streams. for example, you might have a function that handles media chunk requests, separate from other network requests. ...
...this can be used create a custom error handler related to media streams. for example, you might have a function that handles media chunk requests, separate from other network requests. ...
...on that handles media chunk requests, separate from other network requests. when you make an xmlhttprequest call for a media chunk, and onabort or onerror triggers, you might want to call endofstream('network'), display a descriptive message in the ui, and maybe retry the network request immediately or wait until the network is back up (via some kind of polling.) decode: terminates playback and signals that a decoding error has occured. this can be used to indicate that a parsing error has occured while fetching media data; maybe the data is corrupt, or is encoded using a codec that the browser doesn't know how to decode. return value undefined exceptions exception explanation invalidstateerror mediasource.readystate is not equal to open, or one or more of ...
RTCPeerConnection.createAnswer() - Web APIs
ssertion. operationerror generation of the sdp failed for some reason; this is a general failure catch-all exception. return value a promise whose fulfillment handler is called with an object conforming to the rtcsessiondescriptioninit dictionary which contains the sdp answer to be delivered to the other peer. example here is a segment of code taken from the code that goes with the article signaling and video calling. this code comes from the handler for the message sent to carry an offer to another peer across the signaling channel. keep in mind that this is part of the signaling process, the transport layer for which 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"...
...r 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.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 err...
...diaerror); 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 the complete code, in context, from which this snippet is derived; that will help you understand the signaling process and how answers work. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'createanswer()' in that specification. candidate recommendation initial definition.
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. ...
...oose 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. ...
...hose sdp can be found in the event's candidate property, to the remote peer through the signaling server. if the event's candidate property is null, ice gathering has finished. this message should not be sent to the remote peer. when this happens, the connection's icegatheringstate has also changed to complete. 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. example the example below, which is based on the code from the article signaling and video calling, sets up a handler for icecandidate events to send the candidates to the remote peer. pc.onicecandidate = function(event) { if (event.candidate) { // send the...
RTCPeerConnection.restartIce() - Web APIs
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. 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 rem...
...this process continues until an ice restart has been successfully completed. syntax rtcpeerconnection.restartice(); parameters none. return value undefined. ...
...ignalingstate 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 using createoffer() will initiate ice restart once sent to the remote peer over your signaling mechanism. restarting ice essentially resets ice so that it creates all new candidates using new credentials. existing media transmissions continue uninterrupted during this process. for details about how ice restart works, see ice restart in lifetime of a webrtc session and rfc 5245, section 9.1.1.1: ice specification. example this example creates a handler for the iceconnectionstatechange...
WebGL2RenderingContext.clientWaitSync() - Web APIs
the webgl2renderingcontext.clientwaitsync() method of the webgl 2 api blocks and waits for a webglsync object to become signaled or a given timeout to be passed. syntax glenum gl.clientwaitsync(sync, flags, timeout); parameters sync a webglsync object on which to wait on. flags a glbitfield specifying a bitwise combination of flags controlling the flushing behavior. may be gl.sync_flush_commands_bit. timeout a glint64 specifying a timeout (in nanoseconds) for which to wait for the sync object to become signaled. must not be larger than gl.max_client_wait_timeout_webgl. return value a glenum indicating the sync object's status. gl.already_signaled: indicates that the sync object was signaled when this method was called. gl.timeout_expired: indicates that the timeout ...
... gl.wait_failed: indicates that an error occurred during the execution. ...
... gl.wait_failed: indicates that an error occurred during the execution. examples var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); var status = gl.clientwaitsync(sync, 0, 0); specifications specification status comment webgl 2.0the definition of 'clientwaitsync' in that specification. ...
A simple RTCDataChannel sample - Web APIs
ection's rtcpeerconnection.setlocaldescription() method. this configures the local end of the connection. the next step is to connect the local peer to the remote by telling the remote peer about it. this is done by calling remoteconnection.rtcpeerconnection.setremotedescription(). now the remoteconnection knows about the connection that's being built. in a real application, this would require a signaling server to exchange the description object. that means it's time for the remote peer to reply. it does so by calling its createanswer() method. this generates a blob of sdp which describes the connection the remote peer is willing and able to establish. this configuration lies somewhere in the union of options that both peers can support. once the answer has been created, it's passed into the...
...tion lies somewhere in the union of options that both peers can support. once the answer has been created, it's passed into the remoteconnection by calling rtcpeerconnection.setlocaldescription(). that establishes the remote's end of the connection (which, to the remote peer, is its local end. this stuff can be confusing, but you get used to it). again, this would normally be exchanged through a signalling server. finally, the local connection's remote description is set to refer to the remote peer by calling localconnection's rtcpeerconnection.setremotedescription(). the catch() calls a routine that handles any errors that occur. note: once again, this process is not a real-world implementation; in normal usage, there's two chunks of code running on two machines, interacting and negotiati...
...cription is set to refer to the remote peer by calling localconnection's rtcpeerconnection.setremotedescription(). the catch() calls a routine that handles any errors that occur. note: once again, this process is not a real-world implementation; in normal usage, there's two chunks of code running on two machines, interacting and negotiating the connection. a side channel, commonly called a “signalling server,” is usually used to exchange the description (which is in application/sdp form) between the two peers. handling successful peer connection as each side of the peer-to-peer connection is successfully linked up, the corresponding rtcpeerconnection's icecandidate event is fired. these handlers can do whatever's needed, but in this example, all we need to do is update the user interf...
Web Audio API - Web APIs
given audiobuffer, and is often used to achieve a reverb effect. delaynode the delaynode interface represents a delay-line; an audionode audio-processing module that causes a delay between the arrival of an input data and its propagation to the output. dynamicscompressornode the dynamicscompressornode interface provides a compression effect, which lowers the volume of the loudest parts of the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and multiplexed together at once. gainnode the gainnode interface represents a change in volume. it is an audionode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. waveshapernode the waveshapernode interface represents a non-lin...
...ayed and multiplexed together at once. gainnode the gainnode interface represents a change in volume. it is an audionode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. waveshapernode the waveshapernode interface represents a non-linear distorter. it is an audionode that use a curve to apply a waveshaping distortion to the signal. beside obvious distortion effects, it is often used to add a warm feeling to the signal. periodicwave describes a periodic waveform that can be used to shape the output of an oscillatornode. iirfilternode implements a general infinite impulse response (iir) filter; this type of filter can be used to implement tone control devices and graphic equalizers as well. defining audio destinations...
...hannel of the output. audio spatialization these interfaces allow you to add audio spatialization panning effects to your audio sources. audiolistener the audiolistener interface represents the position and orientation of the unique person listening to the audio scene used in audio spatialization. pannernode the pannernode interface represents the position and behavior of an audio source signal in 3d space, allowing you to create complex panning effects. stereopannernode the stereopannernode interface represents a simple stereo panner node that can be used to pan an audio stream left or right. audio processing in javascript using audio worklets, you can define custom audio nodes written in javascript or webassembly. audio worklets implement the worklet interface, a lightweight vers...
Web Accessibility: Understanding Colors and Luminance - Accessibility
ralis) of the back of the eyeball, where the red and green cones tend to cluster. there is software that actually takes advantage of that fact. because we do not perceive the color "blue" as well as other colors, for example, some algorithms for compressing image sizes remove the parts of the image with "blue" in them more heavily than other parts of an image. this fact is also used by televsion signals to allocate less bandwidth to the yellow-blue part of their signal, thus saving bandwidth. another important point to consider is the ambience of light surrounding the color. the color will appear differently if the background lighting is dark, or light. one of the greatest gifts to accessibility now in development is the css media queries level 5. these queries will allow users to choose con...
...hes between red and blue is more problematic than alternating flashes between green and blue. it has been theorized that this is because the "red" sensitive cones of our eyes, which tend to cluster around the fovea (near the center) are physically located at a different location than the "blue" sensitive cones of our eyes, which are located away from the fovea and towards the rims. the electrical signals that go from eye to brain have much to resolve between them as the information is processed in our brains. in the article, certain colors more likely to cause epileptic fits, researchers find, the authors noted that "..complexities underlying brain dynamics could be modulated by certain color combinations more than the other, for example, red-blue flickering stimulus causes larger cortical exci...
...re tools that will do it for you. here are a few. relative luminance calculation. calculate relative luminance analyze luminosity contrast ratio some notes: luma and luminance are not the same. from iec 61966-2-2:2003(en), "video systems approximate the lightness response of vision by computing a luma component y′ as a weighted sum of nonlinear r′g′b′ primary components: each rgb signal is, comparable to the 1/3 power function with an offset defined by l*. luma is often incorrectly referred to as luminance." luminosity and luminance are not the same, but sometimes, in the hsl color spectrum, they are sometimes used interchangably. sometimes the "l" in hsl stands for luminance, and sometimes, for luminosity -- and also, has been referred to as "lightness" luminance and brightn...
Expect-CT - HTTP
can represent, or if any of its subsequent calculations overflows, the cache will consider this value to be either 2,147,483,648 (231) or the greatest positive integer it can represent. report-uri="<uri>" optional the uri where the user agent should report expect-ct failures. ...
...t can represent. report-uri="<uri>" optional the uri where the user agent should report expect-ct failures. when present with the enforce directive, 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 enforcement of certificate transparency for 24 hours and reports violations to foo.example. ...
The "codecs" parameter in common media types - Web media technologies
alue defines the function used to map the gamma (delightfully called the "opto-electrical transfer function" in technical parlance) from the source to the display. for example, 10-bit bt.2020 is 14. the default value is 01 (itu-r bt.709). mc the two-digit matrix_coefficients constant selects the matrix coefficients used to convert the red, blue, and green channels into luma and chroma signals. for example, the standard coefficients used for bt.709 are indicated using the value 01. the default value is 01 (itu-r bt.709). f a one-digit flag indicating whether the color should be allowed to use the full range of possible values (1), or should be constrained to those values considered legal for the specified color configuration (that is, the studio swing representation). the ...
...compressed image characteristics for dcdm. 11 smpte rp 431 (d-cinema quality: reference projector and environment). describes the reference projector and environment conditions that provide a consistent film presentation experience. 12 smpte eg 432 (digital source processing: color processing for d-cinema). engineering guideline making color signal decoding recommendations for digital movies. 13 – 21 reserved for future use by itu-t or iso/iec 22 ebu tech 3213-e 23 – 255 reserved for future use by itu-t or iso/iec tc a two-digit integer indicating the transfercharacteristics for the video. this value is from section 8.2 ...
...icates the transfer characteristics to be used when adapting the decoded color to the render target. mc the two-digit value for the matrixcoefficients property. this value comes from the table in section 8.3 of the iso/iec 23001-8:2016 specification. this value indicates which set of coefficients to use when mapping from the native red, blue, and green primaries to the luma and chroma signals. these coefficients are in turn used with the equations found in that same section. ff indicates whether to restrict the black level and color range of each color component to the legal range. for 8 bit color samples, the legal range is 16-235. a value of 00 indicates that these limitations should be enforced, while a value of 01 allows the full range of possible values for each comp...
Monitoring WiFi access points - Archive of obsolete content
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. ...
...ple</title> <script> var count = 0; function test() { } test.prototype = { onchange: function (accesspoints) { netscape.security.privilegemanager.enableprivilege('universalxpconnect'); var d = document.getelementbyid("d"); d.innerhtml = ""; for (var i=0; i<accesspoints.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.interfac...
Displaying a graphic with audio samples - Archive of obsolete content
nction loadedmetadata() { channels = audio.mozchannels; rate = audio.mozsamplerate; framebufferlength = audio.mozframebufferlength; fft = new fft(framebufferlength / channels, rate); } function audioavailable(event) { var fb = event.framebuffer, t = event.time, /* unused, but it's there */ signal = new float32array(fb.length / channels), magnitude; for (var i = 0, fbl = framebufferlength / 2; i < fbl; i++ ) { // assuming interlaced stereo channels, // need to split and merge into a stero-mix mono signal signal[i] = (fb[2*i] + fb[2*i+1]) / 2; } // clear the canvas before drawing spectrum ctx.fillstyle = "rgb(0,0,0)...
...{ // assuming interlaced stereo channels, // need to split and merge into a stero-mix mono signal signal[i] = (fb[2*i] + fb[2*i+1]) / 2; } // clear the canvas before drawing spectrum ctx.fillstyle = "rgb(0,0,0)"; ctx.fillrect (0,0, canvas.width, canvas.height); ctx.fillstyle = "rgb(255,255,255)"; for (var i = 0; i < signal.length; i++ ) { // multiply spectrum by a zoom value magnitude = signal[i] * 1000; // draw rectangle bars for each frequency bin ctx.fillrect(i * 4, canvas.height, 3, -magnitude); } ctx.drawimage(document.getelementbyid('mozlogo'),0,0, canvas.width, canvas.height); } var audio = document.getelementbyid('audio-element'...
Gecko Profiler FAQ
ce and snapshot the thread you started the itimer on, it interrupts each thread one at a time, which likely means distortion of the measurement if the number of threads monitored is significant (especially at high sample rates). a cleaner snapshot would stop all threads, walk all their stacks, and then resume all threads, especially on high-core systems. (itimer_real (due to posix) requires the signal occur on the calling thread, not a random thread. itimer_prof interrupts the then-running thread, whichever one it is. is there a way to isolate or filter a profile (at least of mainthread and maybe one or two other ones that make sense) to a specific tab/document/eventqueue? currently not. some functions (reflow, painting, js excecution) insert the url of the associated...
...of milliseconds to finish, etc. unless if you profile on windows you will never find those specific issues. and when you get to the platform specific parts of the browser stack (such as graphics, media, etc.) then profiling on windows would be certainly a lot more valuable than on other platforms. should i profile known to be slow sites on slower hardware to get a better signal? [mstange] that’s probably a good idea. as long as the slower hardware is still capable enough that the profiler can successfully complete symbolication. [ehsan] performance issues are just much easier to spot on slower hardware, so if nothing else, using slower hardware will help you find problems easier. and don’t forget that if you’re interested in finding io slo...
Optimizing Applications For NSPR
e primordial thread and the system may not function correctly. on nt, this problem is especially obvious because the idle thread, which is in charge of driving the asynch io completion port, is also blocked. do not call blocking system calls from the primordial thread. create a global thread and call the system call in that thread, and have the primordial thread join that thread. nspr uses timer signals to implement thread preemption for local threads on some platforms. if all the software linked into the application is not ported to the nspr api, the application may fail because of threads being preempted during critical sections. to disable thread preemption call <tt>pr_disableclockinterrupts()</tt>during initialization. interrupting threads (via <tt>pr_interrupt()</tt>) on threads blocked i...
...uspendall()</tt>) which is in preparation for garbage collection. digital unix is the main platform used for nspr's prototype use of ipv6. there are some conflicts between the patches needed to use ipv6 and those needed for pthreads. the ipv6 kit needs to be applied on a baseline configuration of digital unix v4.0b. linux the pthreads version of linux (which is not the default) uses the same signals that nspr uses to suspend threads in preparation for garbage collection. no solution in hand. os/2 the os/2 port is not functional in its current state due to the requirement to remove some files that could not be shipped under the npl. this problem has been resolved and an update will be appearing shortly. original document information author: larryh@netscape.com last updated date: de...
NSS 3.16.2.3 release notes
.2.3 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_16_2_3_rtm/src/ new in nss 3.16.2.3 this patch release fixes a bug and contains a backport of the tls_fallback_scsv feature, which was originally made available in nss 3.17.1. ...
... notable changes in nss 3.16.2.3 bug 1057161: check that an imported elliptic curve public key is valid. previously nss would only validate the peer's public key before performing ecdh key agreement. now ec public keys are validated at import time. ...
NSS 3.17.1 release notes
unctionality and fixes a bug that caused nss to accept forged rsa signatures. a new symbol, _sgn_verifypkcs1digestinfo is exported in this release. as with all exported nss symbols that have a leading underscore '_', this is an internal symbol for nss use only. applications that use or depend on these symbols can and will break in future nss releases. ...
... notable changes in nss 3.17.1 signature algorithms now use sha-256 instead of sha-1 by default. added support for linux on little-endian powerpc64. ...
Enc Dec MAC Output Public Key as CSR
uest with subject */ static secstatus certreq(seckeyprivatekey *privk, seckeypublickey *pubk, keytype keytype, secoidtag hashalgtag, certname *subject, prbool ascii, const char *certreqfilename) { certsubjectpublickeyinfo *spki = null; certcertificaterequest *cr = null; secitem *encoding = null; secoidtag signalgtag; secitem result; secstatus rv = secsuccess; print32 numbytes; void *exthandle; prarenapool *arena = null; prfiledesc *outfile = null; /* open the certificate request file to write */ outfile = pr_open(certreqfilename, pr_create_file | pr...
...e); cert_finishcertificaterequestattributes(cr); /* der encode the request */ encoding = sec_asn1encodeitem(arena, null, cr, sec_asn1_get(cert_certificaterequesttemplate)); if (encoding == null) { pr_fprintf(pr_stderr, "der encoding of request failed\n"); rv = secfailure; goto cleanup; } /* sign the request */ signalgtag = sec_getsignaturealgorithmoidtag(keytype, hashalgtag); if (signalgtag == sec_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
rtreq); } if (subjectcert) { cert_destroycertificate(subjectcert); } return rv; } /* * generate the certificate request with subject */ static secstatus certreq(seckeyprivatekey *privk, seckeypublickey *pubk, keytype keytype, secoidtag hashalgtag, certname *subject, prbool ascii, const char *certreqfilename) { secoidtag signalgtag; secitem result; print32 numbytes; secstatus rv = secsuccess; prarenapool *arena = null; void *exthandle = null; prfiledesc *outfile = null; certsubjectpublickeyinfo *spki = null; certcertificaterequest *cr ...
...inishcertificaterequestattributes(cr); /* der encode the request */ encoding = sec_asn1encodeitem(arena, null, cr, sec_asn1_get(cert_certificaterequesttemplate)); if (encoding == null) { pr_fprintf(pr_stderr, "der encoding of request failed\n"); rv = secfailure; goto cleanup; } /* sign the request */ signalgtag = sec_getsignaturealgorithmoidtag(keytype, hashalgtag); if (signalgtag == sec_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data f...
sample2
ivatekey(*selfsignprivkey); } if (certreq) { cert_destroycertificaterequest(certreq); } if (subjectcert) { cert_destroycertificate(subjectcert); } return rv; } /* * generate the certificate request with subject */ static secstatus certreq(seckeyprivatekey *privk, seckeypublickey *pubk, keytype keytype, secoidtag hashalgtag, certname *subject, prbool ascii, const char *certreqfilename) { secoidtag signalgtag; secitem result; print32 numbytes; secstatus rv = secsuccess; prarenapool *arena = null; void *exthandle = null; prfiledesc *outfile = null; certsubjectpublickeyinfo *spki = null; certcertificaterequest *cr = null; secitem *encoding = null; /* if the certificate request file already exists, delete it */ if (pr_access(certreqfilename, pr_access_exists) == pr_success) { pr_delete(certreqfilenam...
...arena (arena, pr_false); rv = secfailure; goto cleanup; } cert_finishextensions(exthandle); cert_finishcertificaterequestattributes(cr); /* der encode the request */ encoding = sec_asn1encodeitem(arena, null, cr, sec_asn1_get(cert_certificaterequesttemplate)); if (encoding == null) { pr_fprintf(pr_stderr, "der encoding of request failed\n"); rv = secfailure; goto cleanup; } /* sign the request */ signalgtag = sec_getsignaturealgorithmoidtag(keytype, hashalgtag); if (signalgtag == sec_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in specified for...
Hacking Tips
0x00007ffff7fb165a in ?? () (gdb) once you hit the generated breakpoint, you can replace it by a gdb breakpoint to make it conditional, the procedure is to first replace the generated breakpoint by a nop instruction, and to set a breakpoint at the address of the nop. (gdb) x /5i $pc - 1 0x7ffff7fb1659: int3 => 0x7ffff7fb165a: mov 0x28(%rsp),%rax...
...ill watch the expression and run out of watchpoint) rr with emacs within emacs, do m-x gud-gdb and replace the command line with rr replay. when gdb comes up, enter set annot 1 to get it to emit file location information so that emacs will pop up the corresponding source. note that if you reverse-continue over a sigsegv and you're using the standard .gdbinit that sets a catchpoint for that signal, you'll get an additional stop at the catchpoint. just reverse-continue again to continue to your breakpoints or whatever. [hack] replacing one instruction to replace one specific instruction, you can use in visit function of each instruction the jsscript filename in lineno fields as well as the id() of the lir / mir instructions. the jsscript can be obtained from info().script(). bool codege...
Index
Mozilla › Tech › XPCOM › Index
ox 3, interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference calls attention to the download manager's user interface if it's already open. the ui need not be visible to call this function, nor will the ui be made visible. 566 nsidownloadobserver interfaces, interfaces:scriptable, needscontent, xpcom, xpcom interface reference called to signal a download that has completed. 567 nsidownloadprogresslistener interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference to use simply implement this interface in your code, then call nsidownloadmanager.addlistener() to start listening. 568 nsidownloader interfaces, interfaces:scriptable, xpcom, xpcom interface reference ini...
...ble may be retrieved using the getbindingfor() and getbindingobjectfor() methods. 1116 nsixulwindow interfaces, interfaces:scriptable, needscontent, xpcom interface reference an nsixulwindow is created as part of the creation of a top-level chrome window. when the window is destroyed, it will fire a "xul-window-destroyed" notification through the global observer service. this signals the application in case it needs to quit. 1117 nsixmlrpcclient interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference no summary! 1118 nsixmlrpcfault no summary! 1119 nsizipentry interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference no summary! 1120 nsiz...
nsIXFormsModelElement
cedocument(in domstring instanceid); void rebuild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned. return value an nsidomdocument. exceptions thrown domexception if there is no matching instance data. rebuild() signals the xforms processor to rebuild any internal data structures used to track computational dependencies within the given xforms model. void rebuild(); parameters none. recalculate() signals the xforms processor to perform a full recalculation of the given xforms model. note: script invocation is not necessarily equivalent to performing the recalculate action handler. though the script is assumed ...
...n xforms model. note: script invocation is not necessarily equivalent to performing the recalculate action handler. though the script is assumed to have modified instance data prior to invoking recalculate, the dom mutations are not cached. thus, a full recalculation is necessary to ensure the proper changes are effected throughout the xforms model. void recalculate(); parameters none. refresh() signals the xforms processor to perform a full refresh of form controls bound to instance nodes for the given xforms model. void refresh(); parameters none. revalidate() signals the xforms processor to perform a full revalidation of the given xforms model. void revalidate(); parameters none. see also xforms 1.1rec ...
AbortController.abort() - Web APIs
g. a fetch request) before it has completed. this is able to abort fetch requests, consumption of any response body, and streams. syntax controller.abort(); parameters none. return value void. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. var controller = new abortcontroller(); ...
...ect using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetchvideo); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetchvideo() { ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) ...
BaseAudioContext.createDelay() - Web APIs
must be less than 180 seconds, and defaults to 1 second if not specified. returns a delaynode. the default delaynode.delaytime is 0 seconds. example we have created a simple example that allows you to play three different samples on a constant loop — see create-delay (you can also view the source code). ...
...must be less than 180 seconds, and defaults to 1 second if not specified. returns a delaynode. the default delaynode.delaytime is 0 seconds. example we have created a simple example that allows you to play three different samples on a constant loop — see create-delay (you can also view the source code). ...
BaseAudioContext - Web APIs
which can be used to play and manipulate audio data contained within an audiobuffer object. audiobuffers are created using audiocontext.createbuffer or returned by audiocontext.decodeaudiodata when it successfully decodes an audio track. baseaudiocontext.createconstantsource() creates a constantsourcenode object, which is an audio source that continuously outputs a monaural (one-channel) sound signal whose samples all have the same value. baseaudiocontext.createchannelmerger() creates a channelmergernode, which is used to combine channels from multiple audio streams into a single audio stream. baseaudiocontext.createchannelsplitter() creates a channelsplitternode, which is used to access the individual channels of an audio stream and process them separately. baseaudiocontext.createconvol...
...plitter() creates a channelsplitternode, which is used to access the individual channels of an audio stream and process them separately. baseaudiocontext.createconvolver() creates a convolvernode, which can be used to apply convolution effects to your audio graph, for example a reverberation effect. baseaudiocontext.createdelay() creates a delaynode, which is used to delay the incoming audio signal by a certain amount. this node is also useful to create feedback loops in a web audio api graph. baseaudiocontext.createdynamicscompressor() creates a dynamicscompressornode, which can be used to apply acoustic compression to an audio signal. baseaudiocontext.creategain() creates a gainnode, which can be used to control the overall volume of the audio graph. baseaudiocontext.createiirfilter(...
Document.cookie - Web APIs
Web › API › Document › cookie
plicitly states no restrictions will be applied. the cookie will be sent in all requests—both cross-site and same-site. the cookie value string can use encodeuricomponent() to ensure that the string does not contain any commas, semicolons, or whitespace (which are disallowed in cookie values). ...
.... the cookie value string can use encodeuricomponent() to ensure that the string does not contain any commas, semicolons, or whitespace (which are disallowed in cookie values). some user agent implementations support the following cookie prefixes: __secure- signals to the browser that it should only include the cookie in requests transmitted over a secure channel. __host- signals to the browser that in addition to the restriction to only use the cookie from a secure origin, the scope of the cookie is limited to a path attribute passed down by the server. if the server omits the path attribute the "directory" of the request uri is used. it also signals that the domain attribute must not be present, which prevents the cookie from being sent to other domains. for chrome the...
DynamicsCompressorNode.reduction - Web APIs
the range of this value is between -20 and 0 (in db). syntax var myreduction = compressornodeinstance.reduction; value a float. ...
...the range of this value is between -20 and 0 (in db). syntax var myreduction = compressornodeinstance.reduction; value a float. ...
DynamicsCompressorNode - Web APIs
this is often used in musical production and game audio. dynamicscompressornode is an audionode that has exactly one input and one output; it is created using the audiocontext.createdynamicscompressor() method. ...
...ing the range above the threshold where the curve smoothly transitions to the compressed portion. dynamicscompressornode.ratio read only is a k-rate audioparam representing the amount of change, in db, needed in the input for a 1 db change in the output. dynamicscompressornode.reduction read only is a float representing the amount of gain reduction currently applied by the compressor to the signal. dynamicscompressornode.attack read only is a k-rate audioparam representing the amount of time, in seconds, required to reduce the gain by 10 db. dynamicscompressornode.release read only is a k-rate audioparam representing the amount of time, in seconds, required to increase the gain by 10 db. methods no specific methods; inherits methods from its parent, audionode. example the below ...
IDBTransactionSync - Web APIs
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 transaction was created. void abort( ) raises (idbdatabaseexception); exceptions this method can raise an idbdatabaseexception with the following code: non_transient_err if this transaction has al...
... transaction. when this method is called, the browser ignores all the changes performed to the objects of this database since this transaction was created. void abort( ) raises (idbdatabaseexception); exceptions this method can raise an idbdatabaseexception with the following code: non_transient_err if this transaction has already been committed or aborted. commit() call this method to signal that the transaction has completed normally and satisfactorily. when this method is called, the browser durably stores all the changes performed to the objects of the database since this transaction was created. void commit( ) raises (idbdatabaseexception); exceptions this method can raise an idbdatabaseexception with the following codes: non_transient_err if this transaction has already ...
NDEFReader.scan() - Web APIs
Web › API › NDEFReader › scan
ethod of ndefreader interface reads ndef records from compatible nfc devices, e.g., ndef nfc tags. syntax var readerpromise = ndefreader.scan(options); parameters options optional id -- the match pattern for matching each ndefrecord.id. recordtype -- the match pattern for matching each ndefrecord.recordtype. mediatype -- the match pattern for matching each ndefrecord.mediatype. signal -- optional abortsignal that allows to cancell this scan() operation. return value a promise that resolves with undefined immediatelly after scheduling read operations for the 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 ...
... 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
.write(message, options); parameters message the message to be written, either domstring or buffersource or ndefmessageinit. options optional ignoreread -- boolean specifying whether or not to skip reading for the activated reader objects. will be ignored if overwrite is false. overwrite -- boolean specifying whether or not existing record should be overwritten, if such exists. signal -- optional abortsignal that allows to cancell this write operation. return value a promise that resolves with undefined when and if the message transfer is successfully completed. 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 write operation was aborted...
... 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. ...
RTCIceCandidateInit.candidate - Web APIs
tributes are all separated by a single space character, and are in a specific order. ...
...tp" (the number 1 is encoded to this string; 2 becomes "rtcp") protocol = "udp" priority = 2043278322 ip = "192.168.0.56" port = 44323 type = "host" example when a new ice candidate is received by your signaling code from the remote peer, you need to construct the rtcicecandidate object that encapsulates it. this is done in the event handler for the icecandidate event. ...
RTCPeerConnection.addTrack() - Web APIs
syntax rtpsender = rtcpeerconnection.addtrack(track, stream...); parameters track a mediastreamtrack object representing the media track to add to the peer connection. stream... ...
...lling addtrack()). this track's kind is set to match the kind of the track provided as an input parameter. a new rtcrtptransceiver is created and associated with the new sender and receiver. the new transceiver's direction is set to "sendrecv". the new transceiver is added to the rtcpeerconnection's set of transceivers. example this example is drawn from the code presented in the article signaling and video calling and its corresponding sample code. it comes from the handlevideooffermsg() method there, which is called when an offer message is received from the remote peer. var mediaconstraints = { audio: true, // we want an audio track video: true // ...and we want a video track }; var desc = new rtcsessiondescription(sdp); pc.setremotedescription(desc).the...
RTCPeerConnection.canTrickleIceCandidates - Web APIs
-only rtcpeerconnection property cantrickleicecandidates returns a boolean which indicates whether or not the remote peer can accept trickled ice candidates. ice trickling is the process of continuing to send candidates after the initial offer or answer has already been sent to the other peer. this property is only set after having called rtcpeerconnection.setremotedescription(). ideally, your signaling protocol provides a way to detect trickling support, so that you don't need to rely on this property. a webrtc browser will always support trickle ice. if trickling isn't supported, or you aren't able to tell, you can check for a falsy value for this property and then wait until the value of icegatheringstate changes to "completed" before creating and sending the initial offer. that way, the o...
....then(answer => pc.setlocaldescription(answer)) .then(_ => if (pc.cantrickleicecandidates) { return pc.localdescription; } return new promise(r => { pc.addeventlistener('icegatheringstatechange', e => { if (e.target.icegatheringstate === 'complete') { r(pc.localdescription); } }); }); }) .then(answer => sendanswertopeer(answer)) // signaling message .catch(e => handleerror(e)); pc.addeventlistener('icecandidate', e => { if (pc.cantrickleicecandidates) { sendcandidatetopeer(e.candidate); // signaling message } }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.cantrickleicecandidates' in that specification...
RTCPeerConnection: iceconnectionstatechange event - Web APIs
n 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. 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. if ice restart is initiated while in the transie...
...tate transitions as negotiation ends when the negotiation process runs out of candidates to check, the ice connection transitions to one of two states. if no suitable candidates were found, the state transitions to failed. if at least one suitable candidate was successfully identified, the state transitions to completed. the ice layer makes this determination upon receiving the end-of-candidates signal, which is provided by caling addicecandidate() with a candidate whose candidate property is an empty string (""), or by setting the rtcpeerconnection property cantrickleicecandidates to false. examples an event handler for this event can be added using the rtcpeerconnection.oniceconnectionstatechange property or by using addeventlistener() on the rtcpeerconnection. in this example, a handler f...
RTCPeerConnection.onnegotiationneeded - Web APIs
ntax 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. ...
...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 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 ...
ReadableStream.ReadableStream() - Web APIs
ce will behave. underlyingsource can contain the following: start(controller) this is a method, called immediately when the object is constructed. the contents of this method are defined by the developer, and should aim to get access to the stream source, and do anything else required to set up the stream fuctionality. if this process is to be done asynchronously, it can return a promise to signal success or failure. the controller parameter passed to this method is a readablestreamdefaultcontroller or a readablebytestreamcontroller, depending on the value of the type property. this can be used by the developer to control the stream during set up. pull(controller) optional this method, also defined by the developer, will be called repeatedly when the stream's internal queue of chunks i...
... the promise rejects, the stream will become errored. the controller parameter passed to this method is a readablestreamdefaultcontroller or a readablebytestreamcontroller, depending on the value of the type property. this can be used by the developer to control the stream as more chunks are fetched. cancel(reason) optional this method, also defined by the developer, will be called if the app signals that the stream is to be cancelled (e.g. if readablestream.cancel() is called). the contents should do whatever is necessary to release access to the stream source. if this process is asynchronous, it can return a promise to signal success or failure. the reason parameter contains a domstring describing why the stream was cancelled. type optional this property controls what type of readable ...
ReadableStreamDefaultReader.cancel() - Web APIs
the supplied reason argument will be given to the underlying source, which may or may not use it. cancel is used when you've completely finished with the stream and don't need any more data from it, even if there are chunks enqueued waiting to be read. that data is lost after cancel is called, and the stream is not readable any more. to read those chunks still and not completely get rid of the stream, you'd use readablestreamdefaultcontroller.close(). ...
...adablestreamdefaultreader created using getreader(). (this code is based on our simple random stream example). each chunk is read sequentially and output to the ui, until the stream has finished being read, at which point we return out of the recursive function and print the entire stream to another part of the ui. when the stream is done (if (done)), we run reader.cancel() to cancel the stream, signalling that we don't need to use it any more. function fetchstream() { const reader = stream.getreader(); let charsreceived = 0; // read() returns a promise that resolves // when a value has been received reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data. // val...
Streams API concepts - Web APIs
ers. at some point the spec writers hope to add something like a transformstream class to make creating transform streams easier. backpressure an important concept in streams is backpressure — this is the process by which a single stream or a pipe chain regulates the speed of reading/writing. when a stream later in the chain is still busy and isn't yet ready to accept more chunks, it sends a signal backwards through the chain to tell earlier transform streams (or the original source) to slow down delivery as appropriate so that you don't end up with a bottleneck anywhere. to use backpressure in a readablestream, we can ask the controller for the chunk size desired by the consumer by querying the readablestreamdefaultcontroller.desiredsize property on the controller. if it is too low, our ...
... the chunks in a stream that have not yet been processed and finished with are kept track of by an internal queue. in the case of readable streams, these are the chunks that have been enqueued but not yet read in the case of writable streams, these are chunks that have been written but not yet processed by the underlying sink. internal queues employ a queuing strategy, which dictates how to signal backpressure based on the internal queue state. in general, the strategy compares the size of the chunks in the queue to a value called the high water mark, which is the largest total chunk size that the queue can realistically manage. the calculation performed is high water mark - total size of chunks in queue = desired size the desired size is the size of chunks the stream can still accept ...
WaveShaperNode - Web APIs
a waveshapernode always has exactly one input and one output. number of inputs 1 number of outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" constructor waveshapernode() creates a new instance of an waveshapernode object. ...
...nstance of an waveshapernode object. properties inherits properties from its parent, audionode. waveshapernode.curve is a float32array of numbers describing the distortion to apply. waveshapernode.oversample is an enumerated value indicating if oversampling must be used. oversampling is a technique for creating more samples (up-sampling) before applying the distortion effect to the audio signal. methods no specific method; inherits methods from its parent, audionode. example the following example shows basic usage of an audiocontext to create a wave shaper node. for applied examples/information, check out our voice-change-o-matic demo (see app.js for relevant code). note: sigmoid functions are commonly used for distortion curves because of their natural properties. their s-shape,...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
following steps: replace their outgoing audio track with a mediastreamtrack containing hold music. disable the incoming audio track. switch the audio transceiver into send-only mode. this triggers renegotiation of the rtcpeerconnection by sending it a negotiationneeded event, which your code responds to generating an sdp offer using rtcpeerconnection.createoffer and sending it through the signaling server to the remote peer. the audiostream, containing the audio to play instead of the local peer's microphone audio, can come from anywhere. one possibility is to have a hidden <audio> element and use htmlaudioelement.capturestream() to get its audio stream. remote peer on the remote peer, when we receive an sdp offer with the directionality set to "sendonly", we handle it using the holdr...
...sender's track with null, meaning no track. this stops sending audio on the transceiver. set the audio transceiver's direction property to "recvonly", instructing the transceiver to only accept audio and not to send any. the sdp answer is generated and sent using a method called sendanswer(), which generates the answer using createanswer() then sends the resulting sdp to the other peer over the signaling service. deactivating hold mode local peer when the local user clicks the interface widget to disable hold mode, the disablehold() method is called to begin the process of restoring normal functionality. async function disablehold(micstream) { await audiotransceiver.sender.replacetrack(micstream.getaudiotracks()[0]); audiotransceiver.receiver.track.enabled = true; audiotransceiver.d...
Using IIR filters - Web APIs
ave been implemented more recently than some of the more longstanding web audio api features, like biquad filters. the iirfilternode the web audio api now comes with an iirfilternode interface. but what is this and how does it differ from the biquadfilternode we have already? an iir filter is a infinite impulse response filter. it's one of two primary types of filters used in audio and digital signal processing. the other type is fir — finite impulse response filter. there's a really good overview to iif filters and fir filters here. a biquad filter is actually a specific type of infinite impulse response filter. it's a commonly-used type and we already have it as a node in the web audio api. if you choose this node the hard work is done for you. for instance, if you want to filter lower f...
...the two biquad filter nodes you would otherwise need for this. with the iirfilter node it's up to you to set what feedforward and feedback values the filter needs — this determines the characteristics of the filter. the downside is that this involves some complex maths. if you are looking to learn more there's some information about the maths behind iir filters here. this enters the realms of signal processing theory — don't worry if you look at it and feel like it's not for you. if you want to play with the iir filter node and need some values to help along the way, there's a table of already calculated values here; on pages 4 & 5 of the linked pdf the an values refer to the feedforward values and the bn values refer to the feedback. musicdsp.org is also a great resource if you want to r...
Upgrade-Insecure-Requests - HTTP
a vary header can be used so that the site isn't served by caches to clients that don’t support the upgrade mechanism. ...
...a vary header can be used so that the site isn't served by caches to clients that don’t support the upgrade mechanism. ...
HTTP headers - HTTP
Web › HTTP › Headers
ced. when a site enables the expect-ct header, they are requesting that chrome check that any certificate for that site appears in public ct logs. feature-policy provides a mechanism to allow and deny the use of browser features in its own frame, and in iframes that it embeds. strict-transport-security (hsts) force communication using https instead of http. upgrade-insecure-requests sends a signal to the server expressing the client’s preference for an encrypted and authenticated response, and that it can successfully handle the upgrade-insecure-requests directive. x-content-type-options disables mime sniffing and forces browser to use the type given in content-type. x-download-options the x-download-options http header indicates that the browser (internet explorer) should not displa...
... ...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
pt and css can be used to manipulate the picture in the same way you would script regular html. ...
...body').setattribute("class", "invalid"); } </script> </head> <body id="body" style="position:absolute; z-index:0; border:1px solid black; left:5%; top:5%; width:90%; height:90%;"> <form> <fieldset> <legend>html form</legend> <p><label>enter something:</label> <input type="text"> <span id="err">incorrect value!</span></p> <p><input type="button" value="activate!" onclick="signalerror();"></p> </fieldset> </form> <svg viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" style="width:100%; height:100%; position:absolute; top:0; left:0; z-index:-1;"> <lineargradient id="gradient"> <stop class="begin" offset="0%"/> <stop class="end" offset="100%"/> </lineargradient> <rect x="0" y="0" width="100" height="100" style="fill:url(#gradient)" /> <circle...
Implementing the widget - Archive of obsolete content
sages from the widget's content script by toggling its activation state. since we don't have any code to display annotations yet, we just log the right-click events to the console. now from the annotator directory type cfx run. you should see the widget in the add-on bar: left- and right-clicks should produce the appropriate debug output, and a left-click should also change the widget icon to signal that it is active. next we'll add the code to create annotations. ...
Index - Archive of obsolete content
//mit.edu/~firefox/www/maintain...utoconfig.html. for history, i've kept mozilla and netscape chapters, as certain points are complementary to the web-based autoconfig file. 3424 monitoring wifi access points wifi 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. 3425 no proxy for configuration administration, configuration management, guide, needsupdate this document provides a comprehensive discussion of the manual proxy feature "no proxy for:", including configuration issues, testing and bugs. 3426 ...
Visualizing an audio spectrum - Archive of obsolete content
function loadedmetadata() { channels = audio.mozchannels; rate = audio.mozsamplerate; framebufferlength = audio.mozframebufferlength; fft = new fft(framebufferlength / channels, rate); } function audioavailable(event) { var fb = event.framebuffer, t = event.time, /* unused, but it's there */ signal = new float32array(fb.length / channels), magnitude; for (var i = 0, fbl = framebufferlength / 2; i < fbl; i++ ) { // assuming interlaced stereo channels, // need to split and merge into a stero-mix mono signal signal[i] = (fb[2*i] + fb[2*i+1]) / 2; } fft.forward(signal); // clear the canvas before drawing spectrum ...
Introducing the Audio API extension - Archive of obsolete content
e mozaudioavailable event has 2 attributes: framebuffer: framebuffer (i.e., an array) containing decoded audio sample data (i.e., floats) time: timestamp for these samples measured from the start in seconds the framebuffer contains an array of audio samples. it's important to note that the samples are not separated by channels; they are all delivered together. for example, for a two-channel signal: channel1-sample1 channel2-sample1 channel1-sample2 channel2-sample2 channel1-sample3 channel2-sample3. we can extend the previous example to visualize the timestamp and the first two samples in a <div> element: <!doctype html> <html> <head> <title>javascript visualization example</title> </head> <body> <audio id="audio-element" src="revolve.ogg" controls="t...
How to implement a custom XUL query processor component - Archive of obsolete content
essor]), classdescription: "sample xul template query processor", classid: components.id("{282cc4ea-a49c-44fc-81f4-1f03cbb7825f}"), contractid: "@mozilla.org/xul/xul-query-processor;1?name=simpledata", getdatasource: function(adatasources, arootnode, aistrusted, abuilder, ashoulddelaybuilding) { // todo: parse the adatasources variable // for now, ignore everything and let's just signal that we have data return this._data; }, initializeforbuilding: function(adatasource, abuilder, arootnode) { // perform any initialization that can be delayed until the content builder // is ready for us to start }, done: function() { // called when the builder is destroyed to clean up state }, compilequery: function(abuilder, aquery, arefvariable, amembervariable) {...
XUL accessibility guidelines - Archive of obsolete content
ther accessibility considerations. users should be able to reference a complete description of all major functionality of an application. also provide details on how to use long or complex help documentation. alerts provide accessible alerts for presenting important information to the user. use scripting or the notificationbox element to flag alerts. avoid using audio or visual alerts alone to signal urgent events. users who have audio turned down or off and users who are deaf or hard of hearing may not be able to recognize audio only alerts. users with visual disabilities will not be able to observe alerts that are purely visual (unless such alerts are presented in functional text that is accessible to a screen reader). interactive elements avoid small targets, which are difficult to see a...
mozilla.dev.platform FAQ - Archive of obsolete content
applications on a mac must be in an application bundle (foo.app). then unpack the xul app into the mac structure with xulrunner -install-app q: can you build xulrunner with newer (>1.5) features, such as storage? a: xulrunner trunk and 1.8 (but not 1.8.0) build storage by default, and anything can be built with storage if you put in you <tt>mozconfig --enable-storage</tt> q: program received signal exc_bad_instruction, illegal instruction/operand. 0x00016b50 in xre_createappdata () a: when you <tt>--disable-libxul</tt>, the xpcom glue doesn't have information about how to load all the dependent libraries like <tt>libgfx.dylib</tt>. in order to use xr successfully in <tt>--disable-libxul</tt> mode, you have to setup dyld_library_path to include <tt>/library/frameworks/xul.framework/versions/...
NPP_SetWindow - Archive of obsolete content
mac os, this field points to an np_port structure. for windowless plug-ins, it is a platform-specific handle to a drawable. before setting the window parameter to point to a new window, it is a good idea to compare the information about the new window to the previous window (if one existed) to account for any changes. for windowless plugins, npp_setwindow is called with a cliprect of 0,0,0,0 to signal that the plugin is not visible. note: npp_setwindow is useful only for embedded (np_embed) or full-screen (np_full) plug-ins, which are drawn into windows. it is irrelevant for hidden plug-ins. see also npp_handleevent, npwindow, np_port ...
NPP_Write - Archive of obsolete content
deleted after returning from the function, so the plug-in should make a copy of the data it needs to keep. returns the plug-in should return the number of bytes written (consumed by the instance). if the return value is smaller than the size of the buffer, the browser sends the remaining data to the plug-in through subsequent calls to npp_writeready and npp_write. if unsuccessful, the function signals an error by returning a negative value. the browser will destroy the stream by calling npp_destroystream. description the browser calls the npp_write function to deliver the data specified in a previous npp_writeready call to the plug-in. a plug-in must consume at least as many bytes as indicated in the npp_writeready call. after a stream is created by a call to npp_newstream, the browser calls ...
Browser Detection and Cross Browser Support - Archive of obsolete content
mber, e.g. mozilla/version followed by a comment token which gave additional information regarding the operating system being used, etc. since the earliest browser detection techniques were based upon looking for a netscape based browser and only provided customized content to browsers which used the mozilla/version user agent string, other browser vendors standardized on using mozilla/version to signal that they were compatible with a particular netscape version. since other browsers pretended to be netscape browsers and encoded their version information in a non-standard fashion in the user agent comment area, the task of determining which browser was being used became more complicated than it should have been. netscape navigator 2 introduced the ability to run javascript in web browsers. as ...
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
criptable/ ibm developer works has published a good article on xpcom. examples example 1. sample .idl file #include "nsisupports.idl" [scriptable, uuid(bedb0778-2ee0-11d5-9cf8-0060b0fbd8ac)] interface nsitestplugin : nsisupports { void nativemethod(); }; example 2. scriptable instance class #include "nsitestplugin.h" #include "nsiclassinfo.h" // we must implement nsiclassinfo because it signals the // mozilla security manager to allow calls from javascript. // helper class to implement all necessary nsiclassinfo method stubs // and to set flags used by the security system class nsclassinfomixin : public nsiclassinfo { // these flags are used by the dom and security systems to signal that // javascript callers are allowed to call this object's scritable methods. ns_imethod getfla...
Anatomy of a video game - Game development
inners to the modern game development arena understand what is required when building a game and how web standards like javascript lend themselves as tools. experienced game programmers who are new to web development could also benefit, too. present, accept, interpret, calculate, repeat the goal of every video game is to present the user(s) with a situation, accept their input, interpret those signals into actions, and calculate a new situation resulting from those acts. games are constantly looping through these stages, over and over, until some end condition occurs (such as winning, losing, or exiting to go to bed). not surprisingly, this pattern corresponds to how a game engine is programmed. the specifics depend on the game. some games drive this cycle by user input. imagine that you ar...
Efficient animation for web games - Game development
rom off-screen so that it is fully visible on-screen, the browser knows that the related content will end up completely visible to the user and can then pre-render that content. when you animate position with javascript, the browser cannot easily make that same assumption, and so you might end up causing it to draw only the newly-exposed region of content, which may introduce slow-down. there are signals at the beginning and end of animations that allow you to attach javascript callbacks and form a rudimentary form of synchronisation (though there are no guarantees on how promptly these callbacks will happen). speaking of the assumptions that the browser can make, you should avoid causing it to have to re-layout during animations. in this vein, it is worth trying to stick to animating only tran...
Visual typescript game engine - Game development
fix: "failed: address already in use" : netstat -ano | findstr :27017 taskkill /pid typeyourpidhere /f also important "run visual studio code as administrator". - a command for killing all node.js process for window users : taskkill /im node.exe /f networking multimedia communication: websocketserver running on node.js text-based protocol sip (session initiation protocol) used for signalling and controlling multimedia sessions. general networking config: config property defined in constructor from serverconfig class. this.networkdeeplogs = false; this.rtcserverport = 12034; this.rtc3serverport = 12034; this.connectorport = 1234; this.domain = "192.168.0.14"; this.masterserverkey = "multi-platformer-sever1.maximum"; this.protocol = "http"; this.i...
ITU - MDN Web Docs Glossary: Definitions of Web-related terms
the international telecommunication union (itu) is the organization authorized by the united nations to establish standards and rules for telecommunication, including telegraph, radio, telephony and the internet. from defining rules for ensuring transmissions get to where they need to go to and creating the "sos" alert signal used in morse code, the itu has long played a key role in how we use technology to exchange information and ideas. in the internet age, the itu's role of establishing standards for video and audio data formats used for streaming, teleconferencing, and other purposes. for example, the itu and the moving picture experts group (mpeg) worked together to develop and publish, as well as to maintain, the various mpeg specifications, such as mpeg-2 (itu h.262), avc (itu h.
Modem - MDN Web Docs Glossary: Definitions of Web-related terms
a modem ("modulator-demodulator") is a device that converts digital information to analog signals and vice-versa, for sending data through networks. different kinds are used for different networks: dsl modems for telephone wires, wifi modems for short-range wireless radio signals, 3g modems for cellular data towers, and so on. modems are different from routers, but many companies sell modems combined with routers. learn more general knowledge modem on wikipedia ...
RTCP (RTP Control Protocol) - MDN Web Docs Glossary: Definitions of Web-related terms
the rtp control protocol (rtcp) is a partner to the rtp protocol. rtcp is used to provide control and statistical information about an rtp media streaming session. this lets control and statistics packets be separated logically and functionally from the media streaming while using the underlying packet delivery layer to transmit the rtcp signals as well as the rtp and media contents. rtcp periodically transmits control packets to all of an rtp session's participants, using the same mechanism that is being used to transmit the data packets. that underlying protocol handles the multiplexing of the data and control packets and may use separate network ports for each type of packet. learn more general knowledge introduction to the real-time transport protocol rtp control protocol rfc...
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 ...
MDN Web Docs Glossary: Definitions of Web-related terms
t digital certificate distributed denial of service dmz dns doctype document directive 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 a...
Fundamental text and font styling - Learn web development
underline-position: specify the position of underlines set using the text-decoration-line property underline value. text-rendering: try to perform some text rendering optimization. text layout styles: text-indent: specify how much horizontal space should be left before the beginning of the first line of the text content. text-overflow: define how overflowed content that is not displayed is signaled to users. white-space: define how whitespace and associated line breaks inside the element are handled. word-break: specify whether to break lines within words. direction: define the text direction (this depends on the language and usually it's better to let html handle that part as it is tied to the text content.) hyphens: switch on and off hyphenation for supported languages. line-break:...
How do you make sure your website works properly? - Learn web development
ttl=44 time=148.541 ms 64 bytes from 63.245.215.20: icmp_seq=2 ttl=44 time=148.734 ms 64 bytes from 63.245.215.20: icmp_seq=3 ttl=44 time=147.857 ms ^c --- mozilla.org ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 147.857/148.468/148.741/0.362 ms just keep in mind a handy keyboard shortcut: ctrl+c. ctrl+c sends an “interrupt” signal to the runtime and tells it to stop. if you don't stop the runtime, ping will ping the server indefinitely. a simple checklist check for 404s make sure all webpages are behaving as you expect check your website in several browsers to make sure it renders consistently next steps congratulations, your website is up and running for anyone to visit. that's a huge achievement. now, you can s...
How does the Internet work? - Learn web development
tworks 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 arrives at the right destination computer. to send a message to computer b, computer a must send the message to the router, which in turn forwards the message to computer b and makes sure the message is not delivered to computer c. once we add a router to the system, our network of 10 computers only requires 10 cable...
UI pseudo-classes - Learn web development
rder: 1px solid black; } input:optional { border: 1px solid silver; } the required controls would have a black border, and the optional control will have a silver border, like so: you can also try submitting the form without filling it in, to see the client-side validation error messages browsers give you by default. the above form isn't bad, but it isn't great either. for a start, we are signalling required versus optional status using color alone, which isn't great for colorblind people. second, the standard convention on the web for required status is an asterisk (*), or the word "required" being associated with the controls in question. in the next section, we'll look at a better example of indicating required fields using :required, which also digs into using generated content. n...
Graceful asynchronous programming with Promises - Learn web development
f the camera stream hasn't been obtained yet. even if the handlecallbutton() function has already returned to the code that called it, when getusermedia() has finished working, it calls the handler you provide. as long as the app doesn't assume that streaming has begun, it can just keep on running. note: you can learn more about this somewhat advanced topic, if you're interested, in the article signaling and video calling. code similar to this, but much more complete, is used in that example. the trouble with callbacks to fully understand why promises are a good thing, it helps to think back to old-style callbacks and to appreciate why they are problematic. let's talk about ordering pizza as an analogy. there are certain steps that you have to take for your order to be successful, which do...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
true; } if (isover) { document.removeeventlistener('keydown', keyhandler); settimeout(reset, 5000); } }; } stepping through this: first, cancel the spinner animation with cancelanimationframe() (it is always good to clean up unneeded processes), and hide the spinner container. next, display the results paragraph and set its text content to "players go!!" to signal to the players that they can now press their button to win. attach a keydown event listener to the document. when any button is pressed down, the keyhandler() function is run. inside keyhandler(), the code includes the event object as a parameter (represented by e) — its key property contains the key that was just pressed, and you can use this to respond to specific key presses with speci...
Introduction to events - Learn web development
basic understanding of html and css, javascript first steps. objective: to understand the fundamental theory of events, how they work in browsers, and how events may differ in different programming environments. a series of fortunate events as mentioned above, events are actions or occurrences that happen in the system you are programming — the system produces (or "fires") a signal of some kind when an event occurs, and provides a mechanism by which an action can be automatically taken (that is, some code running) when the event occurs. for example, in an airport, when the runway is clear for take off, a signal is communicated to the pilot. as a result, the plane can safely takeoff. in the case of the web, events are fired inside the browser window, and tend to be attach...
Client-side storage - Learn web development
self that will respond to the installation. let's look at an example, in the sw.js file (the service worker). you'll see that the install listener is registered against self. this self keyword is a way to refer to the global scope of the service worker from inside the service worker file. inside the install handler we use the extendableevent.waituntil() method, available on the event object, to signal that the browser shouldn't complete installation of the service worker until after the promise inside it has fulfilled successfully. here is where we see the cache api in action. we use the cachestorage.open() method to open a new cache object in which responses can be stored (similar to an indexeddb object store). this promise fulfills with a cache object representing the video-store cache. we ...
Getting started with React - Learn web development
g in our app. suppose we wanted to wrap our heading in a <header> tag, for semantic reasons? the jsx approach allows us to nest our elements within each other, just like we do with html: const header = ( <header> <h1>mozilla developer network</h1> </header> ); note: the parentheses in the previous snippet aren't unique to jsx, and don’t have any effect on your application. they're a signal to you (and your computer) that the multiple lines of code inside are part of the same expression. you could just as well write the header expression like this: const header = <header> <h1>mozilla developer network</h1> </header> however, this looks kind of awkward, because the <header> tag that starts the expression is not indented to the same position as its corresponding closing tag. o...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
dev/repl/76cc90c43a37452e8c7f70521f88b698?version=3.23.2 working on the moreactions component now we'll tackle the check all and remove completed buttons. let's create a component that will be in charge of displaying the buttons and emitting the corresponding events. create a new file — components/moreactions.svelte. when the first button is clicked, we'll emit a checkall event to signal that all the todos should be checked/unchecked. when the second button is clicked, we'll emit a removecompleted event to signal that all of the completed todos should be removed. put the following content into your moreactions.svelte file: <script> import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher() let completed = true const checkall = () => { ...
Vue conditional rendering: editing existing todos - Learn web development
is is a useful way to help reinforce everything you've learned so far. this code sets up the core of the edit functionality. we create a form with an <input> field for editing the name of our to-do. there is a "save" button and a "cancel" button: when the "save" button is clicked, the component emits the new label via an item-edited event. when the "cancel" button is clicked, the component signals this by emitting an edit-cancelled event. modifying our todoitem component before we can add todoitemeditform to our app, we need to make a few modifications to our todoitem component. specifically, we need to add a variable to track if the item is being edited, and a button to toggle that variable. we’ll also add a delete button since deletion is closely related. update your todoitem’s ...
Introduction to automated testing - Learn web development
evice and browser you want to test on — platforms in the left column, devices on the right. when you mouse over or click on each device, you get a choice of browsers available on that device. clicking on one of those browser icons will load up your choice of platform/device/browser — choose one now, and give it a try. note: the blue device icon next to some of the mobile device choices signals that you will be testing on a real device; choices without that icon will be run on an emulator. you'll find that you can enter urls into the address bar, and use the other controls like you'd expect on a real device. you can even do things like copy and paste from the device to your clipboard, scroll up and down by dragging with the mouse, or use appropriate gestures (e.g. pinch/zoom, two fin...
Deploying our app - Learn web development
cel's view of our system — since parcel never sees nor runs any of the test code, we're left to install the dependency ourselves. now to manually run the test, from the command line we can run: npm run test the result, if successful, is … nothing. this is considered a success. in general we only want tests to be noisy if there's something wrong. the test also exited with a special signal that tells the command line that it was successful — an exit signal of 0. if there's a failure the test fails with an exit code of 1 — this is a system-level value that says "something failed". the npm run test command will use node to run all the files that are in the tests directory that end with .js. in our build script, npm run test is called, then you see the string && — this mea...
Accessibility API cross-reference
t'. aria attribute keeps it 'perceivable'. ...
Mozilla accessibility architecture
hem. we fire the safer event_reorder in their place.. to see what parts of the accessibility cache need to be invalidated. however, we are careful not to do this work for mutation events fired because the document is still loading. currently (as of may 2003), we do not yet use domattrmodied to listen to attribute changes on a node. we need to listen to some attribute changes because they might signal the need to invalidate parts of our cache; for example, if the name or href attribute on an anchor element changes, or the usemap attribute of an img changes. these cases are not very likely, but we should try to think of real-world scenarios where it might happen. if we do this, the code would go into nsdocaccessible::attrmodified(). unique 32-bit identifiers in msaa in msaa, we must hand out a ...
Multiprocess on Windows
rapping the array element. mlengthparamindex is the index of the out parameter that contains the length of the array (excluding the this pointer). the interceptor needs to be able to read this parameter to know how many interface pointers exist in the array. mflag may currently be set to one of two values: arraydata::flag::enone or arraydata::flag::eallocatedbyserver. setting eallocatedbyserver signals to the interceptor that the array is allocated within the method's implementation by calling cotaskmemalloc(). using the interceptor in a11y code unlike the built in com marshaling schemes, we must explicitly wrap any com objects that we want to expose, through the mta with interceptors. the function call to wrap a com object is mozilla::mscom::mainthreadhandoff::wrapinterface(). this receive...
Creating JavaScript callbacks in components
nt in c++ and javascript. a common pattern used with interfaces to create a bi-directional communication between two groups of code is the observer (or listener) pattern. basically, the component defines an observer (or listener) interface which is implemented by some external code and this implementation is passed to the component. the component can then call methods on the observer interface to signal the external code when predefined events occur. here is a very simple example of the observer pattern: [scriptable, uuid(...)] interface stringparserobserver { void onword(string word); }; [scriptable, uuid(...)] interface stringparser { void parse(string data); void addobserver(stringparserobserver observer); }; in this example, the stringparser will call the stringparserobserver.onword...
Makefiles - Best practices and suggestions
cles and can contribute to circular dependencies. directory dependencies do not use directories as a dependency for generated targets, ever. any activity within a directory will alter inodes forcing targets to always be stale. for ex, individual unit tests would invalidate all prior test activity whenever a test touched a timestamp file in the directory to signal success. parallel make: add an explicit timestamp dependency (.done) that make can synchronize threaded calls on to avoid a race condition. # transient directory for storing timestamps ts=.ts ##################################################### ## extra dep needed to synchronize parallel execution ##################################################### $(ts): $(ts)/...
Storage access policy: Block cookies from trackers
not be tracked. we expect that this version of click-through conversion will no longer work. you run an ad that appears on a social media website. a user clicks on your advertisement and is taken to a landing page that contains a conversion tracking tag from the third-party network. on the social media website, the network annotates the advertisement landing page url with a query parameter that signals that the visit was the result of a click on an advertisement. on your website, the display network’s tag checks the url query parameters and saves any ad tracking parameters to first-party storage. if a user later completes a conversion event, the network’s tag checks first-party storage to determine which click (or clicks) was responsible for the visit. we expect that click-through conversi...
IPDL Tutorial
upted 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 or rpc messages currently active will return false no further messages will be accepted (c++ methods will return false) each ipdl actor will receive an onerror message deallocpsubproto...
UpdateListener
each individual update check, the following methods will be called on the listener: either oncompatibilityupdateavailable() or onnocompatibilityupdateavailable(), depending on whether compatibility information for the requested application version was seen. either onupdateavailable() or onnoupdateavailable(), depending on whether a newer version of the addon was found. onupdatefinished() to signal that the update check has completed. method overview void oncompatibilityupdateavailable(in addon addon) void onnocompatibilityupdateavailable(in addon addon) void onupdateavailable(in addon addon, in addoninstall install) void onnoupdateavailable(in addon addon) void onupdatefinished(in addon addon, in integer error) methods oncompatibility...
DMD
nimize); this will dump memory reports and dmd output to the temporary directory. identifier is a string that will be used for part of the filename (or a timestamp will be used if it is an empty string); anonymize is a boolean that indicates if the memory reports should be anonymized; and minimize is a boolean that indicates if memory usage should be minimized first. (linux only) you can send signal 34 to the firefox process, e.g. with the following command. $ killall -34 firefox each one of these steps triggers all the memory reporters and then dmd analyzes the reports, printing commentary like this: dmd[5222] opened /tmp/dmd-1414556492-5222.json.gz for writing dmd[5222] dump 1 { dmd[5222] constructing the heap block list... dmd[5222] constructing the stack trace table... dmd[522...
Introduction to NSPR
on between a condition and a monitor is established when a condition variable is created, and the association persists for the life of the condition variable. in addition, a static association exists between the condition and some data within the monitor. this data is what will be manipulated by the program under the protection of the monitor. a thread may wait on notification of a condition that signals changes in the state of the associated data. other threads may notify the condition when changes occur. condition variables are always monitored. the relevant operations on conditions are always performed from within the monitor. they are used to communicate changes in the state of the monitored data (though still preserving the monitored invariant). condition variables allow one or more thread...
PR_BlockClockInterrupts
blocks the timer signal used for preemptive scheduling. syntax #include <prinit.h> void pr_blockclockinterrupts(void); ...
PR_DisableClockInterrupts
disables timer signals used for preemptive scheduling. syntax #include <prinit.h> void pr_disableclockinterrupts(void); ...
PR_Initialize
f an array of strings that compromise the program's argument vector. this approach conforms to standard c programming practice. maxptds this parameter is ignored. returns the value returned from the root function, prmain. description pr_initialize initializes the nspr runtime and places nspr between the caller and the runtime library. this allows main to be treated like any other function, signaling its completion by returning and allowing the runtime to coordinate the completion of the other threads of the runtime. pr_initialize does not return to its caller until all user threads have terminated. the priority of the main (or primordial) thread is pr_priority_normal. the thread may adjust its own priority by using pr_setthreadpriority. ...
PR_Notify
ify(prmonitor *mon); parameters the function has the following parameter: mon a reference to an existing structure of type prmonitor. the monitor object referenced must be one for which the calling thread currently holds the lock. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. description notification of a monitor signals the change of state of some monitored data. the changing of that data and the notification must all be performed while in the monitor. when the notification occurs, the runtime promotes a thread that is waiting on the monitor to a ready state. if more than one thread is waiting, the selection of which thread gets promoted cannot be determined in advance. this implies that all threads waiting on ...
PR_NotifyCondVar
returns the function returns one of the following values: if successful, pr_success. if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable), pr_failure. description the calling thread must hold the lock that protects the condition, as well as the invariants that are tightly bound to the condition. notification of a condition variable signals a change of state in some monitored data. when the notification occurs, the runtime promotes a thread that is waiting on the condition variable to a ready state. if more than one thread is waiting, the selection of which thread gets promoted cannot be predicted. this implies that all threads waiting on a single condition variable must have the same semantics. if no thread is waiting on the condi...
PR_UnblockClockInterrupts
unblocks the timer signal used for preemptive scheduling. syntax #include <prinit.h> void pr_unblockclockinterrupts(void); ...
NSS 3.49 release notes
built by default when using gyp builds. see bug 1594933 for details. bugs fixed in nss 3.49 bug 1513586 - set downgrade sentinel for client tls versions lower than 1.2. ...
FOSS
atabases, compression, email, etc. http://code.google.com/p/gpsee/ - commonjs platform, native-language module interoperability methods, modules, etc. for spidermonkey. designed to supplement existing embeddings, gpsee ships with a sample trivial embedding, a scripting host, and an augmented version of mozilla's js shell. bundled modules include support for bytearray, bytestring, cgi, posix signals, ffi, and more. http://javalikescript.free.fr/ - a general-purpose javascript platform that aims to provide an extensible tooling framework http://www.synchro.net/ - a telnet/ssh bulletin board system (bbs) and internet server (http/smtp/ftp) with extra internet services written in javascript (irc, imap, gopher, and many more) https://github.com/mindbit/libjssql/wiki - a librar...
SpiderMonkey Internals
monkey converts primitive values to objects before invoking their methods, per ecma 262-3 §11.2.1.) error handling spidermonkey has two interdependent error-handling systems: javascript exceptions (which are not implemented with, or even compatible with, any kind of native c/c++ exception handling) and error reporting. in general, both functions inside spidermonkey and jsapi callback functions signal errors by calling js_reporterror or one of its variants, or js_setpendingexception, and returning js_false or null. public apis the public c/c++ interface, called the jsapi, is in most places a thin (but source-compatible across versions) layer over the implementation. see the jsapi user guide. there is an additional public api for javascript debuggers, jsdbgapi, but js/jsd/jsdebug.h might be a...
JSAPI Cookbook
urning a floating-point number // javascript return 3.14159; /* jsapi */ js::callargs args = js::callargsfromvp(argc, vp); args.rval().setdouble(3.14159); exception handling throw the most common idiom is to create a new error object and throw that. js_reporterror does this. note that javascript exceptions are not the same thing as c++ exceptions. the jsapi code also has to return false to signal failure to the caller. // javascript throw new error("failed to grow " + varietal + ": too many greenflies."); /* jsapi */ js_reporterror(cx, "failed to grow %s: too many greenflies.", varietal); return false; to internationalize your error messages, and to throw other error types, such as syntaxerror or typeerror, use js_reporterrornumber instead. javascript also supports throwing any valu...
JS_GetPrototype
ieve the prototype. protop js::mutablehandleobject out parameter. if successful, receives prototype object of obj. description js_getprototype retrieves the prototype of a specified object, obj. a prototype object provides properties inherited by similar js objects. this is the equivalent of object.getprototypeof(obj) from javascript. if js_getprototype returns false, that signals an exception, which should be handled as usual. otherwise, it stores a pointer to the prototype or null to *protop and returns true. to set an object's prototype, use js_setprototype. see also mxr id search for js_getprototype js_setprototype ...
Animated PNG graphics
Mozilla › Tech › APNG
actl fctl and adat are now copy safe, renamed them to actl, fctl and adat from 0.6 the fdat chunk is no longer a container for other chunks, but rather a replacement for an idat chunk removed the fend chunk added a sequence number field to fdat reintroduced the width and height fields in fctl from 0.7 removed hidden flag, instead only the first frame can be hidden and it is signaled with a missing fctl idat, fctl and fdat are no longer required to have no other chunks in between them from 0.8 removed crcs for ihdr and plte from actl the actl fctl and adat are now not copy safe, renamed them to actl, fctl and adat from 0.9 split render_op into dispose_op and blend_op from 0.10 no changes test encoder and sample images sample images are available fr...
Components.returnCode
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 values. components.returncode exists in order to make it possible to implement these rare interfaces in javascript. example var foo = { bar: function(i) { if (yada_yada) components.returncode = 5; return i * 2; } }; ...
imgIDecoderObserver
quest arequest, in imgicontainer acontainer ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. acontainer missing description onstopdecode() in theory a decode notification, but currently a load notification. ideally this would be called when the decode is complete. unfortunately, this is currently the only way to signal decoding errors to consumers, and the only decoding errors that consumers care about (indeed, the only ones that they're prepared to hear about) are failures to instantiate the decoder (<img src="foo.html"> for example). thus, currently this is just a companion to onstoprequest to signal success or failure. you probably want onstopcontainer instead. this will be revisited in bug 505385. if you're...
nsIAppShellService
; parameters acmdlineservice the command line from which startup args can be read. enterlastwindowclosingsurvivalarea() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) during application startup (and at other times!) we may temporarily encounter a situation where all application windows will be closed but we do not want to take this as a signal to quit the application. bracket the code where the last window could close with these. (and at application startup, on platforms that do not normally quit when the last window has closed, call enter once, but not exit) void enterlastwindowclosingsurvivalarea(); parameters none. exitlastwindowclosingsurvivalarea() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / sea...
nsIAppStartup
indow exists after creating the startup state. if one has not been made, this will create a browser window. void ensure1window( in nsicmdlineservice acmdlineservice ); parameters acmdlineservice the command line from which startup args can be read. enterlastwindowclosingsurvivalarea() serves for situations when all application windows will be closed but we don't want to take this as a signal to quit the application. bracket the code where the last window could close with these. void enterlastwindowclosingsurvivalarea(); parameters none. exitlastwindowclosingsurvivalarea() this method serves for situations when all application windows will be closed but we don't want to take this as a signal to quit the application. bracket the code where the last window could close with these. ...
nsIDownloadObserver
netwerk/base/public/nsidownloader.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void ondownloadcomplete(in nsidownloader downloader, in nsirequest request, in nsisupports ctxt, in nsresult status, in nsifile result); methods ondownloadcomplete() called to signal a download that has completed. void ondownloadcomplete( in nsidownloader downloader, in nsirequest request, in nsisupports ctxt, in nsresult status, in nsifile result ); parameters downloader request ctxt status result ...
nsISmsRequestManager
void notifysmsdeleted(in long arequestid, in bool adeleted); void notifysmsdeletefailed(in long arequestid, in long aerror); void notifysmssendfailed(in long arequestid, in long aerror); void notifysmssent(in long arequestid, in nsidommozsmsmessage amessage); constants all sms related errors that could apply to smsrequest objects. constant value description success_no_error 0 no_signal_error 1 not_found_error 2 unknown_error 3 internal_error 4 methods addrequest() track an already existing request object. long addrequest( in nsidommozsmsrequest arequest ); parameters arequest an smsrequest. return value the request id. createrequest() create a new request object. long createrequest( in nsidommozsmsmanager amanager, out nsidommozsmsrequest arequest ); ...
nsIThreadObserver
d is allowed to block the calling thread. this parameter will be false during thread shutdown. recursiondepth the number of calls to nsithread.processnextevent() on the call stack in addition to the current call. ...
nsIWifiAccessPoint
's mac address. this string is in the format "xx-xx-xx-xx-xx-xx". read only. rawssid acstring the public name of the wireless network, as an ascii string. this string is null if not available. read only. note: this string consists of the bytes as received from the network and may contain nulls and other unprintable characters; if you need to display the ssid, use the ssid attribute instead. signal long the current signal strength in dbm. read only. ssid astring the access point's public wireless network name, as an ascii string. this string is null if not available. read only. note: this is a conversion of the ssid into a "displayable" string. for comparisons, you should instead use the rawssid attribute. see also monitoring wifi access points nsiwifimonitor nsiwifilistener ...
nsIXULRuntime
read only. constants process type constants constant value description process_type_default 0 the default (chrome) process. process_type_plugin 1 a plugin subprocess. process_type_content 2 a content subprocess. process_type_ipdlunittest 3 ipdl unit testing subprocess. methods invalidatecachesonrestart() signal the apprunner to invalidate caches on the next restart. this will cause components to be auto registered and all fast load data to be re-created. void invalidatecachesonrestart(); parameters none. example display the user's operating system in an alert box: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixul...
nsIXULWindow
xpfe/appshell/nsixulwindow.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) an nsixulwindow is created as part of the creation of a top-level chrome window. when the window is destroyed, it will fire a "xul-window-destroyed" notification through the global observer service. this signals the application in case it needs to quit. method overview void addchildwindow(in nsixulwindow achild); void applychromeflags(); native code only! void assumechromeflagsarefrozen(); void center(in nsixulwindow arelative, in boolean ascreen, in boolean aalert); nsixulwindow createnewwindow(in print32 achromeflags, in nsiappshell aappshell); n...
Setting HTTP request headers
rrectly added the x- in front of our name.) no longer the case: http://tools.ietf.org/html/rfc6648 notifications the question that may be coming to your mind right now is, how do you get the nsihttpchannel when an http request is made. in the case your code initiates the request, you probably already have one. trapping other requests is done with notifications, which are a lot like events or signals found in other languages and frameworks. in particular, to get the nsihttpchannel just before the http request is made we need to observe the "http-on-modify-request" topic. (and yes, "http-on-modify-request" is a string.) note: there are many topics, besides just "http-on-modify-request", that you can get notifications about, for example "http-on-examine-response" and "xpcom-shutdown". you ca...
Weak reference
flawed, as it holds the observer in existence longer than would otherwise be necessary. the observer may only need a short life compared to the thing being observed. it might go away after the first interesting event, even. but in this design, by hitching its life to the observable, it is kept on life-support long past any need or use. what is actually needed in this case, is either out-of-band signaling, where when the observer wants to go away, it unregisters itself from the observable, which then releases its owning reference, allowing the observer to die, or else a new kind of reference. this document describes an implementation ofweak references. a weak reference does not hold its referent in existence, but also will not dangle. when the referent is destroyed, the weak reference automatic...
WebIDL bindings
ngs: the actual webidl file and a configuration file that lists some metadata about how the webidl should be reflected into gecko-internal code. all webidl files should be placed in dom/webidl and added to the list in the moz.build file in that directory. note that if you're adding new interfaces, then the test at dom/tests/mochitest/general/test_interfaces.html will most likely fail. this is a signal that you need to get a review from a dom peer. resist the urge to just add your interfaces to the moz.build list without the review; it will just annoy the dom peers and they'll make you get the review anyway. the configuration file, dom/bindings/bindings.conf, is basically a python dict that maps interface names to information about the interface, called a descriptor. there are all sorts of pos...
Mozilla
. a common pattern used with interfaces to create a bi-directional communication between two groups of code is the observer (or listener) pattern. basically, the component defines an observer (or listener) interface which is implemented by some external code and this implementation is passed to the component. the component can then call methods on the observer interface to signal the external code when predefined events occur. here is a very simple example of the observer pattern: creating mozsearch plugins firefox 2 uses a simplified form of the opensearch format for storing search plugins. a mozsearch search plugin is an xml file that describes the search engine, its url, and the parameters that need...
Drawing and Event Handling - Plugins
the page. the width and height fields specify the dimensions of the plug-in area. these values should not be modified by the plug-in. the cliprect field defines the clipping rectangle of the plug-in in a coordinate system where the origin is the top-left corner of the drawable or window. the browser calls npp_setwindow whenever the drawable changes. for windowless plugins, a cliprect of 0,0,0,0 signals that the plugin is not visible. the type field indicates the npwindow type of the target area: npwindowtypewindow: windowed plug-in. the window field holds a platform-specific handle to a window. npwindowtypedrawable: windowless plug-in. the window field holds a platform-specific handle to a drawable, as follows: windows: hdc mac os: pointer to np_port structure. unix/x11: not u...
Inspecting web sockets - Firefox Developer Tools
ore columns by choosing which ones to show from the context menu that is opened by right-clicking in the table header. expanding each message selecting a message in the list shows a preview of the data being sent in that message, at the bottom of the response pane. supported ws protocols the inspector currently supports the following web socket protocols: plain json socket.io sockjs signalr wamp the payload based on those protocols is parsed and displayed as an expandable tree for easy inspection, although you can of course still see the raw data (as sent over the wire) as well. ...
Waterfall - Firefox Developer Tools
, if you animate an element using the transform property, the browser will use a separate layer for the transformed element, and doesn't even have to repaint when the element is moved: the new position of the element is handled in composition. the animating css properties article shows how animating different css properties can give different performance outcomes, and how the waterfall can help signal that. blocking javascript by default, a site's javascript is executed in the same thread that the browser uses for layout updates, repaints, dom events, and so on. this means that long-running javascript functions can cause unresponsiveness (jank): animations may not be smooth, or the site might even freeze. using the frame rate tool and the waterfall together, it's easy to see when long-runni...
AudioParam - Web APIs
dio-related parameter, usually a parameter of an audionode (such as gainnode.gain). an audioparam can be set to a specific value or a change in value, and can be scheduled to happen at a specific time and following a specific pattern. there are two kinds of audioparam, a-rate and k-rate parameters: an a-rate audioparam takes the current audio parameter value for each sample frame of the audio signal. a k-rate audioparam uses the same initial audio parameter value for the whole block processed, that is 128 sample frames. in other words, the same value applies to every frame in the audio as it's processed by the node. each audionode defines which of its parameters are a-rate or k-rate in the spec. each audioparam has a list of events, initially empty, that define when and how values change...
BaseAudioContext.createConstantSource() - Web APIs
syntax var constantsourcenode = audiocontext.createconstantsource() parameters none. returns a constantsourcenode instance. specifications specification status comment web audio apithe definition of 'createconstantsource()' in that specification. working draft initial definition. ...
BaseAudioContext.createDynamicsCompressor() - Web APIs
the createdynamicscompressor() method of the baseaudiocontext interface is used to create a dynamicscompressornode, which can be used to apply compression to an audio signal. compression lowers the volume of the loudest parts of the signal and raises the volume of the softest parts. overall, a louder, richer, and fuller sound can be achieved. it is especially important in games and musical applications where large numbers of individual sounds are played simultaneously, where you want to control the overall signal level and help avoid clipping (distorting) of the audio output. syntax baseaudioctx.createdynamicscompressor(); returns a dynamicscompressornode. example the below code demonstrates a simple usage of createdynamicscompressor() to add compression to an audio track. for a more c...
ChannelMergerNode - Web APIs
has one single output, but as many inputs as there are channels to merge; the number of inputs is defined as a parameter of its constructor and the call to audiocontext.createchannelmerger. in the case that no value is given, it will default to 6. using a channelmergernode, it is possible to create outputs with more channels than the rendering hardware is able to process. in that case, when the signal is sent to the audiocontext.listener object, supernumerary channels will be ignored. number of inputs variable; default to 6. number of outputs 1 channel count mode "max" channel count 2 (not used in the default count mode) channel interpretation "speakers" constructor channelmergernode() creates a new channelmergernode objec...
Clipboard - Web APIs
Web › API › Clipboard
ges) from the clipboard, returning a promise. when the data has been retrieved, the promise is resolved with a datatransfer object that provides the data. readtext() requests text from the system clipboard; returns a promise which is resolved with a domstring containing the clipboard's text once it's available. write() writes arbitrary data to the system clipboard. this asynchronous operation signals that it's finished by resolving the returned promise. writetext() writes text to the system clipboard, returning a promise which is resolved once the text is fully copied into the clipboard. clipboard availability the asynchronous clipboard api is a relatively recent addition, and the process of implementing it in browsers is not yet complete. due to both potential security concerns and tec...
CredentialsContainer.get() - Web APIs
for. publickey: an publickeycredentialrequestoptions object containing requirements for returned webauthn credentials. mediation: a string indicating whether the user will be required to log on for every visit to the website. valid values are "silent", "optional", or "required". unmediated: a boolean indicating the returned credential instance should not require user mediation. signal: an instance of abortsignal that can indicate that an ongoing get() operation should be halted. an aborted operation may complete normally (generally if the abort was received after the operation finished) or reject with an "aborterror" domexception. returns a promise that resolves with a credential instance that matches the provided parameters. if a single credential cannot be unambigious...
DynamicsCompressorNode() - Web APIs
that can occur when multiple sounds are played and multiplexed together at once. syntax var dynamicscompressornode = new dynamicscompressornode(context, options) parameters context a reference to an audiocontext. options optional options are as follows: attack: the amount of time (in seconds) to reduce the gain by 10db. its default value is 0.003. this parameter is k-rate. ...
DynamicsCompressorNode.attack - Web APIs
the attack property's default value is 0.003 and it can be set between 0 and 1. syntax var audioctx = new audiocontext(); var compressor = audioctx.createdynamicscompressor(); compressor.attack.value = 0; value an audioparam. note: though the audioparam returned is read-only, the value it represents is not. ...
DynamicsCompressorNode.release - Web APIs
the release property's default value is 0.25 and it can be set between 0 and 1. syntax var audioctx = new audiocontext(); var compressor = audioctx.createdynamicscompressor(); compressor.release.value = 0.25; value an audioparam. note: though the audioparam returned is read-only, the value it represents is not. ...
Fetch API - Web APIs
Web › API › Fetch API
targetting older versions of these browsers, be sure to include credentials: 'same-origin' init option on all api requests that may be affected by cookies/user login state. note: find out more about using the fetch api features in using fetch, and study concepts in fetch basic concepts. aborting a fetch browsers have started to add experimental support for the abortcontroller and abortsignal interfaces (aka the abort api), which allow operations like fetch and xhr to be aborted if they have not already completed. see the interface pages for more details. fetch interfaces windoworworkerglobalscope.fetch() the fetch() method used to fetch a resource. headers represents response/request headers, allowing you to query them and take different actions depending on the results. requ...
Gamepad API - Web APIs
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. ...
Key Values - Web APIs
ext menu. typically found between the windows (or os) key and the control key on the right side of the keyboard. vk_apps (0x5d) kvk_pc_contextmenu (0x6e) gdk_key_menu (0xff67) qt::key_menu (0x01000055) keycode_menu (82) "escape" [2] the esc (escape) key. typically used as an exit, cancel, or "escape this operation" button. historically, the escape character was used to signal the start of a special control sequence of characters called an "escape sequence." vk_escape (0x1b) kvk_escape (0x35) gdk_key_escape (0xff1b) qt::key_escape (0x01000000) keycode_escape (111) "execute" the execute key. vk_execute (0x2b) qt::key_execute (0x01020003) "find" the find key. opens an interface (typically a dialog box) for performing ...
MediaKeySession.closed - Web APIs
this promise can only be fulfilled and is never rejected. closing a session means that licenses and keys associated with it are no longer valid for decrypting media data. syntax var promise = mediakeysessionobj.closed; value a promise. ...
MediaKeySession - Web APIs
this promise can only be fulfilled and is never rejected. closing a session means that licenses and keys associated with it are no longer valid for decrypting media data. ...
MediaSource - Web APIs
ceopen the event handler for the sourceopen event. methods inherits methods from its parent interface, eventtarget. mediasource.addsourcebuffer() creates a new sourcebuffer of the given mime type and adds it to the mediasource.sourcebuffers list. mediasource.clearliveseekablerange() clears a seekable range previously set with a call to setliveseekablerange(). mediasource.endofstream() signals the end of the stream. mediasource.removesourcebuffer() removes the given sourcebuffer from the mediasource.sourcebuffers list. mediasource.setliveseekablerange() sets the range that the user can seek to in the media element. static methods mediasource.istypesupported() returns a boolean value indicating if the given mime type is supported by the current user agent — this is, if it c...
Media Capture and Streams API (Media Stream) - Web APIs
s and usage the api is based on the manipulation of a mediastream object representing a flux of audio- or video-related data. see an example in get the video. a mediastream consists of zero or more mediastreamtrack objects, representing various audio or video tracks. each mediastreamtrack may have one or more channels. the channel represents the smallest unit of a media stream, such as an audio signal associated with a given speaker, like 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 netwo...
Online and offline events - Web APIs
references 'online/offline events' section from the whatwg web applications 1.0 specification the bug tracking online/offline events implementation in firefox and a follow-up a simple test case an explanation of online/offline events ...
OscillatorNode.type - Web APIs
ral common waveforms available, as well as an option to specify a custom waveform shape. the shape of the waveform will affect the tone that is produced. syntax oscillatornode.type = type; value a domstring specifying the shape of oscillator wave. the different available values are: sine a sine wave. this is the default value. square a square wave with a duty cycle of 0.5; that is, the signal is "high" for half of each period. sawtooth a sawtooth wave. triangle a triangle wave. custom a custom waveform. you never set type to custom manually; instead, use the setperiodicwave() method to provide the data representing the waveform. doing so automatically sets the type to custom. exceptions invalidstateerror the value custom was specified. to set a custom waveform, just call s...
PannerNode - Web APIs
it is an audionode audio-processing module describing its position with right-hand cartesian coordinates, its movement using a velocity vector and its directionality using a directionality cone. ...
PaymentResponse - Web APIs
is only present when the requestshipping option is set to true in the options parameter of the paymentrequest() constructor. methods paymentresponse.retry() secure context if something is wrong with the payment response's data (and there is a recoverable error), this method allows a merchant to request that the user retry the payment. the method takes an object as argument, which is used to signal to the user exactly what is wrong with the payment response so they can try to correct any issues. paymentresponse.complete() secure context notifies the user agent that the user interaction is over. this causes any remaining user interface to be closed. this method should only be called after the promise returned by the paymentrequest.show() method. events listen to this event using addev...
Using the Payment Request API - Web APIs
play = 'none'; successpanel.style.display = 'block'; }); }) this object provides the developer with access to details they can use to complete the logical steps required after the payment completes, such as an email address to contact the customer, a shipping address for mailing goods out to them, etc. in the code above, you'll see that we've called the paymentresponse.complete() method to signal that the interaction has finished — you'd use this to carry out finishing steps, like updating the user interface to tell the user the transaction is complete, etc. other useful payment request methods there are some other useful payment request methods worth knowing about. paymentrequest.canmakepayment() can be used to check whether the paymentrequest object is capable of making a payment b...
Multi-touch interaction - Web APIs
state must be cached, in case this down event is part of a multi-touch interaction. in this application, when a pointer is placed down on an element, the background color of the element changes, depending on the number of active touch points the element has. see the update_background function for more details about the color changes. function pointerdown_handler(ev) { // the pointerdown event signals the start of a touch interaction. // save this event for later processing (this could be part of a // multi-touch interaction) and update the background color push_event(ev); if (logevents) log("pointerdown: name = " + ev.target.id, ev); update_background(ev); } pointer move the pointermove handler is called when the pointer moves. it may be called multiple times (for example, if the use...
Pinch zoom gestures - Web APIs
pointerup_handler; el.onpointerleave = pointerup_handler; } pointer down the pointerdown event is fired when a pointer (mouse, pen/stylus or touch point on a touchscreen) makes contact with the contact surface. in this application, the event's state must be cached in case this down event is part of a two-pointer pinch/zoom gesture. function pointerdown_handler(ev) { // the pointerdown event signals the start of a touch interaction. // this event is cached to support 2-finger gestures evcache.push(ev); log("pointerdown", ev); } pointer move the pointermove event handler detects if a user is invoking a two-pointer pinch/zoom gesture. if two pointers are down, and the distance between the pointers is increasing (signifying a pinch out or zoom in), the element's background color is chang...
RTCDataChannel.id - Web APIs
Web › API › RTCDataChannel › id
e 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 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 recomme...
RTCDataChannel.negotiated - Web APIs
annel.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.negotiated) { shutdownremotechannel(datachannel.id); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.negotiated' in that specification. candidate recommendation initial specification. ...
RTCErrorEvent - Web APIs
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.candidate - Web APIs
function handlenewicecandidate(candidatesdp) { var candidateobj = 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, w...
RTCIceCandidate - Web APIs
this string to verify generations of ice generation; each generation of the same ice process will use the same usernamefragment, even across ice restarts. methods tojson() given the rtcicecandidate's current configuration, tojson() returns a domstring containing a json representation of that configuration in the form of a rtcicecandidateinit object. examples for examples, see the article signaling and video calling, which demonstrates the entire process. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate' in that specification. candidate recommendation initial definition. ...
RTCIceTransport.getLocalParameters() - Web APIs
syntax parameters = rtcicetransport.getlocalparameters(); parameters none. ...
RTCIceTransport.getRemoteCandidates() - Web APIs
syntax remotecandidates = rtcicetransport.getremotecandidates(); parameters none. ...
RTCIceTransport.getRemoteParameters() - Web APIs
syntax parameters = rtcicetransport.getremoteparameters(); parameters none. ...
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.mediadevice...
RTCPeerConnection.close() - Web APIs
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. 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. example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); dc.onmessage = fun...
RTCPeerConnection.connectionState - Web APIs
ompleted". "disconnected" at least one of the ice transports for the connection is in the "disconnected" state and none of the other transports are in the state "failed", "connecting", or "checking". "failed" one or more of the ice transports on the connection is in the "failed" state. "closed" the rtcpeerconnection is closed. this value was in the rtcsignalingstate enum (and therefore found by reading the value of the signalingstate) property until the may 13, 2016 draft of the specification. example var pc = new rtcpeerconnection(configuration); /* ... */ var connectionstate = pc.connectionstate; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition...
RTCPeerConnection.getIdentityAssertion() - Web APIs
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. ...
RTCPeerConnection.onaddstream - Web APIs
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 video source for a <video> element to the stream specified in the event, and then enabling a "hang up" button in the app's user interface. pc.onaddstream = function(event) { document.getelementbyid("received_video").srcobject = event.stream; document.getelementbyid("hangup-button").disabled = false; }; you can also us...
RTCPeerConnection.ontrack - Web APIs
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 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 sr...
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 d...
RTCPeerConnection.removeStream() - Web APIs
the rtcpeerconnection.removestream() method removes a mediastream as a local source of audio or video. if 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. if the signalingstate is set to "stable", the event negotiationneeded is sent on the rtcpeerconnection. syntax rtcpeerconnection.removestream(mediastream); parameters mediastream a mediastream specifying the stream to remove from the connection. return value undefined. example var pc, videostream; navigator.getusermedia({video: true}, function(stream) { pc = new r...
RTCPeerConnection.removeTrack() - Web APIs
rconnection.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 connection. re...
RTCPeerConnection.setConfiguration() - Web APIs
this is then passed into setconfiguration(). ice negotiation is restarted by calling createoffer(), specifying true as the value of the icerestart option. from there, we handle the process as usual, by setting the local description to the returned offer an...
RTCPeerConnection.setIdentityProvider() - Web APIs
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. ...
RTCSessionDescription - Web APIs
scription doesn't inherit any methods. rtcsessiondescription() this constructor returns a new rtcsessiondescription. the parameter is a rtcsessiondescriptioninit dictionary containing the values to assign the two properties. rtcsessiondescription.tojson() returns a json description of the object. the values of both properties, type and sdp, are contained in the generated json. ...
ReadableStream.pipeThrough() - Web APIs
ected with the source’s error, or with any error that occurs during canceling the source. in addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. in this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. signal: if set to an abortsignal object, ongoing pipe operations can then be aborted via the corresponding abortcontroller. return value the readable side of the transformstream. exceptions typeerror the writable and/or readable property of transformstream are undefined. examples in the following example (see unpack chunks of a png for the full code running live, and png-transform-stream ...
ReadableStream.pipeTo() - Web APIs
ected with the source’s error, or with any error that occurs during canceling the source. in addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. in this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. signal: if set to an abortsignal object, ongoing pipe operations can then be aborted via the corresponding abortcontroller. return value a promise that resolves when the piping process has completed. exceptions typeerror the writablestream and/or readablestream objects are not a writable stream/readable stream, or one or both of the streams are locked. examples // fetch the original image...
ReadableStream - Web APIs
etch api offers a concrete instance of a readablestream through the body property of a response object. constructor readablestream() creates and returns a readable stream object from the given handlers. properties readablestream.locked read only the locked getter returns whether or not the readable stream is locked to a reader. methods readablestream.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer. the supplied reason argument will be given to the underlying source, which may or may not use it. readablestream.getiterator() creates a readablestream async iterator instance and locks the stream to it. while the stream is locked, no other reader can be acquired until this one is released. readablestream.getreader() creates a reader an...
ReadableStreamBYOBReader.cancel() - Web APIs
the supplied reason parameter will be given to the underlying source, which may or may not use it. note: if the reader is active, the cancel() method behaves the same as that for the associated stream (readablestream.cancel()). syntax var promise = readablestreambyobreader.cancel(reason); parameters reason a domstring providing a human-readable reason for the cancellation. return value a promise, which fulfills with the value given in the reason parameter. ...
ReadableStreamBYOBReader - Web APIs
r() creates and returns a readablestreambyobreader object instance. properties readablestreambyobreader.closed read only allows you to write code that responds to an end to the streaming process. returns a promise that fulfills if the stream becomes closed or the reader's lock is released, or rejects if the stream errors. methods readablestreambyobreader.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer. the supplied reason argument will be given to the underlying source, which may or may not use it. readablestreambyobreader.read() returns a promise providing access to the next chunk in the stream's internal queue. readablestreambyobreader.releaselock() releases the reader's lock on the stream. examples tbd. specifications speci...
ReadableStreamDefaultReader - Web APIs
tes and returns a readablestreamdefaultreader object instance. properties readablestreamdefaultreader.closed read only allows you to write code that responds to an end to the streaming process. returns a promise that fulfills if the stream becomes closed or the reader's lock is released, or rejects if the stream errors. methods readablestreamdefaultreader.cancel() cancels the stream, signaling a loss of interest in the stream by a consumer. the supplied reason argument will be given to the underlying source, which may or may not use it. readablestreamdefaultreader.read() returns a promise providing access to the next chunk in the stream's internal queue. readablestreamdefaultreader.releaselock() releases the reader's lock on the stream. examples in the following example, an a...
StorageManager.estimate() - Web APIs
storageestimate.quota, as well as how much is currently used in storageestimate.usage. the returned values are not exact; between compression, deduplication, and obfuscation for security reasons, they will be imprecise. you may find that the quota varies from origin to origin. this variance is based on factors such as: how often the user visits public site popularity data user engagement signals like bookmarking, adding to homescreen, or accepting push notifications example in this example, we obtain the usage estimates and present the percentage of storage capacity currently used to the user. html content <label> you’re currently using about <output id="percent"> </output>% of your available storage. </label> javascript content navigator.storage.estimate().then(function(e...
Using readable streams - Web APIs
od, you should include code that sets up the stream functionality, e.g. beginning generation of data or otherwise getting access to the source. pull(controller) — a method that, when included, is called repeatedly until the stream’s internal queue is full. this can be used to control the stream as more chunks are enqueued. cancel() — a method that, when included, will be called if the app signals that the stream is to be cancelled (e.g. if readablestream.cancel() is called). the contents should do whatever is necessary to release access to the stream source. type and autoallocatechunksize — these are used — when included — to signify that the stream is to be a bytestream. bytestreams will be covered separately in a future tutorial, as they are somewhat different in purpose and use...
Using writable streams - Web APIs
tely after the writablestream is constructed. inside this method, you should include code that sets up the stream functionality, e.g. getting access to the underlying sink. write(chunk,controller) — a method that is called repeatedly every time a new chunk is ready to be written to the underlying sink (specified in the chunk parameter). close(controller) — a method that is called if the app signals that it has finished writing chunks to the stream. it should do whatever is necessary to finalize writes to the underlying sink, and release access to it. abort(reason) — a method that will be called if the app signals that it wishes to abruptly close the stream and put it in an errored state. the constructor call in our example looks like this: const decoder = new textdecoder("utf-8"); co...
WaveShaperNode.WaveShaperNode() - Web APIs
api creates a new waveshapernode object which is an audionode that represents a non-linear distorter. syntax var waveshapernode = new waveshapernode(context, options) parameters inherits parameters from the audionodeoptions dictionary. context a reference to an audiocontext. options optional options are as follows: curve: the shaping curve used for the waveshaping effect. the input signal is nominally within the range [-1;1]. oversample: specifies what type of oversampling (if any) should be used when applying the shaping curve. valid values are 'none', '2x', or '4x'. the default is 'none'. return value a new waveshapernode object instance. specifications specification status comment web audio apithe definition of 'waveshapernode()' in that speci...
WaveShaperNode.curve - Web APIs
the curve property of the waveshapernode interface is a float32array of numbers describing the distortion to apply. the mid-element of the array is applied to any signal value of 0, the first one to signal values of -1, and the last to signal values of 1; values lower than -1 or greater than 1 are treated like -1 or 1 respectively. if necessary, intermediate values of the distortion curve are linearly interpolated. note: the array can be a null value: in that case, no distortion is applied to the input signal. syntax var audioctx = new audiocontext(); var distortion = audioctx.createwaveshaper(); distortion.curve = mycurvedataarray; // mycurvedataarray is a float32array value a float32array. example the following example shows basic usage of an audiocontext to create a wave shaper n...
WaveShaperNode.oversample - Web APIs
once applied, the number of samples is reduced to its initial numbers. this leads to better results by avoiding some aliasing, but comes at the expense of a lower precision shaping curve. the possible oversample values are: value effect 'none' do not perform any oversampling. ...
WebGL2RenderingContext.fenceSync() - Web APIs
must be gl.sync_gpu_commands_complete. flags a glbitfield specifying a bitwise combination of flags controlling the behavior of the sync object. ...
WebGL2RenderingContext.getSyncParameter() - Web APIs
api returns parameter information of a webglsync object. syntax any gl.getsyncparameter(sync, pname); parameters sync a webglsync object. pname a glenum specifying which information to return. possible values: gl.object_type: returns a glenum indicating the type of the sync object (always gl.sync_fence). gl.sync_status: returns a glenum indicating the status of the sync object (gl.signaled or gl.unsignaled). gl.sync_condition: returns a glenum indicating the sync objects' condition (always gl.sync_gpu_commands_complete). gl.sync_flags: returns a glenum indicating the flags with which the sync object was created (always 0 as no flags are supported). return value depends on the pname parameter, either a glenum or a glbitfield. examples var sync = gl.fencesync(gl.sync_g...
WebGL2RenderingContext.waitSync() - Web APIs
the method is a no-op in the absence of the possibility of synchronizing between multiple gl contexts. syntax void gl.waitsync(sync, flags, timeout); parameters sync a webglsync object on which to wait on. flags a glbitfield specifying a bitwise combination of flags controlling the flushing behavior. must be 0 (exists for extensions only). timeout a glint64 specifying a timeout the server should wait before continuing. must be gl.timeout_ignored. ...
WebGL2RenderingContext - Web APIs
rmation. sync objects webgl2renderingcontext.fencesync() creates a new webglsync object and inserts it into the gl command stream. webgl2renderingcontext.issync() returns true if the passed object is a valid webglsync object. webgl2renderingcontext.deletesync() deletes a given webglsync object. webgl2renderingcontext.clientwaitsync() blocks and waits for a webglsync object to become signaled or a given timeout to be passed. webgl2renderingcontext.waitsync() returns immediately, but waits on the gl server until the given webglsync object is signaled. webgl2renderingcontext.getsyncparameter() returns parameter information of a webglsync object. transform feedback webgl2renderingcontext.createtransformfeedback() creates and initializes webgltransformfeedback objects. webg...
WebGL constants - Web APIs
r 0x8a44 uniform_block_referenced_by_fragment_shader 0x8a46 sync objects constant name value description object_type 0x9112 sync_condition 0x9113 sync_status 0x9114 sync_flags 0x9115 sync_fence 0x9116 sync_gpu_commands_complete 0x9117 unsignaled 0x9118 signaled 0x9119 already_signaled 0x911a timeout_expired 0x911b condition_satisfied 0x911c wait_failed 0x911d sync_flush_commands_bit 0x00000001 miscellaneous constants constant name value description color 0x1800 depth 0x180...
The WebSocket API (WebSockets) - Web APIs
ebsocket 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 & server library for node.js. jsonrpc-bidirectional: asynchronous rpc which, on a singl...
Rendering and the WebXR frame animation callback - Web APIs
t of the world in front of it, and from a slightly different angle. the left eye sees the die from a little bit to the left of center, and the right eye sees it from a bit to the right of center. as a result, the left eye sees just a little bit more of the left side of the object and a little bit less of the right, and vice versa. these two images are focused onto the retinas and the resulting signal transmitted over the optic nerves to the brain's visual cortex, located at the back of the occipital lobe. tha brain takes those signals from the left and right eyes and constructs a single, unified, 3d image of the world in the viewer's brain, and that image is what is seen. and because of those differences between what is seen by the left eye versus the right eye, the brain is able to infer a ...
Starting up and shutting down a WebXR session - Web APIs
ys returns an xrsystem from the polyfill const xr = getxr("if-needed"); // use the polyfill only if navigator.xr missing the returned xrsystem object can then be used according to the documentation provided here on mdn. the global variable webxrpolyfill is used only to retain a reference to the polyfill in order to ensure that it remains available until you no longer need it. setting it to null signals that the polyfill can be garbage collected when no objects depending on it are using it anymore. of course, you can simplify this depending on your needs; since your app is probably not going to go back and forth much on whether or not to use the polyfill, you can simplify this to just the specific case you need. permissions and security there are a number of security measures in place revolv...
Advanced techniques: Creating and sequencing audio - Web APIs
// get data // fill the buffer with noise for (let i = 0; i < buffersize; i++) { data[i] = math.random() * 2 - 1; } note: why -1 to 1? when outputting sound to a file or speakers we need to have a number to represent 0db full scale — the numerical limit of the fixed point media or dac. in floating point audio, 1 is a convenient number to map to "full scale" for mathematical operations on signals, so oscillators, noise generators and other sound sources typically output bipolar signals in the range -1 to 1. a browser will clamp values outside this range. creating a buffer source now we have the audio buffer and have filled it with data, we need a node to add to our graph that can use the buffer as a source. we'll create a audiobuffersourcenode for this, and pass in the data we've crea...
Web Audio API best practices - Web APIs
() method. user control if your website or application contains sound, you should allow the user control over it, otherwise again, it will become annoying. this can be achieved by play/stop and volume/mute controls. the using the web audio api tutorial goes over how to do this. if you have buttons that switch audio on and off, using the aria role="switch" attribute on them is a good option for signalling to assistive technology what the button's exact purpose is, and therefore making the app more accessible. there's a demo of how to use it here. as you work with a lot of changing values within the web audio api and will want to provide users with control over these, the range input is often a good choice of control to use. it's a good option as you can set minimum and maximum values, as well...
Web Locks API - Web APIs
released. }); // the lock has been released. await do_something_else_without_lock(); options several options can be passed when requesting a lock: mode: the default mode is "exclusive", but "shared" can be specified. there can be only one "exclusive" holder of a lock, but multiple "shared" requests can be granted at the same time. this can be used to implement the readers-writer pattern. signal: an abortsignal can be passed in, allowing a lock request to be aborted. this can be used to implement a timeout on requests. ifavailable: if specified, the lock request will fail if the lock cannot be granted immediately without waiting. the callback is invoked with null. monitoring the navigator.locks.query() method can be used by scripts to introspect the state of the lock manager for the ...
WindowOrWorkerGlobalScope.fetch() - Web APIs
igin, strict-origin, origin-when-cross-origin, strict-origin-when-cross-origin, or unsafe-url. integrity contains the subresource integrity value of the request (e.g., sha256-bpfbw7ivv8q2jlit13fxdyae2tjllusrsz273h2nfse=). keepalive the keepalive option can be used to allow the request to outlive the page. fetch with the keepalive flag is a replacement for the navigator.sendbeacon() api. signal an abortsignal object instance; allows you to communicate with a fetch request and abort it if desired via an abortcontroller. return value a promise that resolves to a response object. exceptions aborterror the request was aborted due to a call to the abortcontroller method abort() method. typeerror the specified url string includes user credentials. this information should inste...
WritableStream.abort() - Web APIs
syntax var promise = writablestream.abort(reason); parameters reason a domstring providing a human-readable reason for the abort. return value a promise, which fulfills with the value given in the reason parameter. exceptions typeerror the stream you are trying to abort is not a writablestream, or it is locked. examples const writablestream = new writablestream({ write(chunk) { ... }, close() { ... }, abort(err) { ... } }, queuingstrategy); ... ...
WritableStream - Web APIs
rovides a standard abstraction for writing streaming data to a destination, known as a sink. this object comes with built-in backpressure and queuing. constructor writablestream() creates a new writablestream object. properties writablestream.locked read only a boolean indicating whether the writablestream is locked to a writer. methods writablestream.abort() aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. writablestream.close() closes the stream. writablestream.getwriter() returns a new instance of writablestreamdefaultwriter and locks the stream to that instance. while the stream is locked, no other writer can be acquired until this one is ...
WritableStreamDefaultWriter.abort() - Web APIs
if the writer is active, the abort() method behaves the same as that for the associated stream (writablestream.abort()). if not, it returns a rejected promise. syntax var promise = writablestreamdefaultwriter.abort(reason); parameters reason optional a domstring representing a human-readable reason for the abort. return value a promise, which fulfills with the value given in the reason parameter. ...
WritableStreamDefaultWriter.ready - Web APIs
syntax var promise = writablestreamdefaultwriter.ready; value a promise. example the following example shows two uses of the ready property. the first uses ready to ensure that the writablestream is done writing and thus able to receive data before sending a binary chunk. ...
WritableStreamDefaultWriter - Web APIs
ls if the stream becomes closed or the writer's lock is released, or rejects if the stream errors. writablestreamdefaultwriter.desiredsizeread only returns the desired size required to fill the stream's internal queue. writablestreamdefaultwriter.readyread only returns a promise that resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure. methods writablestreamdefaultwriter.abort() aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. writablestreamdefaultwriter.close() closes the associated writable stream. writablestreamdefaultwriter.release...
XRReferenceSpace.onreset - Web APIs
syntax xrreferencespace.onreset = eventhandler; eventhandler = xrreferencespace.onreset; value an event handler function which will be called whenever the reset event is received by the xrreferencespace. usage notes see the reset event documentation for further details. ...
Web APIs
Web › API
rs apistoragestorage access apistreams ttouch eventsuurl apivvibration apivisual viewport wweb animationsweb audio apiweb authentication apiweb crypto apiweb notificationsweb storage apiweb workers apiwebglwebrtcwebvttwebxr device apiwebsockets api interfaces this is a list of all the interfaces (that is, types of objects) that are available. ...
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
s. it is not "plug and play", and will take a lot of testing/refinement before your solution works with any product. here are some of it's quirks and some solutions/workarounds: msaa can be crash prone problem: many of msaa's crash occur because more than one process is refcounting the same objects, and because pointers are being shared between processes. when your application closes, different signals are typically broadcast. for example, the application window closes and the window is blurred. it is impossible to know if and when the 3rd party assistive technology will use one of these signals to release the objects of yours that is is refcounting. this can lead to crashes where it releases something and the wrong time, when some of your dll's are unloaded but not others, and a destructor is...
Using CSS transitions - CSS: Cascading Style Sheets
value isn't affected by the value of transition-delay. as usual, you can use the addeventlistener() method to monitor for this event: el.addeventlistener("transitionend", updatetransition, true); you detect the beginning of a transition using transitionrun (fires before any delay) and transitionstart (fires after any delay), in the same kind of fashion: el.addeventlistener("transitionrun", signalstart, true); el.addeventlistener("transitionstart", signalstart, true); note: the transitionend event doesn't fire if the transition is aborted before the transition is completed because either the element is made display: none or the animating property's value is changed. specifications specification status comment css transitions working draft initial defini...
text-overflow - CSS: Cascading Style Sheets
it can be clipped, display an ellipsis ('…'), or display a custom string. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the text-overflow property doesn't force an overflow to occur. to make text overflow its container you have to set other css properties: overflow and white-space. ...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
Web › HTML › Element › link
ributes this element includes the global attributes. as this attribute is only used when rel="preload" or rel="prefetch" has been set on the <link> element. it specifies the type of content being loaded by the <link>, which is necessary for request matching, application of correct content security policy, and setting of correct accept request header. furthermore, rel="preload" uses this as a signal for request prioritization. the table below lists the valid values for this attribute and the elements or resources they apply to. value applies to audio <audio> elements document <iframe> and <frame> elements embed <embed> elements fetch fetch, xhr this value also requires <link> to contain...
Feature Policy - HTTP
ntrolled features though feature policy provides control of multiple features using a consistent syntax, the behavior of policy controlled features varies and depends on several factors. the general principle is that there should be an intuitive or non-breaking way for web developers to detect or handle the case when the feature is disabled. newly introduced features may have an explicit api to signal the state. existing features that later integrate with feature policy will typically use existing mechanisms. some approaches include: return "permission denied" for javascript apis that require user permission grants. return false or error from an existing javascript api that provides access to feature. change the default values or options that control the feature behavior. the current se...
Index - HTTP
Web › HTTP › Headers › Index
ent, such as a message integrity check, digital signature, or post-processing status. 108 transfer-encoding http, reference, header the transfer-encoding header specifies the form of encoding used to safely transfer the entity to the user. 109 upgrade-insecure-requests http, https, security, header the http upgrade-insecure-requests request header sends a signal to the server expressing the client’s preference for an encrypted and authenticated response, and that it can successfully handle the upgrade-insecure-requests csp directive. 110 user-agent http, reference, header the user-agent request header contains a characteristic string that allows the network protocol peers to identify the application type, operating system, software...
Vary - HTTP
Web › HTTP › Headers › Vary
would have been set on an equivalent 200 ok response. header type response header forbidden header name no syntax vary: * vary: <header-name>, <header-name>, ... directives * each request for a url is supposed to be treated as a unique and uncacheable request. a better way to indicate this is to use cache-control: no-store, which is clearer to read and also signals that the object shouldn't be stored ever. <header-name> a comma-separated list of header names to take into account when deciding whether or not a cached response can be used. examples dynamic serving when using the vary: user-agent header, caching servers should consider the user agent when deciding whether to serve the page from cache. for example, if you are serving different content to...
HTTP Index - HTTP
Web › HTTP › Index
uch as a message integrity check, digital signature, or post-processing status. 189 transfer-encoding http, reference, header the transfer-encoding header specifies the form of encoding used to safely transfer the payload body to the user. 190 upgrade-insecure-requests http, https, security, header the http upgrade-insecure-requests request header sends a signal to the server expressing the client’s preference for an encrypted and authenticated response, and that it can successfully handle the upgrade-insecure-requests csp directive. 191 user-agent http, http header, reference, user-agent the user-agent request header contains a characteristic string that allows the network protocol peers to identify the application type, operating...
Web audio codec guide - Web media technologies
rip away audio frequencies that aren't used much, tolerate loss of precision in the decoded output, and use other methods to lose audio content, quality, and fidelity to produce smaller encoded media. upon decoding, the output is, to varying degrees, still understandable. the specific codec used—and the compression configuration selected—determine how close to the original, uncompressed audio signal the output seems to be when heard by the human ear. because of the differences in how lossy codecs work compared to lossless ones, especially the fact that lossless ones have to be much more conservative with their compression, lossy codecs nearly always result in significantly smaller compressed audio than lossless codecs do. generally speaking, the most common reasons to choose lossless audio...
Digital video concepts - Web media technologies
, one sample per pixel, the way rgb images are stored in memory. each frame of video is represented by a matrix of luma values, y, with each pixel's color computed using the values in the u and v matrices. for example, in the av1 codec, a record stores the encoded luma for a tile, and a second record contains the chroma data in the form of the u and v values. in broadcast television, the luma signal is the primary signal, while the chrominance data is sent on a subcarrier. the jpeg file type's compression works by first converting the image to the y'uv color system, then compressing that data. each of y', cb, and cr are able to have values from 0 to 255. ...