Search completed in 0.96 seconds.
179 results for "delivered":
Your results are loading. Please wait...
Index - Web APIs
Web › API › Index
e events. 643 clipboardevent.clipboarddata api, clipboard api, clipboardevent, experimental, method, read-only the clipboardevent.clipboarddata property holds a datatransfer object, which can be used: 644 closeevent api, interface, reference, web, websocket, websockets a closeevent is sent to clients using websockets when the connection is closed. this is delivered to the listener indicated by the websocket object's onclose attribute. 645 closeevent() api, closeevent, constructor, reference the closeevent() constructor creates a new closeevent. 646 closeevent.initcloseevent() the closeevent.initcloseevent() method initializes the value of a close event once it's been created (normally using the document.createevent...
...arget object instance. 1275 eventtarget.addeventlistener() api, accessouterdata, dom, detecting events, event handlers, event listener, eventtarget, javascript, method, passingdata, receiving events, reference, addeventlistener, attachevent, events, mselementresize the eventtarget method addeventlistener() sets up a function that will be called whenever the specified event is delivered to the target. 1276 eventtarget.attachevent() no summary! 1277 eventtarget.dispatchevent() api, dom, dom element methods, gecko, method dispatches an event at the specified eventtarget, (synchronously) invoking the affected eventlisteners in the appropriate order. the normal event processing rules (including the capturing and optional bubbling phase) als...
...vent, property, reference the onpointerenter property of the globaleventhandlers mixin is an eventhandler that processes pointerenter events. 1531 globaleventhandlers.onpointerleave api, globaleventhandlers, html dom, needsbrowsercompatibility, pointer events, pointerevent, property, reference, onpointerleave the global event handler for the pointerleave event, which is delivered to a node when the pointer (mouse cursor, fingertip, etc.) exits its hit test area (for example, if the cursor exits an element or window's content area). this event is part of the pointer events api. 1532 globaleventhandlers.onpointermove api, event handler, globaleventhandlers, html dom, pointerevent, property, reference the onpointermove property of the globaleventhandlers...
...And 5 more matches
Using DTMF with WebRTC - Web APIs
as packets alongside the track's audio data. each time a tone is sent, the rtcpeerconnection receives a tonechange event with a tone property specifying which tone finished playing, which is an opportunity to update interface elements, for example. when the tone buffer is empty, indicating that all the tones have been sent, a tonechange event with its tone property set to "" (an empty string) is delivered to the connection object. if you'd like to know more about how this works, read 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...
...s a fallback to let older browsers (and those not yet updated to support the current webrtc dtmf api) run the example. finally, we set the dtmf sender's ontonechange event handler so we get notified each time a dtmf tone finishes playing. you can find the log function at the bottom of the documentation. when a tone finishes playing each time a dtmf tone finishes playing, a tonechange event is delivered to callerpc. the event listener for these is implemented as the handletonechangeevent() function. function handletonechangeevent(event) { if (event.tone !== "") { log("tone played: " + event.tone); } else { log("all tones have played. disconnecting."); callerpc.getlocalstreams().foreach(function(stream) { stream.gettracks().foreach(function(track) { track.stop(); ...
...cdtmfsender object we previously stored in dtmfsender. our call to insertdtmf() specifies not only the dtmf to send (dialstring), but also the length of each tone in milliseconds (400 ms) and the amount of time between tones (50 ms). negotiating the connection when the calling rtcpeerconnection begins to receive media (after the microphone's stream is added to it), a negotiationneeded event is delivered to the caller, letting it know that it's time to start negotiating the connection with the receiver. as previously mentioned, our example is simplified somewhat because we control both the caller and the receiver, so handlecallernegotiationneeded() is able to quickly construct the connection by chaining the required calls together for both the caller and receiver, as shown below. function handle...
...ject from the event.candidate string and deliver it to the caller by passing that into callerpc.addicecandidate(). if addicecandidate() fails, the catch() clause outputs the error to our log box. if event.candidate is null, that indicates that there are no more candidates available, and we log that information. adding media to the receiver when the receiver begins to receive media, an event is delivered to the receiver's rtcpeerconnection, receiverpc. as explained in starting the connection process, the current webrtc specification uses the track event for this, but some browsers haven't been updated to support this yet, so we also need to handle the addstream event. the handlereceivertrackevent() and handlereceiveraddstreamevent() methods, shown below, handle these. function handlereceivertrac...
NPP_NewStream - Archive of obsolete content
er. the plugin should set this value to request a mode for the stream. for more information about each of these values, see directions in this section. np_normal (default): delivers stream data to the instance in a series of calls to npp_writeready and npp_write. np_asfileonly: saves stream data to a file in the local cache. np_asfile: file download. like np_asfileonly except that data is delivered to the plug-in as it is saved to the file (as in mode np_normal). np_seek: stream data randomly accessible by the plug-in as needed, through calls to npn_requestread. implementation note: some plugins, notably silverlight, do not set this outparam, and rely on the outparam being initialized to a default np_normal value. returns if successful, the function should return nperr_no_error...
... the browser calls npp_streamasfile to deliver the path of the file to the plug-in. if the stream comes from a local file, the npp_write and npp_writeready functions are not called. npp_streamasfile is simply called immediately. this mode allows the plug-in full random access to the data using platform-specific file operations. np_asfile: file download. differs from np_asfileonly in that data is delivered to the plug-in, through a series of calls to npp_writeready and npp_write, as it is saved to the file (as in mode np_normal). when the stream is complete, the browser calls npp_streamasfile to deliver the path of the file to the plug-in. if the data in the stream comes from a file that is already local, the data is read, sent to the plug-in through npp_write, and written to a file in the local ca...
...e file to the plug-in. if the data in the stream comes from a file that is already local, the data is read, sent to the plug-in through npp_write, and written to a file in the local cache. note: most plug-ins that need the stream saved to a file should use the more efficient mode np_asfileonly (above); this mode is preserved for compatibility only. np_seek: stream data is not automatically delivered to the instance, but can be randomly accessed by the plug-in as needed, through calls to npn_requestread. if the stream is not seekable, placing the stream in np_seek mode causes the browser to save the entire stream to the disk cache. npn_requestread requests are only fulfilled when all data has been read and stored in the cache. as an optimization to extract the maximum benefit from existing ne...
Index
Mozilla › Tech › XPCOM › Index
use while offline. it includes methods for adding resources to and removing resources from the cache, as well as for enumerating the dynamically managed resource list. 510 nsidomorientationevent acceleration, dom, gecko 1.9.2, interfaces, interfaces:scriptable, mobile, orientation, xpcom interface reference the nsidomorientationevent interface describes the event that can be delivered to dom windows, providing information from the device's accelerometer, allowing code to determine the orientation of the device. 511 nsidomparser to create a domparser object from a web page or a chrome script running in a window, simply use new domparser(). when you create a domparser from a privileged script, you can pass parameters to the constructor, more on that below. ...
...istenermanager interfaces, interfaces:scriptable, message manager, xpcom, xpcom interface reference implemented by: @mozilla.org/globalmessagemanager;1. to access this service, use: 743 nsimessagesender message senders enable clients to send asynchronous messages to a single "other side". for example, a child-process message manager will send messages that are only delivered to its one parent-process message manager. 744 nsimessagewakeupservice interfaces, xpcom interface reference the parentprocessmessagemanager is used for this, so messages send from childprocessmessagemanagers will be heard. 745 nsimessenger interfaces, interfaces:scriptable, messages, needscontent, xpcom api reference, xpcom interface reference, thunderbird ...
...e. this will compute the key and expand the key to two keys, an aes256 encryption key and a 256 bit hmac key. it returns a key confirmation value (sha256d of the key) and the encryption and hmac keys. 993 nsisyncmessagesender message "senders" have a single "other side" to which messages are sent. for example, a child-process message manager will send messages that are only delivered to its one parent-process message manager. 994 nsitxttohtmlconv html, interfaces, interfaces:scriptable, xpcom interface reference prior versions of the interface named the methods using the initialcaps style instead of the intercaps style. 995 nsitaggingservice interfaces, interfaces:scriptable, places, xpcom, xpcom api reference, xpcom interface reference ...
Signaling and video calling - Web APIs
server supports several message types to handle tasks, such as registering new users, setting usernames, and sending public chat messages. to allow the server to support signaling and ice negotiation, we need to update the code. we'll have to allow directing messages to one specific user instead of broadcasting to all connected users, and ensure unrecognized message types are passed through and delivered, without the server needing to know what they are. this lets us send signaling messages using this same server, instead of needing a separate server. let's take a look which changes we need to make to the chat server support webrtc signaling. this is in the file chatserver.js. first up is the addition of the function sendtooneuser(). as the name suggests, this sends a stringified json message t...
...is means our signaling messages will be in json format, with contents which specify what kind of messages they are as well as any additional information needed in order to handle the messages properly. exchanging session descriptions when starting the signaling process, an offer is created by the user initiating the call. this offer includes a session description, in sdp format, and needs to be delivered to the receiving user, which we'll call the callee. the callee responds to the offer with an answer message, also containing an sdp description. our signaling server will use websocket to transmit offer messages with the type "video-offer", and answer messages with the type "video-answer". these messages have the following fields: type the message type; either "video-offer" or "video-answer".
...candidate", target: targetusername, candidate: event.candidate }); } } this builds an object containing the candidate, then sends it to the other peer using the sendtoserver() function previously described in sending messages to the signaling server. the message's properties are: type the message type: "new-ice-candidate". target the username the ice candidate needs to be delivered to. this lets the signaling server route the message. candidate the sdp representing the candidate the ice layer wants to transmit to the other peer. the format of this message (as is the case with everything you do when handling signaling) is entirely up to you, depending on your needs; you can provide other information as required. note: it's important to keep in mind that the icecandidat...
Web security
ured record of issued tls certificates. mixed content an https page that includes content fetched using cleartext http is called a mixed content page. pages like this are only partially encrypted, leaving the unencrypted content accessible to sniffers and man-in-the-middle attackers. how to fix a website with blocked mixed content if your website delivers https pages, all active mixed content delivered via http on these pages will be blocked by default. consequently, your website may appear broken to users (if iframes or plugins don't load, etc.). passive mixed content is displayed by default, but users can set a preference to block this type of content, as well. this page explains what you should be aware of as a web developer. secure contexts a secure context is a window or worker for which...
...quently, your website may appear broken to users (if iframes or plugins don't load, etc.). passive mixed content is displayed by default, but users can set a preference to block this type of content, as well. this page explains what you should be aware of as a web developer. secure contexts a secure context is a window or worker for which there is reasonable confidence that the content has been delivered securely (via https/tls), and for which the potential for communication with contexts that are not secure is limited. many web apis and features are accessible only in a secure context. the primary goal of secure contexts is to prevent man-in-the-middle attackers from accessing powerful apis that could further compromise the victim of an attack. features restricted to secure contexts this refer...
... policy is a critical security mechanism that restricts how a document or script loaded from one origin can interact with a resource from another origin. it helps isolate potentially malicious documents, reducing possible attack vectors. subresource integrity subresource integrity (sri) is a security feature that enables browsers to verify that resources they fetch (for example, from a cdn) are delivered without unexpected manipulation. it works by allowing you to provide a cryptographic hash that a fetched resource must match. http access-control-allow-origin the access-control-allow-origin response header indicates whether the response can be shared with requesting code from the given origin. http x-content-type-options the x-content-type-options response http header is a marker used by t...
context-menu - Archive of obsolete content
ray of content scripts associated with the menu item during creation. contentscriptfile the url of a content script or the array of such urls associated with the menu item during creation. events message if you listen to this event you can receive message events from content scripts associated with this menu item. when a content script posts a message using self.postmessage(), the message is delivered to the add-on code in the menu item's message event. arguments value : listeners are passed a single argument which is the message posted from the content script. the message can be any json-serializable value. menu a labeled menu item that expands into a submenu. methods additem(item) appends a menu item to the end of the menu. if the item is already contained in another menu or in the to...
... or the array of content scripts associated with the menu during creation. contentscriptfile the url of a content script or the array of such urls associated with the menu during creation. events message if you listen to this event you can receive message events from content scripts associated with this menu item. when a content script posts a message using self.postmessage(), the message is delivered to the add-on code in the menu item's message event. arguments value : listeners are passed a single argument which is the message posted from the content script. the message can be any json-serializable value. separator a menu separator. separators can be contained only in menus, not in the top-level context menu. methods destroy() permanently removes the separator from its parent menu an...
widget - Archive of obsolete content
ated widgetview object. click this event is emitted when the widget is clicked. arguments widgetview : listeners are passed a single argument which is the widgetview that triggered the click event. message if you listen to this event you can receive message events from content scripts associated with this widget. when a content script posts a message using self.postmessage(), the message is delivered to the add-on code in the widget's message event. arguments value : listeners are passed a single argument which is the message posted from the content script. the message can be any json-serializable value. mouseover this event is emitted when the user moves the mouse over the widget. mouseout this event is emitted when the user moves the mouse away from the widget. widgetview represents...
...the widget view is removed from its related window. this can occur if the window is closed, firefox exits, or the add-on is disabled. click this event is emitted when the widget view is clicked. message if you listen to this event you can receive message events from content scripts associated with this widget view. when a content script posts a message using self.postmessage(), the message is delivered to the add-on code in the widget view's message event. arguments value : listeners are passed a single argument which is the message posted from the content script. the message can be any json-serializable value. mouseover this event is emitted when the user moves the mouse over the widget view. mouseout this event is emitted when the user moves the mouse away from the widget view. ...
Extension Versioning, Update and Compatibility - Archive of obsolete content
infourl entry to the update manifest (see the example above). the page at this url will be retrieved and displayed to the user. since it is being displayed outside of a normal webpage context it is heavily sanitized, which means there are few formatting options available and scripting and images aren't allowed. the information page retrieved must currently be totally valid xhtml, including being delivered with the mime type application/xhtml+xml (important: see problems section) you may include %app_locale% in your updateinfourl if you want to have locale information included in the url -- this allows you to customize the text based on the user's locale. you may also use the other substitution strings supported by updateurl, although those may be less useful. formatting prior to firefox 4 prior...
...eurl uses https, or there is no updateurl at all (which defaults to addons.mozilla.org which is https) the updateurl uses http and the updatekey entry is specified which will be used to verify the data in the update manifest. when you specify an updatekey in the install.rdf, you must include a digital signature in the update manifest or the information will be rejected. in the update manifest delivered from the updateurl the updatelink must be specified in one of the following ways: the updatelink to the xpi file must use https the updatelink can use http and you must include an updatehash for the xpi file using sha1, sha256, sha384 or sha512 hash algorithms. any entries in the update manifest that do not meet one of those two requirements will be ignored when checking for new versions. ...
Index - Archive of obsolete content
use python code (almost) anywhere you can use javascript. 622 rdf api no summary! 623 rdf datasource how-to rdf no summary! 624 reading textual data add-ons, extensions, internationalization, unicode this article describes how to read textual data from streams, files and sockets. 625 remote xul xul how to use xul delivered from a webserver, not as part of chrome. 626 remote debugging when a bug is reproducible by a community member, but not on a developer's computer, a last-resort strategy is to debug it on the community member's computer. the crash victim should at least know how to run a debugger, if not how to use it, and should have a debug build of firefox handy. 627 remotely d...
... today's web browsers offer somewhat limited graphics capabilities to web developers. advances in hardware, especially graphics processors, offer the potential for far richer graphics in interactive applications. to realize this potential in web applications, browsers must expose rich new graphics apis to web content. the mozilla project will meet this challenge with two major new features to be delivered in firefox 1.5: integrated svg and a new canvas html element. work is also underway "under the hood" on a new unified graphics architecture that uses 3d graphics processors to accelerate all rendering. this work provides additional benefits to web developers such as the ability to apply svg effects to html content. 746 xul - mozilla's xml user interface language presentations, xul ...
Unix stub installer - Archive of obsolete content
n it by typing "gdb mozilla-installer-bin" on the shell prompt. how we get setup to debug the xpinstall engine from the unix stub installer? build your entire mozilla tree (which should build the installer in the src2 directory as well). go to mozilla/xpinstall/packager/unix. on the shell prompt type "perl deliver.pl". now you will find an installer *and* the xpcom.xpi and other debug xpis delivered to mozilla/installer/raw. debug using "gdb mozilla-installer-bin" and set a breakpoint at xpi_init(). you can step into the xpinstall engine through the xpistub once the xpistub dll is loaded. how do i add an installer package to the unix installer? adding a package involves a few steps: add a section named for your <component> to the packages-unix manifest that describes which files from...
...elect the setup types you choose it to be in. finally add a call to generate the xpi at package time by adding a makexpifile("<component>"); call at: <http://lxr.mozilla.org/seamonkey/sou.../makeall.pl#75> you can test it by changing your current working directory to mozilla/xpinstall/packager/unix and running "perl deliver.pl" on the shell prompt. the resulting stub and full installers will be delivered to "mozilla/installer/{stub,sea}". original document information author(s): samir gehani other contributors: curt patrick last updated date: march 12, 2003 copyright information: copyright (c) samir gehani, curt patrick ...
Windows stub installer - Archive of obsolete content
installer? build your entire mozilla tree, which should build the stub installer in the setup directory as well. (if you need to rebuild stub installer, got to /mozilla/xpinstall/wizard/windows/setup and type "nmake /f makefile.win") go to mozilla/xpinstall/wizard/windows/builder on the shell prompt type "perl build.pl". now you will find an installer *and* the xpcom.xpi and other debug xpis delivered to mozilla/dist/win32_d.obj/install. run the stub installer setup.exe from the install directory. if you need to use vc++ to debug the installer: under project | settings | debug set "executable for debug session" to be the path to mozilla/dist/win32_d.obj/install/setup.exe set "working directory" to be the path to mozilla/dist/wind32_d.obj/install press f10 to step into the code how we...
...stalls it when users select the setup types you choose it to be in. finally add <component> to the component list array @gcomponentlist at: <http://lxr.mozilla.org/seamonkey/sou...makeall.pl#125> you can test it by changing your current working directory to mozilla/xpinstall/wizard/windows/builder and running "perl build.pl" on the shell prompt. the resulting stub installer and packages will be delivered to "mozilla/dist/win32obj_d/installer". run setup.exe there to launch the stub installer. original document information author(s): samir gehani other contributors: curt patrick last updated date: march 12, 2003 copyright information: copyright (c) samir gehani, curt patrick ...
Using XPInstall to Install Plugins - Archive of obsolete content
snippet above, the initinstall method is invoked with three parameters: a string for the name of the application a string signifying the plugin identifier associated with the plugin. this value is actually entered in the client version registry upon installation, a mozilla-browser file that stores metadata about the software that has just been installed. this value can be queried via web-page delivered javascript, and is useful for initiating xpinstall downloads via trigger scripts. you can determine the version of the software that has been installed, and determine whether to update it, all via javascript in a web-page. a string representing the four digit version of the software. caveat: certain versions of mozilla-based browsers (such as netscape 6.x) treat the use of the equals character ...
...ent platforms and os's. a single install.js is often capable of running on many different platforms. some installation concerns this section gathers together some of the chief concerns about deploying xpi packages, notably: how ought a plugin download via xpi be initiated? and what about uninstalling plugins? triggering an xpinstall download with a triggerscript a trigger script is web-page delivered piece of javascript that can automatically initiate an xpinstall download. this can be done conditionally, since trigger scripts can also detect what software has already been installed to the user's machine via xpinstall. this feature is useful for web sites because: html pages and javascript already have a way of detecting what plugins are installed. additionally, via the installtrigger objec...
NPP_Write - Archive of obsolete content
void* buf); parameters the function has the following parameters: instance pointer to the current plug-in instance. stream pointer to the current stream. offset offset in bytes of buf from the beginning of the data in the stream. can be used to check stream progress or by range requests from npn_requestread. len length in bytes of buf; number of bytes accepted. buf buffer of data, delivered by the stream, that contains len bytes of data offset bytes from the start of the stream. the buffer is allocated by the browser and is 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 ...
..._destroystream. description the browser calls the npp_write function to deliver the data specified in a previous npp_writeready call to the plug-in. a plug-in must consume at least as many bytes as indicated in the npp_writeready call. after a stream is created by a call to npp_newstream, the browser calls npp_write either: if the plug-in requested a normal-mode stream, the data in the stream is delivered to the plug-in instance in a series of calls to npp_writeready and npp_write. if the plug-in requested a seekable stream, the npn_requestread function requests reads of a specified byte range that results in a series of calls to npp_writeready and npp_write. the plug-in can use the offset parameter to track the bytes that are written. this gives you different information depending in the type of...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
omment). 103 dtls (datagram transport layer security) dtls, intro datagram transport layer security (dtls) is a protocol used to secure datagram-based communications. 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. 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 "t...
...ary, security, sql, sql injection, webapp sql injection takes advantage of web apps that fail to validate user input. hackers can maliciously pass sql commands through the web app for execution by a backend database. 394 sri csp, security subresource integrity (sri) is a security feature that enables browsers to verify that files they fetch (for example, from a cdn) are delivered without unexpected manipulation. it works by allowing you to provide a cryptographic hash that a fetched file must match. 395 stun glossary, infrastructure, stun, webmechanics, webrtc stun (session traversal utilities for nat) is an auxiliary protocol for transmitting data around a nat (network address translator). stun returns the ip address, port, and connectivity status of...
Message manager overview
here's a single global frame message manager in the chrome process. this operates on all frames, in all content tabs. if you load a frame script using the global frame message manager, the script gets loaded separately into every open tab: three times, in the diagram above. similarly, if you send a message using the global frame message manager, it's received by all content tabs, and is then delivered to any frame scripts that are listening for it. its most important functions and attributes are: childcount : contains the number of children (typically, browser windows) getchildat() : get the child at the given index loadframescript() : load a frame script into every tab in the browser broadcastasyncmessage() : send a message to frame scripts addmessagelistener() :...
...frame that hosts a single web document. it does not refer to the more general sense of a web browser. description finally, there's a browser message manager for every open content tab: three, in the diagram above. this corresponds one-to-one with a content tab. scripts you load using a browser message manager are loaded only into that content tab, and messages you send are delivered only to that content tab. you can mix and match: so for example, you could load a script into every tab using the global message manager, but then send a message to the script instance loaded into a specific tab by using the browser message manager. its most important functions are: loadframescript() : load a frame script into this browser frame (tab) sendasyncmessage() : send...
IPDL Tutorial
pluginlibrary; }; launching the subprocess and hooking these protocol actors into our ipc "transport layer" is beyond the scope of this document. see ipdl processes and threads for more details. because protocol messages are represented as c++ methods, it's easy to forget that they are in fact asynchronous messages: by default the c++ method will return immediately, before the message has been delivered. the parameters of the recv* methods (const nscstring& pluginpath in the example) are references to temporary objects, so copy them if you need to keep their data around. direction each message type includes a "direction." the message direction specifies whether the message can be sent from-parent-to-child, from-child-to-parent, or both ways. three keywords serve as direction specifiers; chil...
...s by blocking. please don't use rpc semantics. rpc semantics exists mainly to support remoting plugins (npapi), where we have no choice. chrome to content calls (for ipc tabs) must only use async semantics. in order to preserve responsiveness, the chrome process may never block on a content process which may be busy or hung. message delivery order delivery is "in-order", that is, messages are delivered to the receiver in the order that they are sent, regardless of the messages' semantics. if an actor a sends messages m1 then m2 to actor b, b will be awoken to process m1 then m2. subprotocols and protocol management so far we've seen a single protocol, but no real-world situation would have a single protocol in isolation. instead, protocols are arranged in a managed hierarchy of subprotocols...
nsIMessageSender
to send messages to multiple "other sides", you would use nsimessagebroadcaster. ...
...[optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); sendasyncmessage() send messagename and obj to the "other side" of this message manager. this invokes listeners who registered for messagename using a nsimessagelistenermanager. see nsimessagelistener::receivemessage() for the format of the data delivered to listeners. throws ns_error_not_initialized if the sender is not initialized. for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_error_failure when the message receiver cannot be found. for example, we will throw ns_error_failure if we try to send a message to a cross-process fram...
nsISyncMessageSender
see message manager interfaces for more details on the distinction between message senders and message broadcasters. ...
...sendasyncmessage(), except blocks the sender until all listeners of the message have been invoked. returns an array containing return values from each listener invoked. send messagename and obj to the "other side" of this message manager. this invokes listeners who registered for messagename using a nsimessagelistenermanager. see nsimessagelistener::receivemessage() for the format of the data delivered to listeners. throws ns_error_not_initialized if the sender is not initialized. for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_error_failure when the message receiver cannot be found. for example, we will throw ns_error_failure if we try to send a message to a cross-process fram...
Streams - Plugins
network or file system through a series of calls to npp_writeready and npp_write. np_asfileonly: this plug-in gets full random access to the data using platform-specific file operations. the browser saves stream data to a local file, and, when the stream is complete, delivers the path of the file through a call to npp_streamasfile. np_asfile: this mode is like np_asfileonly except that data is delivered to the plug-in as it is saved to the file, through a series of calls to npp_write. you should use np_asfileonly whenever possible in preference to np_asfile, which is less efficient because it uses successive calls to npp_write to send the data. np_seek: the plug-in instance can randomly access stream data as needed, through calls to npn_requestread. if the stream is not seekable, these requests...
...eady and npp_write. int32 npp_write(npp instance, npstream *stream, int32 offset, int32 len, void *buf); the instance parameter is the current plug-in instance; the stream parameter specifies the current stream. the offset parameter specifies the offset, in bytes, of buf from the beginning of the data in the stream. the len parameter specifies the length, in bytes, of buf, the buffer of data (delivered by the stream). the buffer allocated by the browser is deleted after returning from the function, so the plug-in must make a copy of the data it needs to keep. as an example, suppose that a plug-in (and the http server) supports byte-range requests, and that the browser is in the process of pushing data to the plug-in. if the user now requests a specific page of the document, the plug-in calls n...
URLs - Plugins
reads data from the url and either displays it in the target window or delivers it to the plug-in. for http urls only, the browser resolves this method as the http server method post, which transmits data to the server. you can use npn_posturl to post data to a url from a memory buffer or file. the result from the server can also be sent to a particular browser window or frame for display, or delivered to the plug-in instance in a new stream. plug-ins can use this capability to post form data to cgi scripts using http or upload files to a remote server using ftp. the browser resolves this method as the http server method post, which transmits data to the server. the data to post can be contained either in a local temporary file or a new memory buffer. to post a file, set the flag file to true,...
...n(mydata) + 1; err = npn_posturlnotify(instance, "mailto:fred@example.com", null, mylength, mydata, false); the example starts by defining the mail message, mydata, and its length, mylength. it sends mydata and mylength to the mailto url mailto:fred@example.com. the target window for displaying the message is null in the example. normally, using a null target window causes the response to be delivered from the server to the plug-in instance in a new stream, but no response is expected for a mailto url. you cannot use either of these functions to set the body or attachments of an email message. « previousnext » ...
Element: mouseout event - Web APIs
bubbles yes cancelable yes interface mouseevent event handler property onmouseout examples the following examples show the use of the mouseout event. ...
...s show the use of the mouseout event. mouseout and mouseleave the following example illustrates the difference between mouseout and mouseleave events. the mouseleave event is added to the <ul> to color the list purple whenever the mouse exits the <ul>. mouseout is added to the list to color the targeted element orange when the mouse exits it. when you try this out, you'll find that mouseout is delivered to the individual list items, while mouseleave goes to the overall list, courtesy of the hierarchy of the items and the fact that list items obscure the underlying <ul>. html <ul id="test"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> javascript let test = document.getelementbyid("test"); // briefly make the list purple when the mouse moves off the // <ul> element test.addeve...
The HTML DOM API - Web APIs
s <head> block and body, as well as lists of the images, links, scripts, etc. contained in the document. support for interacting with the user by examining focus and by executing commands on editable content. event handlers for document events defined by the html standard to allow access to mouse and keyboard events, drag and drop, media control, and more. event handlers for events that can be delivered to both elements and documents; these presently include only copy, cut, and paste actions. html element interfaces the element interface has been further adapted to represent html elements specifically by introducing the htmlelement interface, which all more specific html element classes inherit from. this expands the element class to add html-specific general features to the element nodes. pr...
...ent history location pagetransitionevent popstateevent web components interfaces these interfaces are used by the web components api to create and manage the available custom elements. customelementregistry miscellaneous and supporting interfaces these supporting object types are used in a variety of ways in the html dom api. in addition, promiserejectionevent represents the event delivered when a javascript promise is rejected. domstringlist domstringmap errorevent htmlallcollection mimetype mimetypearray promiserejectionevent interfaces belonging to other apis several interfaces are technically defined in the html specification while actually being part of other apis. web storage interfaces the web_storage_api provides the ability for web sites to store data either...
MediaRecorder.ondataavailable - Web APIs
e mediastream recording api) handles the dataavailable event, letting you run code in response to blob data being made available for use. the dataavailable event is fired when the mediarecorder delivers media data to your application for its use. the data is provided in a blob object that contains the data. this occurs in four situations: when the media stream ends, any media data not already delivered to your ondataavailable handler is passed in a single blob. when mediarecorder.stop() is called, all media data which has been captured since recording began or the last time a dataavailable event occurred is delivered in a blob; after this, capturing ends. when mediarecorder.requestdata() is called, all media data which has been captured since recording began or the last time a dataavailable e...
...ailable handler is passed in a single blob. when mediarecorder.stop() is called, all media data which has been captured since recording began or the last time a dataavailable event occurred is delivered in a blob; after this, capturing ends. when mediarecorder.requestdata() is called, all media data which has been captured since recording began or the last time a dataavailable event occurred is delivered; then a new blob is created and media capture continues into that blob. if a timeslice property was passed into the mediarecorder.start() method that started media capture, a dataavailable event is fired every timeslice milliseconds. that means that each blob will have a specific time duration (except the last blob, which might be shorter, since it would be whatever is left over since the last e...
MediaRecorder.start() - Web APIs
the mediarecorder method start(), which is part of the mediastream recording api, begins recording media into one or more blob objects. you can record the entire duration of the media into a single blob (or until you call requestdata()), or you can specify the number of milliseconds to record at a time. then, each time that amount of media has been recorded, an event will be delivered to let you act upon the recorded media, while a new blob is created to record the next slice of the media assuming the mediarecorder's state is inactive, start() sets the state to recording, then begins capturing media from the input stream. a blob is created and the data is collected in it until the time slice period elapses or the source media ends. each time a blob is filled up to that point (the timeslice durat...
...ng the current configuration. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this also happens when a mediastreamtrack within the stream is marked as isolated due to the peeridentity constraint on the source stream. this exception may also be delivered as an error event if the security options for the source media change after recording begins. unknownerror something else went wrong during the recording process. example ... record.onclick = function() { mediarecorder.start(); console.log("recorder started"); } ... specifications specification status comment mediastream recordingthe definition of 'med...
MediaStream Recording API - Web APIs
i makes it possible to capture the data generated by a mediastream or htmlmediaelement object for analysis, processing, or saving to disk. it's also surprisingly easy to work with. basic concepts the mediastream recording api is comprised of a single major interface, mediarecorder, which does all the work of taking the data from a mediastream and delivering it to you for processing. the data is delivered by a series of dataavailable events, already in the format you specify when creating the mediarecorder. you can then process the data further or write it to file as desired. overview of the recording process the process of recording a stream is simple: set up a mediastream or htmlmediaelement (in the form of an <audio> or <video> element) to serve as the source of the media data. create a m...
...cording api, see using the mediastream recording api, which shows how to use the api to record audio clips. a second article, recording a media element, describes how to receive a stream from an <audio> or <video> element and use the captured stream (in this case, recording it and saving it to a local disk). reference blobevent each time a chunk of media data is finished being recorded, it's delivered to consumers in blob form using a blobevent of type dataavailable. mediarecorder the primary interface that implements the mediastream recording api. mediarecordererrorevent the interface that represents errors thrown by the mediastream recording api. its error property is a domexception that specifies that error occurred. specifications specification status comment ...
PaymentRequest: merchantvalidation event - Web APIs
see merchant validation in payment processing concepts for details on how the merchant validation process works. bubbles no cancelable no interface merchantvalidationevent event handler property onmerchantvalidation examples in this example, an event handler is established for the merchantvalidation event. it uses the fetch() to send a request to its own server with an argument of the payment method's validation url, obtained from the event's validationurl property. ...
....location.origin + '/validate?url=' + encodeuricomponent(event.validationurl); // get validation data, and complete validation; return await fetch(merchantserverurl).then(response => response.text()); }, false); }; const response = await request.show(); how merchant server handles the validation depends on the server implementation and payment method documentation. the content delivered by the validation server is forwarded to the merchant server and is then returned from the fetch() call's fulfillment handler to the complete() method on the event. this response lets the payment handler know if the merchant is validated. you can also use the onmerchantvalidation event handler property to set up the handler for this event: request.onmerchantvalidation = event => { event.compl...
RTCPeerConnection.addIceCandidate() - Web APIs
te description, which describes the state of the remote end of the connection. if the candidate parameter is missing or a value of null is given when calling addicecandidate(), the added ice candidate is an "end-of-candidates" indicator. the same is the case if the value of the specified object's candidate is either missing or an empty string (""), it signals that all remote candidates have been delivered. the end-of-candidates notification is transmitted to the remote peer using a candidate with an a-line value of end-of-candidates. during negotiation, your app will likely receive many candidates which you'll deliver to the ice agent in this way, allowing it to build up a list of potential connection methods. this is covered in more detail in the articles webrtc connectivity and signaling and v...
... if no candidate object is specified, or its value is null, an end-of-candidates signal is sent to the remote peer using the end-of-candidates a-line, formatted simply like this: a=end-of-candidates deprecated parameters in older code and documentation, you may see a callback-based version of this function. this has been deprecated and its use is strongly discourag...
RTCPeerConnection.createAnswer() - Web APIs
the createanswer() method on the rtcpeerconnection interface creates an sdp answer to an offer received from a remote peer during the offer/answer negotiation of a webrtc connection. the answer contains information about any media already attached to the session, codecs and options supported by the browser, and any ice candidates already gathered. the answer is delivered to the returned promise, and should then be sent to the source of the offer to continue the negotiation process. syntax apromise = rtcpeerconnection.createanswer([options]); rtcpeerconnection.createanswer(successcallback, failurecallback[, options]); parameters options optional an object which contains options which customize the answer; this is based on the rtcansweroptions dictionary. deprecated parameters in older ...
...ted for the answer. exceptions notreadableerror the identity provider wasn't able to provide an identity assertion. operationerror generation of the sdp failed for some reason; this is a general failure catch-all exception. return value a promise whose fulfillment handler is called with an object conforming to the 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 thi...
RTCPeerConnection: icecandidate event - Web APIs
o cancelable no interface rtcpeerconnectioniceevent event handler property rtcpeerconnection.onicecandidate description there are three reasons why the icecandidate event is fired on an rtcpeerconnection. sharing a new candidate the majority of icecandidate events are fired to indicate that a new candidate has been gathered. this candidate needs to be delivered to the remote peer over the signaling 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(), pa...
...pecification goes through repeated drafts). indicating that ice gathering is complete once all ice transports have finished gathering candidates and the value of the rtcpeerconnection object's icegatheringstate has made the transition to complete, an icecandidate event is sent with the value of complete set to null. this signal exists for backward compatibility purposes and does not need to be delivered onward to the remote peer (which is why the code snippet above checks to see if event.candidate is null prior to sending the candidate along. if you need to perform any special actions when there are no further candidates expected, you're much better off watching the ice gathering state by watching for icegatheringstatechange events: pc.addeventlistener("icegatheringstatechange", ev => { swit...
RTCPeerConnection - Web APIs
ent peer connection.createanswer() the createanswer() method on the rtcpeerconnection interface creates an sdp answer to an offer received from a remote peer during the offer/answer negotiation of a webrtc connection. the answer contains information about any media already attached to the session, codecs and options supported by the browser, and any ice candidates already gathered. ...
...). "have-local-pranswer" the offer sent by the remote peer has been applied and an answer has been created (usually by calling rtcpeerconnection.createanswer()) and applied by calling rtcpeerconnection.setlocaldescription(). this provisional answer describes the supported media formats and so forth, but may not have a complete set of ice candidates included. further candidates will be delivered separately later. "have-remote-pranswer" a provisional answer has been received and successfully applied in response to an offer previously sent and established by calling setlocaldescription(). "closed" the connection is closed. note: this value moved into the rtcpeerconnectionstate enum in the may 13, 2016 draft of the specification, as it reflects the s...
Touch events - Web APIs
then we get the context and pull the list of changed touch points out of the event's touchevent.changedtouches property. after that, we iterate over all the touch objects in the list, pushing them onto an array of active touchpoints and drawing the start point for the draw as a small circle; we're using a 4-pixel wide line, so a 4-pixel radius circle will show up neatly. drawing as the touche...
...nts out of the event's touchevent.changedtouches property. after that, we iterate over all the touch objects in the list, pushing them onto an array of active touchpoints and drawing the start point for the draw as a small circle; we're using a 4-pixel wide line, so a 4-pixel radius circle will show up neatly. drawing as the touches move each time one or more fingers move, a touchmove event is delivered, resulting in our handlemove() function being called. its responsibility in this example is to update the cached touch information and to draw a line from the previous position to the current position of each touch. function handlemove(evt) { evt.preventdefault(); var el = document.getelementbyid("canvas"); var ctx = el.getcontext("2d"); var touches = evt.changedtouches; for (var i = ...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
hannel through its onmessage event handler, the received json object is destructured to obtain the description or candidate found within. if the incoming message has a description, it's either an offer or an answer sent by the other peer. if, on the other hand, the message has a candidate, it's an ice candidate received from the remote peer as part of trickle ice. the candidate is destined to be delivered to the local ice layer by passing it into addicecandidate(). on receiving a description if we received a description, we prepare to respond to the incoming offer or answer. first, we check to make sure we're in a state in which we can accept an offer. if the connection's signaling state isn't stable or if our end of the connection has started the process of making its own offer, then we need to...
...s received from the impolite peer are processed as normal, by passing them into setremotedescription(). finally, we process a received offer by calling setlocaldescription() to set our local description to the one returned by createanswer(). then that gets sent to the polite peer using the signaling channel. if the incoming message is an ice candidate rather than an sdp description, it's simply delivered to the ice layer by passing it into the rtcpeerconnection method addicecandidate(). if an error occurs here and we didn't just discard an offer due to being the impolite peer during a collision, we throw the error so the caller can handle it. otherwise, we drop the error, ignoring it, since it doesn't matter in this context. perfect negotiation with the updated api the updated code takes advant...
XMLHttpRequest.upload - Web APIs
an upload's progress. it is an opaque object, but because it's also an xmlhttprequesteventtarget, event listeners can be attached to track its process. the following events can be triggered on an upload object and used to monitor the upload: event event listener description loadstart onloadstart the upload has begun. progress onprogress periodically delivered to indicate the amount of progress made so far. abort onabort the upload operation was aborted. error onerror the upload failed due to an error. load onload the upload completed successfully. timeout ontimeout the upload timed out because a reply did not arrive within the time interval specified by the xmlhttprequest.timeout. lo...
...out ontimeout the upload timed out because a reply did not arrive within the time interval specified by the xmlhttprequest.timeout. loadend onloadend the upload finished. this event does not differentiate between success or failure, and is sent at the end of the upload regardless of the outcome. prior to this event, one of load, error, abort, or timeout will already have been delivered to indicate why the upload ended. specifications specification status comment xmlhttprequest living standard whatwg living standard ...
Secure contexts - Web security
considered secure? a context is considered secure when it meets certain minimum standards of authentication and confidentiality defined in the secure contexts specification. a particular document is considered to be in a secure context when it is the active document of a top-level browsing context (basically, a containing window or tab) that is a secure context. for example, even for a document delivered over tls within an <iframe>, its context is not considered secure if it has an ancestor that was not also delivered over tls. however, it’s important to note that if a non-secure context causes a new window to be created (with or without specifying noopener), then the fact that the opener was insecure has no effect on whether the new window is considered secure. that’s because the determinat...
...ing noopener), then the fact that the opener was insecure has no effect on whether the new window is considered secure. that’s because the determination of whether or not a particular document is in a secure context is based only on considering it within the top-level browsing context with which it is associated — and not whether a non-secure context happened to be used to create it. locally-delivered resources such as those with http://127.0.0.1 urls, http://localhost urls (under certain conditions), and file:// urls are also considered to have been delivered securely. resources that are not local, to be considered secure, must meet the following criteria: must be served over https:// or wss:// urls the security properties of the network channel used to deliver the resource must not be c...
Subresource Integrity - Web security
it works by allowing you to provide a cryptographic hash that a fetched resource must match. note: for subresource-integrity verification of a resource served from an origin other than the document in which it’s embedded, browsers additionally check the resource using cross-origin resource sharing (cors), to ensure the origin serving the resource allows it to be shared with the requesting origin. ...
...ains control of a cdn, the attacker can inject arbitrary malicious content into files on the cdn (or replace the files completely) and thus can also potentially attack all sites that fetch files from that cdn. subresource integrity enables you to mitigate some risks of attacks such as this, by ensuring that the files your web application or web document fetches (from a cdn or anywhere) have been delivered without a third-party having injected any additional content into those files — and without any other changes of any kind at all having been made to those files. using subresource integrity you use the subresource integrity feature by specifying a base64-encoded cryptographic hash of a resource (file) you’re telling the browser to fetch, in the value of the integrity attribute of any <scrip...
page-worker - Archive of obsolete content
fires contentscriptoptions read-only value exposed to content scripts under self.options property. any kind of jsonable value (object, array, string, etc.) can be used here. optional. events message if you listen to this event you can receive message events from content scripts associated with this page worker. when a content script posts a message using self.postmessage(), the message is delivered to the add-on code in the page worker's message event. arguments value : listeners are passed a single argument which is the message posted from the content script. the message can be any json-serializable value error this event is emitted when an uncaught runtime error occurs in one of the page worker's content scripts. arguments error : listeners are passed a single argument, the error ob...
panel - Archive of obsolete content
any kind of jsonable value (object, array, string, etc.) can be used here. optional. events show this event is emitted when the panel is shown. hide this event is emitted when the panel is hidden. message if you listen to this event you can receive message events from content scripts associated with this panel. when a content script posts a message using self.postmessage(), the message is delivered to the add-on code in the panel's message event. arguments value : listeners are passed a single argument which is the message posted from the content script. the message can be any json-serializable value. error this event is emitted when an uncaught runtime error occurs in one of the panel's content scripts. arguments error : listeners are passed a single argument, the error object. ...
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
ing extensions for firefox. all of these documents currently assume, however, that you are developing your extension using xul and javascript only. for complex extensions, it may be necessary to create components in c++ that provide additional functionality. reasons why you might want to include c++ components in your extension include: need for high-performance beyond what can be delivered by javascript code. use of third-party libraries written in c or c++. use of mozilla interfaces that are not exposed via xpcom (e.g. nspr). note: with the modern jit javascript engine in gecko and js-ctypes more extension code can be written only in javascript than ever before. please consider all of your options carefully before deciding to use native code (c++) i...
External CVS snapshots in mozilla-central - Archive of obsolete content
eventually we'd like to have acls, but as of today there is no protection for accidental commits to those directories. such changes will get overwritten without warning on importing the next updated version. ...
Repackaging Firefox - Archive of obsolete content
not need to include any properties files at all. note that you must know which preferences are localizable and which ones aren't. see the mdc documentation for more information on them. important extension preferences there is a small set of preferences which will be given to you by mozilla. they help mozilla track your distribution, and plan upgrades accordingly. they allow for upgrades to be delivered by mozilla specifically for your distribution, if need be, and because of that they are the most important preferences you need to set. mozilla will provide you with the values you will need here. note that the app.partner.'name' setting uses the same value for both the name and the value of the preference. all of these settings are non-localizable, so they are set directly in partner.js and do...
Introducing the Audio API extension - Archive of obsolete content
so affect the streaming of this raw audio data. the 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" ...
Remote XUL - Archive of obsolete content
note: support for remote xul has long been a potential security concern; support for it was disabled in gecko 2.0. this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true. however, there is a whitelist that lets you specify sites that can still use remote xul. ...
SVG And Canvas In Mozilla - Archive of obsolete content
today's web browsers offer somewhat limited graphics capabilities to web developers. advances in hardware, especially graphics processors, offer the potential for far richer graphics in interactive applications. to realize this potential in web applications, browsers must expose rich new graphics apis to web content. the mozilla project will meet this challenge with two major new features to be delivered in firefox 1.5: integrated svg and a new canvas html element. work is also underway "under the hood" on a new unified graphics architecture that uses 3d graphics processors to accelerate all rendering. this work provides additional benefits to web developers such as the ability to apply svg effects to html content. questions and discussion rich web: svg and canvas in mozilla - discussion ...
XTech 2005 Presentations - Archive of obsolete content
today's web browsers offer somewhat limited graphics capabilities to web developers. advances in hardware, especially graphics processors, offer the potential for far richer graphics in interactive applications. to realize this potential in web applications, browsers must expose rich new graphics apis to web content. the mozilla project will meet this challenge with two major new features to be delivered in firefox 1.1: integrated svg and a new canvas html element. work is also underway "under the hood" on a new unified graphics architecture that uses 3d graphics processors to accelerate all rendering. this work provides additional benefits to web developers such as the ability to apply svg effects to html content. extending gecko with xbl and xtf - brian ryner this session explored ways to ...
Toolbar customization events - Archive of obsolete content
when toolbars are customized, events are sent to their parent window. you can use window.addeventlistener() to listen for these events in order to keep abreast of changes to toolbars. none of these events contain any data; if you need details, you'll need to look at the toolbar. beforecustomization this event is delivered when the user starts the toolbar customization process; for example, by right-clicking on a toolbar and choosing "customize". customizationchange this event is delivered when the user makes a change to a toolbar while editing the toolbars, either by dragging an item to the toolbar or by dragging an item out of it. aftercustomization this event is delivered when the user closes the toolbar customization panel. in all cases, the event.target is the toolbox...
Using the standard theme - Archive of obsolete content
ning, there is no style when creating a new xul <tt>window</tt> (or a new <tt>dialog</tt>, for that matter) in your extension, and you do not associate a style sheet with it, your widgets will be unstyled. meaning, some internal default will be applied, which does by no means correspond to the standard theme (the theme currently chosen by the user in the theme selector), or even the default theme delivered with your the base application. applying the standard theme in order to use the theme currently chosen by the user of the base application (the so called "global skin"), you have to add the following line to your xul file: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> this imports the styles found in the <tt>global/skin</tt> chrome directory and will make the standard xul wid...
Archived Mozilla and build documentation - Archive of obsolete content
egration with the operating system and desktop than a typical web application running through a web browser. applications running in an ssb are therefore able to benefit from many of the advantages of the desktop and of the web at the same time. proxy ui (recently added - some support for reading os and account settings.) remote xul how to use xul delivered from a webserver, not as part of chrome. space manager detailed design the space manager and related classes and structures are an important of the gecko layout system, specifically block layout. see the high level design document for an overview of the space manager, and as an introduction to the classes, structures and algorithms container in this, the detaile...
TCP/IP Security - Archive of obsolete content
ew macs will differ. peer authentication. each ssl endpoint can confirm the identity of the other ssl endpoint with which it wishes to communicate, ensuring that the network traffic and data is being sent from the expected host. ssl authentication is typically performed one-way, authenticating the server to the client, but it can be performed mutually. replay protection. the same data is not delivered multiple times, and data is not delivered grossly out of order. original document information author(s): sheila frankel, paul hoffman, angela orebaugh, and richard park title: national institute of standards and technology (nist) special publication 800-113, guide to ssl vpns last updated date: july 2008 copyright information: this document is not subject to copyright. ...
LiveConnect Overview - Archive of obsolete content
sobject allows java code to access javascript methods and properties. netscape.javascript.jsexception allows java code to handle javascript errors. see the javascript reference for more information about these classes. locating the liveconnect classes in older versions of the netscape browser, these classes were distributed along with the browser. starting with javascript 1.2, these classes are delivered in a .jar file; in previous versions of javascript, these classes are delivered in a .zip file. for example, with netscape navigator 4 for windows nt, the classes are delivered in the java40.jar file in the program\java\classes directory beneath the navigator directory. more recently, the classes have been distributed with sun's java runtime; initially in the file "jaws.jar" in the "jre/lib" dire...
Plug-in Development Overview - Gecko Plugin API Reference
rame for display, or to deliver the data of that url to the plug-in instance in a new stream. the npn_geturlnotify function operates like npn_geturl, except that it notifies the plug-in of the result when the operation completes. use npn_posturl to send data to a url from a memory buffer or file. the result from the server can also be sent to a particular browser window or frame for display, or delivered to the plug-in instance in a new stream. the npn_posturlnotify function operates like npn_posturl, except that it notifies the plug-in of the result when the operation completes. for information about using these methods, see urls. starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), you can get the origin of the document in a secure, convenient way by calling npn_getvalu...
DTLS (Datagram Transport Layer Security) - MDN Web Docs Glossary: Definitions of Web-related terms
however, dtls gains the benefits of datagram protocols, too; in particular, the lower overhead and reduced latency. ...
HTTP/2 - MDN Web Docs Glossary: Definitions of Web-related terms
ics of http in any way. all the core concepts found in http 1.1, such as http methods, status codes, uris, and header fields, remain in place. instead, http/2 modifies how the data is formatted (framed) and transported between the client and server, both of which manage the entire process, and hides application complexity within the new framing layer. as a result, all existing applications can be delivered without modification. ...
SRI - MDN Web Docs Glossary: Definitions of Web-related terms
subresource integrity (sri) is a security feature that enables browsers to verify that files they fetch (for example, from a cdn) are delivered without unexpected manipulation. it works by allowing you to provide a cryptographic hash that a fetched file must match. learn more subresource integrity content-security-policy: require-sri-for ...
TCP - MDN Web Docs Glossary: Definitions of Web-related terms
tcp (transmission control protocol) is an important network protocol that lets two hosts connect and exchange data streams. tcp guarantees the delivery of data and packets in the same order as they were sent. vint cerf and bob kahn, who were darpa scientists at the time, designed tcp in the 1970s. tcp role is to ensure the packets are reliably delivered, error free. tcp has concurrence control, which means the initial requests start small, increasing in size to the levels of bandwidth the computers, servers, and network can support. ...
How do you make sure your website works properly? - Learn web development
image we expected! open firefox's network tool (tools ➤ web developer ➤ network) and reload the page: there's the problem, that "404" at the bottom. "404" means "resource not found", and that's why we didn't see the image. http statuses servers respond with a status message whenever they receive a request. here are the most common statuses: 200: ok the resource you asked for was delivered. 301: moved permanently the resource has moved to a new location. you won't see this much in your browser, but it's good to know about "301" since search engines use this information a lot to update their indexes. 304: not modified the file has not changed since the last time you asked for it, so your browser can display the version from its cache, resulting in faster response times and more ...
How does the Internet work? - Learn web development
n 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 cables: a single plug for each computer and a router with 10 plugs. a network of networks so far so good. but what about connecting hundreds, thousands, billions of computers? of course a single router can't scale that far, but, if you read carefully, we said that a router is a computer like any o...
What is a URL? - Learn web development
are not relevant for regular users or web developers. don't worry about this, you don't need to know them to build and use fully functional urls. you might think of a url like a regular postal mail address: the protocol represents the postal service you want to use, the domain name is the city or town, and the port is like the zip code; the path represents the building where your mail should be delivered; the parameters represent extra information such as the number of the apartment in the building; and, finally, the anchor represents the actual person to whom you've addressed your mail. how to use urls any url can be typed right inside the browser's address bar to get to the resource behind it. but this is only the tip of the iceberg! the html language — which will be discussed later on —...
Sending form data - Learn web development
client (usually a web browser) sends a request to a server (most of the time a web server like apache, nginx, iis, tomcat, etc.), using the http protocol. the server answers the request using the same protocol. an html form on a web page is nothing more than a convenient user-friendly way to configure an http request to send data to a server. this enables the user to provide information to be delivered in the http request. note: to get a better idea of how client-server architectures work, read our server-side website programming first steps module. on the client side: defining how to send the data the <form> element defines how the data will be sent. all of its attributes are designed to let you configure the request to be sent when a user hits a submit button. the two most important attr...
Multimedia: video - Learn web development
ownload up to 3% of the video on page load. this is a useful option for some small or moderately sized files. changing the setting to auto tells the browser to automatically download the entire video. do this only when playback is very likely. otherwise, it wastes a lot of bandwidth. consider streaming video streaming allows the proper video size and bandwidth (based on network speed) to be delivered to the end user. similar to responsive images, the correct size video is delivered to the browser, ensuring fast video startup, low buffering, and optimized playback. conclusion optimizing video has the potential to significantly improve website performance. video files are relatively large compared to other website files, and always worthy of attention. this article explains how to optimize w...
Website security - Learn web development
and user-uploaded files. always check and sanitize all incoming data. always assume the worst. a number of other concrete steps you can take are: use more effective password management. encourage strong passwords that are changed regularly. consider two-factor authentication for your site, so that in addition to a password the user must enter another authentication code (usually one that is delivered via some physical hardware that only the user will have, such as a code in an sms sent to their phone). configure your web server to use https and http strict transport security (hsts). https encrypts data sent between your client and server. this ensures that login credentials, cookies, post requests data and header information are not easily available to attackers. keep track of the most popu...
Git and GitHub - Learn web development
ittle more depth, explaining what a vcs is, what a repository is, how the basic github model works, git commands and examples, and more. forking projects (from github) forking projects is essential when you want to contribute to someone else's code. this guide explains how. about pull requests (from github) a useful guide to managing pull requests, the way that your suggested code changes are delivered to people's repositories for consideration. mastering issues (from github) issues are like a forum for your github project, where people can ask questions and report problems, and you can manage updates (for example assigning people to fix issues, clarifying the issue, letting people know things are fixed). this articles gives you what you need to know about issues. note: there is a lot more...
Accessibility Features in Firefox
eir software: contributes accessible web applications (dhtml and ajax) ibm realized it needed a way to enable accessibility for ever more powerful web applications, beyond what you see on typical web pages today. rather than go and write their own new web browser, ibm decided to trust in the openness of the mozilla community, which accepted ibm's significant contributions. for example, ibm has delivered over 50,000 lines of code to enable accessibility in firefox on windows and especially for this new powerful world of "web applications". a web application may be an easier-to-use online tax assistant, a web calendar or a live sports statistics page, which is familiar in that it acts much like a desktop application. whether the current buzzword for this technology is "dhtml", "ajax" or "web 2.0" ...
CSUN Firefox Materials
ir software: ibm contributes accessible web applications (dhtml and ajax) ibm realized it needed a way to enable accessibility for ever more powerful web applications, beyond what you see on typical web pages today. rather than go and write their own new web browser, ibm decided to trust in the openness of the mozilla community, which accepted ibm's significant contributions. for example, ibm has delivered over 50,000 lines of code to enable accessibility in firefox on windows and especially for this new powerful world of "web applications". a web application may be an easier-to-use online tax assistant, a web calendar or a live sports statistics page, which is familiar in that it acts much like a desktop application. whether the current buzzword for this technology is "dhtml", "ajax" or "web 2.0" ...
AddonManager
the callbacks will be called just once but that may be before or after the method returns. one of the forces of the addonmanager is that it deals with any kind (type) of add-on in a generic manner. to do so many methods of the addonmanager take the add-on types as parameters. ...
Add-on Repository
ns() begins a search for recommended add-ons in the repository. the list of recommended add-ons frequently changes. results will be passed to the given searchcallback callback. void retrieverecommendedaddons( in integer maxresults, in searchcallback callback ); parameters maxresults the maximum number of results to return. callback the searchcallback callback to which results will be delivered. searchaddons() begins a search for add-ons in this repository. results will be passed to the given callback. string searchaddons( in string searchterms, in integer maxresults, in searchcallback callback ); parameters searchterms the search terms to pass to amo. the results will match what you would get if you typed this string in the search box on the amo web site. maxresults th...
Fonts for Mozilla's MathML engine
-sf android you must use the mathml-fonts add-on. note: there is an enhancement request opened on the noto bug tracker to improve math support. firefox os you must use the mathml-fonts add-on. note: we plan to bundle a math font in the default installation. other systems on other systems, consider installing a math font using your package manager. note that these fonts are generally delivered with tex distributions such as tex live, but you might need to follow specific instructions so that your system is aware of the fonts. as a last resort, install the mathml fonts add-on. advanced setup arabic mathematical alphabetic symbols currently, very few fonts have appropriate glyphs for the arabic mathematical alphabetic symbols. if you are likely to need these characters, we recommend t...
Introduction to NSPR
. another thread could target the waiting thread and issue a pr_interrupt, causing a waiting thread to resume. in such cases the return from the wait operation indicates a failure and definitively indicates that the cause of the failure is an interrupt. a call to pr_waitcondvar may also resume because the interval specified on the wait call has expired. however, this fact cannot be unambiguously delivered, so no attempt is made to do so. if the logic of a program allows for timing of waits on conditions, then the clock must be treated as part of the monitored data and the amount of time elapsed re-asserted when the call returns. philosophically, timeouts should be treated as explicit notifications, and therefore require the testing of the monitored data upon resumption. nspr sample code the docu...
PR_Interrupt
at it is doing and return to some control point. it is assumed that a control point has been mutually arranged between the thread doing the interrupting and the thread being interrupted. when the interrupted thread reaches the prearranged point, it can communicate with its peer to discover the real reason behind the change in plans. the interrupt request remains in the thread's state until it is delivered exactly once or explicitly canceled. the interrupted thread returns pr_failure (-1) with an error code (see pr_geterror) for blocking operations that return a prstatus (such as i/o operations, monitor waits, or waiting on a condition). to check whether the thread was interrupted, compare the result of pr_geterror with pr_pending_interrupt_error. pr_interrupt may itself fail if the target thread ...
PR_NewUDPSocket
esc* pr_newudpsocket(void); returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened udp socket. if the creation of a new udp socket failed, null. description udp (user datagram protocol) is a connectionless, unreliable datagram protocol of the tcp/ip protocol suite. udp datagrams may be lost or delivered in duplicates or out of sequence. pr_newudpsocket creates a new udp socket. the socket may be bound to a well-known port number with pr_bind. datagrams can be sent with pr_sendto and received with pr_recvfrom. when the socket is no longer needed, it should be closed with a call to pr_close. see also pr_newudpsocket is deprecated because it is hardcoded to create an ipv4 udp socket. new code sh...
PR OpenUDPSocket
ted on posix systems only). returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened udp socket. if the creation of a new udp socket failed, null. description udp (user datagram protocol) is a connectionless, unreliable datagram protocol of the tcp/ip protocol suite. udp datagrams may be lost or delivered in duplicates or out of sequence. pr_openudpsocket creates a new udp socket of the address family af. the socket may be bound to a well-known port number with pr_bind. datagrams can be sent with pr_sendto and received with pr_recvfrom. when the socket is no longer needed, it should be closed with a call to pr_close. ...
Threads
capable of associating private data with the new index. pr_setthreadprivate associates private thread data with an index. pr_getthreadprivate retrieves data associated with an index. interrupting and yielding pr_interrupt requests an interrupt of another thread. once the target thread has been notified of the request, the request stays with the thread until the notification either has been delivered exactly once or is cleared. pr_clearinterrupt clears a previous interrupt request. pr_sleep causes a thread to yield to other threads for a specified number of ticks. setting global thread concurrency pr_setconcurrency sets the number of global threads used by nspr to create local threads. getting a thread's scope pr_getthreadscope gets the scoping of the current thread. ...
nss tech note8
extern pruint32 ssl3_sid_timeout; (the ssl3 session lifetime) each of these variables applied to both client and server sessions. that is, the client session lifetime was not separately settable from the server session lifetime. these two variables were private, declared in a private header file. there was no api function by which client programs could set these values. however since nss was delivered as archive libraries, client programs merely declared these two variables for themselves, and then were able to alter those variables directly. for server programs, the function for initializing the server session cache would set these two variables according to two of the arguments to that function. so, ssl protocol code that wanted to cache a sid would do these steps, whether for client or fo...
nsIAsyncInputStream
ethod. pass zero to specify no flags. arequestedcount wait until at least this many bytes can be read. this is only a suggestion to the underlying stream; it may be ignored. the caller may pass zero to indicate no preference. aeventtarget specify null to receive notification on any thread (possibly even recursively on the calling thread, that is synchronously), or specify that the notification be delivered to a specific event target. closewithstatus() this method closes the stream and sets its internal status. if the stream is already closed, then this method is ignored. once the stream is closed, the stream's status cannot be changed. any successful status code passed to this method is treated as ns_base_stream_closed, which has an effect equivalent to nsiinputstream.close(). note: this method ex...
nsIAsyncOutputStream
od. pass zero to specify no flags. arequestedcount wait until at least this many bytes can be written. this is only a suggestion to the underlying stream; it may be ignored. the caller may pass zero to indicate no preference. aeventtarget specify null to receive notification on any thread (possibly even recursively on the calling thread, that is synchronously), or specify that the notification be delivered to a specific event target. closewithstatus() this method closes the stream and sets its internal status. if the stream is already closed, then this method is ignored. once the stream is closed, the stream's status cannot be changed. any successful status code passed to this method is treated as ns_base_stream_closed, which has an effect equivalent to nsiinputstream.close(). note: this method ex...
nsIDOMOrientationEvent
dom/interfaces/events/nsidomorientationevent.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsidomevent method overview void initorientationevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z); attributes attribute type description x double the amount of tilt along the x axis. read only. ...
nsIDOMWindowUtils
le( in nsidomelement aelement, in astring apseudoelement, in astring apropertyname ); parameters aelement apseudoelement apropertyname return value isinmodalstate() is the window is in a modal state? [see entermodalstate()] boolean isinmodalstate(); parameters none. return value leavemodalstate() resume normal window state, where scripts can run and events are delivered. void leavemodalstate(); parameters none. loadsheet() synchronously loads a style sheet from |sheeturi| and adds it to the list of additional style sheets of the document. these additional style sheets are very much like user/agent sheets loaded with loadandregistersheet. the only difference is that they are applied only on the document owned by this window. sheets added via this api ta...
nsIEventListenerService
idomeventlistener listener, in boolean usecapture); attributes attribute type description systemeventgroup nsidomeventgroup returns system event group. read only. obsolete since gecko 7.0 methods geteventtargetchainfor() returns an array of event targets indicating all the targets that will receive the same events that are delivered to the specified target. aeventtarget will be at index 0. the objects are the ones that would be used as event.currenttarget while dispatching an event to aeventtarget. note: some events, especially 'load', may actually have a shorter event target chain than what this methods returns. void geteventtargetchainfor( in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retva...
nsIExternalHelperAppService
boolean applydecodingforextension( in autf8string aextension, in acstring aencodingtype ); parameters aextension the filename extension to check. aencodingtype the encoding type to check. return value true if data from urls with the specified extension and encoding should be decoded prior to saving the file or delivering it to a helper application; o...
nsIFrameMessageManager
f the message for which to remove a listener. alistener an object implementing nsiframemessagelistener to stop receiving messages. sendasyncmessage() asynchronously sends a message to the listeners. void sendasyncmessage( in astring amessage, in astring json ); parameters amessage the name of the message to send to the listeners. json optional a json object containing data to be delivered to the listeners. see also content process event handling nsiframemessagelistener nsisyncmessagesender ...
nsIHttpChannelInternal
equest header in conjunction with a 101 level response. the nsihttpupgradelistener will have its nsihttpupgradelistener.ontransportavailable() method invoked if a matching 101 is processed. the arguments to nsihttpupgradelistener.ontransportavailable() provide to the new protocol the low level transport streams that are no longer used by http. the onstartrequest and onstoprequest events are still delivered and the listener gets full control over the socket if and when nsihttpupgradelistener.ontransportavailable() is delivered. void httpupgrade( in acstring aprotocolname, in nsihttpupgradelistener alistener ); parameters aprotocolname the value of the http upgrade request header. alistener the callback object used to handle a successful upgrade. setcookie() helper method to set a cookie with a...
nsIMessageBroadcaster
gename, [optional] in jsval obj, [optional] in jsval objects); nsimessagelistenermanager getchildat(in unsigned long aindex); broadcastasyncmessage() like sendasyncmessage(), but also broadcasts this message to all "child" message managers of this message manager. see nsimessagelistener::receivemessage() for the format of the data delivered to listeners. warning: broadcasting messages can be very expensive and leak sensitive data. use with extreme caution. throws ns_error_not_initialized if the sender is not initialized. for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_error_failure when the message receiver cannot b...
nsISmsService
ds createsmsmessage() [implicit_jscontext] nsidommozsmsmessage createsmsmessage( in long id, in domstring delivery, in domstring sender, in domstring receiver, in domstring body, in jsval timestamp, in bool read ); parameters id a number representing the id of the message. delivery a domstring which can either be "received" or "sent" and is representing the way the sms was delivered. sender a domstring with the name of the sender. receiver a domstring with the name of the receiver. body a domstring with the text of the message. timestamp a date object with the timestamp of the message. read a boolean indicating whether a message is marked as read or unread. return value a smsmessage getnumberofmessagesfortext() unsigned short getnumberofmessagesfortext( in ...
nsISocketTransportService
return value an nsisockettransport containing the sockettransport. init() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void init(); parameters none. native code only! notifywhencanattachsocket if the number of sockets reaches the limit, then consumers can be notified when the number of sockets becomes less than the limit. the notification is asynchronous, delivered via the given nsirunnable instance on the socket transport thread. note: this function may only be called from an event dispatch on the socket thread. void notifywhencanattachsocket( in nsirunnable aevent ); parameters aevent event that will receive the notification when a new socket can be attached. shutdown() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) ...
nsITransport
if null, then the notifications may occur on any thread. ...
nsIWebProgress
nly. exceptions thrown ns_error_failure indicates that there is no associated dom window. isloadingdocument prbool indicates whether or not a document is currently being loaded in the context of this nsiwebprogress instance. read only. constants the following flags may be combined to form the anotifymask parameter for the addprogresslistener() method. they limit the set of events that are delivered to an nsiwebprogresslistener instance. these flags indicate the state transistions to observe, corresponding to nsiwebprogresslistener.onstatechange(). constant value description notify_state_request 0x00000001 only receive the nsiwebprogresslistener.onstatechange() event if the astateflags parameter includes nsiwebprogresslistener::state_is_request. notify_state_document 0x00000002 only r...
nsMsgFolderFlagType
; /** @} */ /** @name mail folder flags * these flags only occur in folders which have * the nsmsgfolderflags::mail bit set, and do * not have the nsmsgfolderflags::directory or * nsmsgfolderflags::elided bits set. * @{ */ /// whether this is the trash folder. const nsmsgfolderflagtype trash = 0x00000100; /// whether this is a folder that sent mail gets delivered to. const nsmsgfolderflagtype sentmail = 0x00000200; /// whether this is the folder in which unfinised, unsent messages are saved for later editing. const nsmsgfolderflagtype drafts = 0x00000400; /// whether this is the folder in which messages are queued for later delivery. const nsmsgfolderflagtype queue = 0x00000800; /// whether this is the primary inbox f...
nsMsgMessageFlags
0x00000080 indicates whether or not we have this message in the offline cache. watched 0x00000100 indicates whether or not this thread is being watched. senderauthed 0x00000200 partial 0x00000400 indicates whether or not the body we have is a complete message. queued 0x00000800 indicates whether or not the message is queued to be delivered. forwarded 0x00001000 indicates whether or not the message has been forwarded. priorities 0x0000e000 the set of bits that indicate the priority. new 0x00010000 indicates whether or not the message is new since the last time the folder was opened. ignored 0x00040000 indicates whether or not the (sub-)thread has been ignored. imap...
Mail composition back end
messages sending unsent messages listener quoting sample programs overview i've done considerable work in the past few weeks reorganizing the mail composition back end, so i thought it would be helpful to put together a small doc on the new interfaces and how one can use them. the mail composition back end is responsible for the assembly and creation of rfc822 messages to be delivered either via smtp or nntp services. you also have the ability to save rfc822 files to disk, should you need this data for some reason. included in this functionality is the code to copy the messages to the appropriate locations after delivery (i.e. a "sent" folder) as well as the ability to store messages for features like "drafts" and "templates". several (but not all) of these interfaces are spec...
Plug-in Development Overview - Plugins
rame for display, or to deliver the data of that url to the plug-in instance in a new stream. the npn_geturlnotify function operates like npn_geturl, except that it notifies the plug-in of the result when the operation completes. use npn_posturl to send data to a url from a memory buffer or file. the result from the server can also be sent to a particular browser window or frame for display, or delivered to the plug-in instance in a new stream. the npn_posturlnotify function operates like npn_posturl, except that it notifies the plug-in of the result when the operation completes. for information about using these methods, see urls. starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), you can get the origin of the document in a secure, convenient way by calling npn_getvalu...
CloseEvent - Web APIs
constructor closeevent() creates a new closeevent. properties this interface also inherits properties from its parent, event. closeevent.code read only returns an unsigned short containing the close code sent by the server. the following values are permitted status codes. the following definitions are sourced from the iana website [ref]. note that the 1xxx codes are only websocket-internal and not for the same meaning by the transported data (like when the application-layer protocol is invalid). ...
CrashReportBody - Web APIs
report-to header. it is difficult to retrieve a crash report via a reportingobserver, as by that point the page would have crashed! some sample json might look like this: { "type": "crash", "age": 42, "url": "https://example.com/", "user_agent": "mozilla/5.0 (x11; linux x86_64; rv:60.0) gecko/20100101 firefox/60.0", "body": { "reason": "oom" } } note: crash reports are always delivered to the endpoint group named default; there is currently no way to override this. if you want to receive other kinds of reports, but not crash reports, make sure to use a different name for the endpoint group that you choose for those reports. specifications specification status comment reporting apithe definition of 'crashreportbody' in that specification. editor's ...
DedicatedWorkerGlobalScope.postMessage() - Web APIs
any value or javascript object handled by the structured clone algorithm, which includes cyclical references. the main scope that spawned the worker can send back information to the thread that spawned it using the worker.postmessage method. syntax postmessage(amessage, transferlist); parameters amessage the object to deliver to the main thread; this will be in the data field in the event delivered to the worker.onmessage handler. this may be any value or javascript object handled by the structured clone algorithm, which includes cyclical references. transferlist optional an optional array of transferable objects to transfer ownership of. if the ownership of an object is transferred, it becomes unusable (neutered) in the context it was sent from and it becomes available only to the main t...
Element.requestFullscreen() - Web APIs
to do. return value a promise which is resolved with a value of undefined when the transition to full screen is complete. exceptions rather than throw a traditional exception, the requestfullscreen() procedure announces error conditions by rejecting the promise it has returned. the rejection handler receives one of the following exception values: typeerror the typeerror exception may be delivered in any of the following situations: the document containing the element isn't fully active; that is, it's not the current active document. the element is not contained by a document. the element is not permitted to use the "fullscreen" feature, either because of feature policy configuration or other access control features. the element and its document are the same node. usage not...
EventSource - Web APIs
the eventsource interface is web content's interface to server-sent events. an eventsource instance opens a persistent connection to an http server, which sends events in text/event-stream format. the connection remains open until closed by calling eventsource.close(). once the connection is opened, incoming messages from the server are delivered to your code in the form of events. if there is an event field in the incoming message, the triggered event is the same as the event field value. if no event field is present, then a generic message event is fired. unlike websockets, server-sent events are unidirectional; that is, data messages are delivered in one direction, from the server to the client (such as a user's web browser). that makes them an excellent choice when there's no need to send da...
EventTarget.addEventListener() - Web APIs
common targets are element, document, and window, but the target may be any object that supports events (such as xmlhttprequest). addeventlistener() works by adding a function or an object that implements eventlistener to the list of event listeners for the specified event type on the eventtarget on which it's called. ...
GlobalEventHandlers.onpointerleave - Web APIs
this event is part of the pointer events api. syntax eventtarget.onpointerleave = leavehandler; var leavehandler = eventtarget.onpointerleave; value leavehandler the eventlistener which will be invoked to handle pointerleave events sent to the target. example this example shows two ways to use onpointerleave to set an element's pointerleave event handler. ...
HTMLMediaElement.load() - Web APIs
ad process is aborted and the abort event is sent. if the element has already been initialized with media, the emptied event is sent. if resetting the playback position to the beginning of the media actually changes the playback position (that is, it was not already at the beginning), a timeupdate event is sent. once media has been selected and loading is ready to begin, the loadstart event is delivered. from this point onward, events are sent just like any media load. example this example finds a <video> element in the document and resets it by calling load(). var mediaelem = document.queryselector("video"); mediaelem.load(); specifications specification status comment html living standardthe definition of 'htmlmediaelement.load()' in that specification. livin...
IDBDatabase.transaction() - Web APIs
2702), which is the same behaviour as other indexeddb-supporting browsers. previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. the complete event may thus be delivered quicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or there is a loss of system power before the data is flushed to disk. since such catastrophic events are rare most consumers should not need to concern themselves further. note: in firefox, if you wish to ensure durability for some reason (e.g. you're storing critical data tha...
IDBTransaction.oncomplete - Web APIs
2702), which is the same behaviour as other indexeddb-supporting browsers. previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. the complete event may thus be delivered quicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or there is a loss of system power before the data is flushed to disk. note: this feature is available in web workers. note: in firefox, if you wish to ensure durability for some reason (e.g. you're storing critical data that cannot be recomputed later) you can force a transacti...
IDBTransaction - Web APIs
e relaxed durability guarantees to increase performance (see bug 1112702.) previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. the complete event may thus be delivered quicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or there is a loss of system power before the data is flushed to disk. since such catastrophic events are rare, most consumers should not need to concern themselves further. if you must ensure durability for some reason (e.g. you're storing critical data that cannot be recomputed ...
Basic concepts - Web APIs
teed to have been flushed to disk. as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which is the same behaviour as other indexeddb-supporting browsers. in this case the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. the event may thus be delivered quicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or there is a loss of system power before the data is flushed to disk. since such catastrophic events are rare, most consumers should not need to concern themselves further. note: in firefox, if you wish to ensure durability for some reason (e.g. you're storing critical data th...
Using IndexedDB - Web APIs
e relaxed durability guarantees to increase performance (see bug 1112702.) previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but potentially before that data has actually been flushed to disk. the complete event may thus be delivered quicker than before, however, there exists a small chance that the entire transaction will be lost if the os crashes or there is a loss of system power before the data is flushed to disk. since such catastrophic events are rare most consumers should not need to concern themselves further. if you must ensure durability for some reason (e.g. you're storing critical data that cannot be recomputed la...
IntersectionObserverEntry - Web APIs
properties intersectionobserverentry.boundingclientrect read only returns the bounds rectangle of the target element as a domrectreadonly. ...
KeyboardEvent - Web APIs
level 3 events. keyboardevent.which read only returns a number representing a system and implementation dependent numeric code identifying the unmodified value of the pressed key; this is usually the same as keycode. warning: this attribute is deprecated; you should use keyboardevent.key instead, if available. events the following events are based on the keyboardevent type. they can be delivered to any object which implements globaleventhandlers, including element, document, and window. in the list below, each event links to the documentation for the document handler for the event, which applies generally to all of the recipients. keydown a key has been pressed. keyup a key has been released. obsolete events keypress a key that normally produces a character value has been p...
MediaQueryList - Web APIs
a query status, which happens any time the document switches between matching and not matching the media queries listed in the mediaquerylist. this method has been kept for backward compatibility; if possible, you should generally use removeeventlistener() to remove change notification callbacks (which should have previously been added using addeventlistener()). events the following events are delivered to mediaquerylist objects: change sent to the mediaquerylist when the result of running the media query against the document changes. for example, if the media query is (min-width: 400px), the change event is fired any time the width of the document's viewport changes such that its width moves across the 400px boundary in either direction. also available using the onchange event handler prop...
MediaRecorderErrorEvent() - Web APIs
syntax var errorevent = new mediarecordererrorevent(errorinfo) parameters errorinfo an object describing the error object to be created. it must contain the error property at a minimum. ...
MerchantValidationEvent() - Web APIs
omstring containing the payment method identifier for the payment handler being used. this is an empty string by default. validationurl optional the url from which to retrieve payment handler specific verification information used to validate the merchant. this is an empty string by default. return value a newly-created merchantvalidationevent providing the information that needs to be delivered to the client-side code to present to the user agent by calling complete(). exceptions typeerror the string specified as validationurl could not be parsed as a url. rangeerror the specified methodname does not correspond to a known and supported merchant or is not a well-formed standard payment method identifier. specifications specification status comment paymen...
MessagePort: message event - Web APIs
this is only needed when using the addeventlistener() method: if the receiver uses onmessage instead, start() is called implicitly: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.onmessage = (event) => { received.textcontent = event.data; }; }); specifications specification status html living standar...
MessagePort: messageerror event - Web APIs
this is only needed when using the addeventlistener() method: if the receiver uses onmessage instead, start() is called implicitly: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.onmessage = (event) => { received.textcontent = event.data; }; myport.onmessageerror = (event) => { console.error(event.data); }...
MutationObserver.takeRecords() - Web APIs
rior to disconnecting the observer, so that any pending mutations can be processed when stopping down the observer. syntax const mutationrecords = mutationobserver.takerecords() parameters none. return value an array mutationrecord objects, each describing one change applied to the observed portion of the document's dom tree. note: the queue of mutations which have occurred, but not been delivered to the observer's callback is left empty after calling takerecords(). example in this example, we demonstrate how to handle any undelivered mutationrecords by calling takerecords() just before disconnecting the observer. const targetnode = document.queryselector("#someelement"); const observeroptions = { childlist: true, attributes: true } const observer = new mutationobserver(callback);...
Navigator.getUserMedia() - Web APIs
the deprecated navigator.getusermedia() method prompts the user for permission to use up to one video input device (such as a camera or shared screen) and up to one audio input device (such as a microphone) as the source for a mediastream. if permission is granted, a mediastream whose video and/or audio tracks come from those devices is delivered to the specified success callback. if permission is denied, no compatible input devices exist, or any other error condition occurs, the error callback is executed with a mediastreamerror object describing what went wrong. if the user instead doesn't make a choice at all, neither callback is executed. this is a legacy method. please use the newer navigator.mediadevices.getusermedia() instead. while technically not deprecated, this old callback versio...
PaymentDetailsBase - Web APIs
tshippingoption objects, each describing one available shipping option from which the user may choose. derived dictionaries the following dictionaries include paymentdetailsbase. paymentdetailsinit provides payment information when calling the paymentrequest() constructor. paymentdetailsupdate provides updated payment details while the payment user interface is being handled. this can be delivered to the payment interface using either paymentdetailsupdateevent.updatewith() or by returning it from the optional detailsupdate promise provided to the paymentrequest.show() call that begins the user interaction. specifications specification status comment payment request apithe definition of 'paymentdetailsbase' in that specification. candidate recommendation ini...
PaymentRequest: paymentmethodchange event - Web APIs
for example, if the user switches from one credit card to another on their apple pay account, a paymentmethodchange event is fired to let you know about the change. bubbles no cancelable no interface paymentmethodchangeevent event handler property onpaymentmethodchange examples let's take a look at an example. this code creates a new paymentrequest, adds a handler for the paymentmethodchange event by calling the request's addeventlistener(), then calls show() to present the payment interface to the user. ...
PaymentResponse: payerdetailchange event - Web APIs
the event handler for payerdetailchange should check each value in the form that has changed and ensure that the values are valid. if any are invalid, appropriate error messages should be configured and the retry() method should be called on the paymentresponse to ask the user to update the invalid entries. ...
Payment Request API - Web APIs
he api is available inside cross-origin <iframe> elements only if they have had the allowpaymentrequest attribute set on them. interfaces paymentaddress an object that contains address information; used for billing and shipping addresses, for example. paymentrequest an object that provides the api for creating and managing the user agent's payment interface. paymentrequestevent an event delivered to a payment handler when a paymentrequest is made. paymentrequestupdateevent enables the web page to update the details of the payment request in response to a user action. paymentmethodchangeevent represents the user changing payment instrument (e.g., switching from a credit card to debit card). paymentresponse an object returned after the user selects a payment method and approves a paym...
Using Pointer Events - Web APIs
0, 2 * math.pi, false); // a circle at the start ctx.fillstyle = color; ctx.fill(); } after storing some of the event's processing in the ongoingtouches for later processing, the start point is drawn as a small circle. we're using a 4-pixel wide line, so a 4 pixel radius circle will show up neatly. drawing as the pointers move each time one or more pointers moves, a pointermove event is delivered, resulting in our handlemove() function being called. its responsibility in this example is to update the cached touch information and to draw a line from the previous position to the current position of each touch. function handlemove(evt) { var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); var color = colorfortouch(evt); var idx = ongoingtouchindexbyid...
Push API - Web APIs
Web › API › Push API
ve an active service worker. when the service worker is active, it can subscribe to push notifications, using pushmanager.subscribe(). the resulting pushsubscription includes all the information that the application needs to send a push message: an endpoint and the encryption key needed for sending data. the service worker will be started as necessary to handle incoming push messages, which are delivered to the serviceworkerglobalscope.onpush event handler. this allows apps to react to push messages being received, for example, by displaying a notification (using serviceworkerregistration.shownotification().) each subscription is unique to a service worker. the endpoint for the subscription is a unique capability url: knowledge of the endpoint is all that is necessary to send a message to your ...
RTCDataChannel.readyState - Web APIs
s is the state of a new rtcdatachannel after being created by rtcpeerconnection.createdatachannel() (on the peer which started the connection process). "open" the underlying data transport has been established and data can be transferred bidirectionally across it. this is the default state of a new rtcdatachannel created by the webrtc layer when the remote peer created the channel and delivered to the site or app in a datachannel event of type rtcdatachannelevent. "closing" the process of closing the underlying data transport has begun. it is no longer possible to queue new messages to be sent, but previously queued messages may still be send or received before entering the "closed" state. "closed" the underlying data transport has closed, or the attempt to make ...
RTCIceCandidateStats - Web APIs
uely identifiying the transport object that was inspected in order to obtain the rtctransportstats associated with the candidate correspondin to these statistics. url optional for local candidates, the url property is the url of the ice server from which the candidate was received. this url matches the one included in the rtcpeerconnectioniceevent object representing the icecandidate event that delivered the candidate to the local peer. example this example features a function, isusablenetworktype(), whose job it is to look at an rtcicecandidatestats object's networktype and determine whether or not the type of network is acceptable for use. this function is then called for rtcstats objects whose type is local-candidate, indicating that the object is in fact an rtcicecandidatestats with infor...
RTCIceTransport.getLocalCandidates() - Web APIs
syntax localcandidates = rtcicetransport.getlocalcandidates(); parameters none. ...
RTCIceTransport.getLocalParameters() - Web APIs
syntax parameters = rtcicetransport.getlocalparameters(); parameters none. ...
RTCIceTransport.getRemoteParameters() - Web APIs
syntax parameters = rtcicetransport.getremoteparameters(); parameters none. ...
RTCIceTransport.ongatheringstatechange - Web APIs
syntax rtcicetransport.ongatheringstatechange = statechangehandler; value a function to be called when the rtcicetransport object's gathering state changes. to determine the new state, examine the value of gatheringstate. ...
RTCIceTransport - Web APIs
parameters() returns a rtciceparameters object describing the ice parameters established by a call to the rtcpeerconnection.setlocaldescription() method. returns null if parameters have not yet been received. getremotecandidates() returns an array of rtcicecandidate objects, one for each of the remote device's ice candidates that have been received by the local end of the rtcpeerconnection and delivered to ice by calling addicecandidate(). getremoteparameters() returns a rtciceparameters object containing the ice parameters for the remote device, as set by a call to rtcpeerconnection.setremotedescription(). if setremotedescription() hasn't been called yet, the return value is null. getselectedcandidatepair() returns a rtcicecandidatepair object that identifies the two candidates—one for ea...
RTCPeerConnection.createOffer() - Web APIs
a single domexception object explaining why the request to create an offer failed. options optional an optional rtcofferoptions dictionary providing options requested for the offer. return value a promise whose fulfillment handler will receive an object conforming to the 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 t...
RTCPeerConnection.signalingState - Web APIs
). "have-local-pranswer" the offer sent by the remote peer has been applied and an answer has been created (usually by calling rtcpeerconnection.createanswer()) and applied by calling rtcpeerconnection.setlocaldescription(). this provisional answer describes the supported media formats and so forth, but may not have a complete set of ice candidates included. further candidates will be delivered separately later. "have-remote-pranswer" a provisional answer has been received and successfully applied in response to an offer previously sent and established by calling setlocaldescription(). "closed" the connection is closed. note: this value moved into the rtcpeerconnectionstate enum in the may 13, 2016 draft of the specification, as it reflects the s...
RTCPeerConnection: track event - Web APIs
see track event types in rtctrackevent for details. ...
RTCRtpContributingSource - Web APIs
f the media played out at the time indicated by timestamp. this value is a source-generated time value which can be used to help with sequencing and synchronization. source optional a 32-bit unsigned integer value specifying the csrc identifier of the contributing source. timestamp optional a domhighrestimestamp indicating the most recent time at which a frame originating from this source was delivered to the receiver's mediastreamtrack specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpcontributingsource' in that specification. candidate recommendation initial definition. ...
RTCTrackEvent() - Web APIs
the rtctrackevent() constructor creates and returns a new rtctrackevent object, configured to describe the track which has been added to the rtcpeerconnection. in general, you won't need to use this constructor, as rtctrackevent objects are created by webrtc and delivered to your rtcpeerconnector's ontrack event handler as appropriate. syntax trackevent = new rtctrackevent(eventinfo); parameters eventinfo an object based on the rtctrackeventinit dictionary, providing information about the track which has been added to the rtcpeerconnection. this object has the following properties: receiver the rtcrtpreceiver which is being used to receive the track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding track.
RTCTrackEvent - Web APIs
ray is empty, indicating a streamless track. track read only the mediastreamtrack which has been added to the connection. transceiver read only the rtcrtptransceiver being used by the new track. track event types there is only one type of track event. track the track event is sent to the rtcpeerconnection when a new track has been added to the connection. by the time the track event is delivered to the rtcpeerconnection's ontrack handler, the new media has completed its negotiation for a specific rtcrtpreceiver (which is specified by the event's receiver property). in addition, the mediastreamtrack specified by the receiver's track is the same one specified by the event's track, and the track has been added to any associated remote mediastream objects. you can add a track event listene...
Request.destination - Web APIs
er agent to, for example, help determine which set of rules to follow for cors purposes, or how to navigate any complicated code paths that affect how specific types of request get handled. these destinations vary substantially in how they operate. some are simply data receptacles, where the received data is stored for processing later. others are script-based, in which case the received data is delivered to a script by calling it and passing the data along. script-based destinations include <script> elements, as well as any of the worklet-based destinations (including audioworklet and paintworklet), and the worker-based destinations, including serviceworker and sharedworker. syntax var destination = request.destination; value a string from the requestdestination enumerated type which indicate...
Resize Observer API - Web APIs
concepts and usage there are a whole raft of use cases for responsive design techniques (and others besides) that respond to changes in an element's size, but previously their implementations have often been hacky and/or brittle. ...
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
"content-type": "application/json" }, body: json.stringify({ endpoint: subscription.endpoint }) }); }) ); }, false); when a pushsubscriptionchange event arrives, indicating that the subscription has expired, we resubscribe by calling the push manager's subscribe() method. when the returned promise is resolved, we receive the new subscription. this is delivered to the app server using a fetch() call to post a json formatted rendition of the subscription's endpoint to the app server. you can also use the onpushsubscriptionchange event handler property to set up the event handler: self.onpushsubscriptionchange = event => { event.waituntil(swregistration.pushmanager.subscribe(event.oldsubscription.options) .then(subscription => { /* ... */ ...
ServiceWorkerRegistration.showNotification() - Web APIs
e. tag: an id for a given notification that allows you to find, replace, or remove the notification using a script if necessary. timestamp: a domtimestamp representing the time when the notification was created. it can be used to indicate the time at which a notification is actual. for example, this could be in the past when a notification is used for a message that couldn’t immediately be delivered because the device was offline, or in the future for a meeting that is about to start. vibrate: a vibration pattern to run with the display of the notification. a vibration pattern can be an array with as few as one member. the values are times in milliseconds where the even indices (0, 2, 4, etc.) indicate how long to vibrate and the odd indices indicate how long to pause. for example, [300, 1...
Using Service Workers - Web APIs
the service worker for your page/site. the install event is fired when an install is successfully completed. the install event is generally used to populate your browser’s offline caching capabilities with the assets you need to run your app offline. to do this, we use service worker’s brand new storage api — cache — a global object on the service worker that allows us to store assets delivered by responses, and keyed by their requests. this api works in a similar way to the browser’s standard cache, but it is specific to your domain. it persists until you tell it not to — again, you have full control. note: the cache api is not supported in every browser. (see the browser compatibility section for more information.) if you want to use this now, you could consider using a polyfill...
USBEndpoint - Web APIs
usbdevice. usbendpoint.direction returns the direction in which this endpoint transfers data, one of: "in" - data is transferred from device to host. "out" - data is transferred from host to device. usbendpoint.type returns the type of this endpoint, one of: "bulk" - provides reliable data transfer for large payloads. data sent through a bulk endpoint is guaranteed to be delivered or generate an error but may be preempted by other data traffic. "interrupt" - provides reliable data transfer for small payloads. data sent through an interrupt endpoint is guaranteed to be delivered or generate an error and is also given dedicated bus time for transmission. "isochronous" - provides unreliable data transfer for payloads that must be delivered periodically. they are...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
nrestricted multi-user communication session. the very fact that rtcp is defined in the same rfc as rtp is a clue as to just how closely-interrelated these two protocols are. capabilities of rtp rtp's primary benefits in terms of webrtc include: generally low latency. packets are sequence-numbered and time-stamped for reassembly if they arrive out of order. this lets data sent using rtp be delivered on transports that don't guarantee ordering or even guarantee delivery at all. this means rtp can be — but is not required to be — used atop udp for its performance as well as its multiplexing and checksum features. rtp supports multicast; while this isn't yet important for webrtc, it's likely to matter in the future, when webrtc is (hopefully) enhanced to support multi-user conversations. ...
Taking still photos with WebRTC - Web APIs
rk. this will happen for example if there's no compatible camera connected, or the user denied access. listen for the video to start playing after calling htmlmediaelement.play() on the <video>, there's a (hopefully brief) period of time that elapses before the stream of video begins to flow. to avoid blocking until that happens, we add an event listener to video for the canplay event, which is delivered when the video playback actually begins. at that point, all the properties in the video object have been configured based on the stream's format. video.addeventlistener('canplay', function(ev){ if (!streaming) { height = video.videoheight / (video.videowidth/width); video.setattribute('width', width); video.setattribute('height', height); canvas.setattr...
Writing WebSocket servers - Web APIs
tion, 0x1 for text (which is always encoded in utf-8), 0x2 for binary, and other so-called "control codes" that will be discussed later. in this version of websockets, 0x3 to 0x7 and 0xb to 0xf have no meaning. the fin bit tells whether this is the last message in a series. if it's 0, then the server keeps listening for more parts of the message; otherwise, the server should consider the message delivered. more on this later. decoding payload length to read the payload data, you must know when to stop reading. that's why the payload length is important to know. unfortunately, this is somewhat complicated. to read it, follow these steps: read bits 9-15 (inclusive) and interpret that as an unsigned integer. if it's 125 or less, then that's the length; you're done. if it's 126, go to step 2. if ...
Inputs and input sources - Web APIs
urce => { switch(source) { case "left": lefthandsource = source; break; case "right": righthandsource = source; break; } }); }); the inputsourceschange event is also fired once when the session's creation callback first completes execution, so you can use it to fetch the input source list as soon as it's available at startup time. the event is delivered as an xrinputsourcechangeevent, which includes three properties of interest: session the xrsession for which the input sources have changed. added an array of zero or more xrinputsource objects indicating the input sources that have been newly added to the xr system. removed an array of zero or more xrinputsource objects indicating any input sources that have been removed from the xr syst...
WebXR permissions and security - Web APIs
ures are required or requested, the browser will only allow the session to be created if the call to requestsession() was made by code which is executing expressly due to user intent. specifically: if the requestsession() call isn't coming from within the handler executed in response to a user event, and is not being issued while launching a web application, the request is denied and false is delivered to the promise's fulfillment handler. if the document making the request isn't the one which is responsible for the script, the request is denied. if the document making the request isn't trustworthy, the request is denied and false is returned through the promise's fulfillment routine. a trustworthy document is one which is both responsible and active, and which currently has focus. if the us...
WebXR Device API - Web APIs
the position of each eye and rendering the scene from that position, looking in the direction the user is currently facing. each of these two images is rendered into a single framebuffer, with the left eye's rendered image on the left and the right eye's viewpoint rendered into the right half of the buffer. once both eyes' perspectives on the scene have been rendered, the resulting framebuffer is delivered to the webxr device to be presented to the user through their headset or other appropriate display device. webxr device api concepts and usage example webxr hardware setup while the older webvr api was designed solely to support virtual reality (vr), webxr provides support for both vr and augmented reality (ar) on the web. support for ar functionality is added by the webxr augmented reality ...
Controlling multiple parameters with ConstantSourceNode - Web APIs
oth gainnode2 and gainnode3, and we start the constant node running by calling its start() method; now it's sending the value 0.5 to the two gain nodes' values, and any change to constantnode.offset will automatically set the gain of both gainnode2 and gainnode3 (affecting their audio inputs as expected). finally, we connect all the gain nodes to the audiocontext's destination, so that any sound delivered to the gain nodes will reach the output, whether that output be speakers, headphones, a recording stream, or any other destination type. after setting the window's load event handler to be the setup() function, the stage is set. let's see how the action plays out. toggling the oscillators on and off because oscillatornode doesn't support the notion of being in a paused state, we have to simula...
Using Web Workers - Web APIs
nt is served with the following header: content-security-policy: script-src 'self' among other things, this will prevent any scripts it includes from using eval(). however, if the script constructs a worker, code running in the worker's context will be allowed to use eval(). to specify a content security policy for the worker, set a content-security-policy response header for the request which delivered the worker script itself. the exception to this is if the worker script's origin is a globally unique identifier (for example, if its url has a scheme of data or blob). in this case, the worker does inherit the csp of the document or worker that created it. transferring data to and from workers: further details data passed between the main page and workers is copied, not shared. objects are ...
Window.matchMedia() - Web APIs
Web › API › Window › matchMedia
ee if the document matches the media query. to perform a one-time, instantaneous check to see if the document matches the media query, look at the value of the matches property, which will be true if the document meets the media query's requirements. if you need to be kept aware of whether or not the document matches the media query at all times, you can instead watch for the change event to be delivered to the object. there's a good example of this in the article on window.devicepixelratio. examples this example runs the media query (max-width: 600px) and displays the value of the resulting mediaquerylist's matches property in a <span>; as a result, the output will say "true" if the viewport is less than or equal to 600 pixels wide, and will say "false" if the window is wider than that. java...
Worker.prototype.postMessage() - Web APIs
ta may be any value or javascript object handled by the structured clone algorithm, which includes cyclical references. the worker can send back information to the thread that spawned it using the dedicatedworkerglobalscope.postmessage method. syntax worker.postmessage(message, [transfer]); parameters message the object to deliver to the worker; this will be in the data field in the event delivered to the dedicatedworkerglobalscope.onmessage handler. this may be any value or javascript object handled by the structured clone algorithm, which includes cyclical references. if the message parameter is not provided, a typeerror will be thrown. if the data to be passed to the worker is unimportant, null or undefined can be passed explicitly. transfer optional an optional array of transferable ...
XMLHttpRequest.send() - Web APIs
if the request is synchronous, this method doesn't return until the response has arrived. send() accepts an optional parameter which lets you specify the request's body; this is primarily used for requests such as put. if the request method is get or head, the body parameter is ignored and the request body is set to null. ...
XRInputSourceArray.values() - Web APIs
ht through the list. examples this example snippet walks through each input and calls the function checkinput() with each returned value. for (const source of xrsession.inputsources.values()) { checkinput(source); } here, for...of is used to iterate over the array's contents. each pass through the loop, source is the next xrinputsource in the list. the loop exits once every input has been delivered to checkinput(). specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach()...
XRInputSourceEvent.frame - Web APIs
esenting the event frame during which a webxr user input occurred. this may thus be an event which occurred in the past rather than a current or impending event. syntax let inputframe = xrinputsourceevent.frame; value an xrframe indicating the event frame at which the user input event described by the object took place. usage notes the event frame does not correspond to a visual frame as is delivered to the frame rendering callback function (see rendering and the webxr frame rendering callback for details on the callback). instead, the xrframe specified by the frame property is simply a method to provide access to the getpose() method, which you can use to get the relative positions of the objects in the scene at the time the event occurred. however, since the event frame isn't an animation ...
XRInputSourceEventInit.frame - Web APIs
entinit.frame = xrframe; let xrinputsourceeventinit = { frame: xrframe }; let xrinputsourceevent = new xrinputsourceevent(type, { frame: xrframe }); value an xrframe indicating the time at which the event took place, and providing a getpose() method which can be used to map reference spaces to the world reference space. usage notes the event frame does not correspond to a visual frame as is delivered to the frame rendering callback function (see rendering and the webxr frame rendering callback for details on the callback). instead, the xrframe specified by the frame property is simply a method to provide access to the getpose() method, which you can use to get the relative positions of the objects in the scene at the time the event occurred. examples this example creates a new select event ...
XRInputSourcesChangeEvent() - Web APIs
type a domstring indicating the type of event which has occurred. this string must always be inputsourceschange. eventinitdict an object conforming to the xrinputsourceschangeeventinit dictionary, prodividing the initial values for the event. return value a newly-created xrinputsourceschangeevent object configured based upon the input parameters provided. event types inputsourceschange delivered to the xrsession when the set of input devices available to it changes. example the following snippet of code creates a new xrinputsourceschangeevent object indicating that a single new input source, described by an xrinputsource object named newinputsource, has been added to the system. let iscevent = new xrinputsourceschangeevent("inputsourceschange", { session: xrsession, ...
XRInputSourcesChangeEvent - Web APIs
r use. removed read only an array of zero or more xrinputsource objects representing the input devices newly connected or enabled for use. session read only the xrsession to which this input source change event is being directed. methods while xrinputsourceschangeevent defines no methods of its own, it inherits methods from its parent interface, event. event types inputsourceschange delivered to the xrsession when the set of input devices available to it changes. examples the following example shows how to set up an event handler which uses inputsourceschange events to detect newly-available pointing devices and to load their models in preparation to display them in the next animation frame. xrsession.addeventlistener("inputsourceschange", oninputsourceschange); function oninputs...
XRSession - Web APIs
Web › API › XRSession
pace which was requested, or throws a notsupportederror if the requested space type isn't supported by the device. updaterenderstate() updates the properties of the session's render state to match the values specified in the specified xrrenderstateinit dictionary. any properties not included in the given dictionary are left unchanged from their current values. events the following events are delivered to xrsession objects. event description end sent to the xrsession object after the webxr session has ended and all hardware-related functions have completed. the event is represented by an object of type xrsessionevent. also available through the onend event handler property. inputsourceschange an event of type xrinputsourceschangeevent sent to the xrs...
XRSessionEvent() - Web APIs
a domstring indicating which of the events represented by objects of type xrsessionevent this particular object represents. see event types for a list of the permitted values. eventinitdict an object conforming to the xrsessioneventinit dictionary which contains values to be applied to the newly-created event object. permitted values are: session the xrsession to which the event is to be delivered. return value a newly-created xrsessionevent object representing an object of the specfied type and configured as described by the eventinitdict parameter. event types the following events are represented using the xrsessionevent interface, and are permitted values for its type property. end fired at the session when it has ended, after being terminated by the application or the user ...
XRSessionEventInit - Web APIs
the xrsessioneventinit dictionary is used when calling the xrsessionevent() constructor to provide the new event's initial values. you're unlikely to need to create these events yourself, however, as they're created by the xr system. properties session the xrsession to which the event is to be delivered. examples <tbd> specifications specification status comment webxr device apithe definition of 'xrsessioneventinit' in that specification. working draft initial definition. ...
XRSystem: devicechange event - Web APIs
rsive xr devices has changed; for example, a vr headset or ar goggles have been connected or disconnected. it's a generic event with no added properties. note: not to be confused with the mediadevices devicechange event. bubbles no cancelable no interface event event handler xrsystem.ondevicechange usage notes devicechange events are not delivered if the document which owns the xrsystem object has been granted permission to do so through the xr-spatial-tracking feature policy. you can use this event to, for example, monitor for the availability of a webxr-compatible device so that you can enable a ui element which the user can use to activate immersive mode. this is shown in the example below. example the example shown here handles the ...
ARIA: switch role - Accessibility
i if one is available and it supports the switch role. all elements that are descendants of an element with the switch role applied to it are automatically assigned role presentation. this prevents elements that are used to construct the switch from being interacted with individually by assistive technologies. text in these elements remains visible to the user agent and may be read or otherwise delivered to the user, unless it's expressly hidden using display: none or aria-hidden="true". the assistive technology, if it supports the switch role, responds by doing the following: screen readers should announce the element as a switch, optionally providing instructions as to how to activate the switch. there are varying opinions on how assistive technologies should handle this role; the above...
Web Accessibility: Understanding Colors and Luminance - Accessibility
eption of that same color on that same computer screen in a dark room. in terms of accessibility, the use of certain color-combinations have more impact than others. font size, font style (some fonts are so thin or fancy that they present accessibility problems on their own), background color, the size of the background space around the text, even pixel densities and more all affect how color is delivered from the screen. (see understanding success criterion 1.4.3: contrast) a viewer's distance from the screen, the ambient background, the health of his eyes, and more all affect how that color is received by the viewer. how the viewer perceives color after it gets to his eyes is yet another matter, and can be affected by overall health. luckily, css media queries level 5 will be a game-changer i...
Coordinate systems - CSS: Cascading Style Sheets
by the css object model, as described below. offset coordinates specified using the "offset" model use the top-left corner of the element being examined, or on which an event has occurred. for example, when a mouse event occurs, the position of the mouse as specified in the event's offsetx and offsety properties are given relative to the top-left corner of the node to which the event has been delivered. the origin is inset by the distances specified by padding-left and padding-top. client the "client" coordinate system uses as its origin the top-left corner of the viewport or browsing context in which the event occurred. this is the entire viewing area in which the document is presented. scrolling is not a factor. on a desktop computer, for example, the mouseevent.clientx and mouseevent.clie...
Using CSS animations - CSS: Cascading Style Sheets
es is set the class on the element we'll be animating to “slidein”; we do this to start the animation. why? because the animationstart event fires as soon as the animation starts, and in our case, that happens before our code runs. so we’ll start the animation ourselves by setting the class of the element to the style that gets animated after the fact. receiving the events the events get delivered to the listener() function, which is shown below. function listener(event) { var l = document.createelement("li"); switch(event.type) { case "animationstart": l.innerhtml = "started: elapsed time is " + event.elapsedtime; break; case "animationend": l.innerhtml = "ended: elapsed time is " + event.elapsedtime; break; case "animationiteration": l.inner...
Event reference
call events alerting busy callschanged cfstatechange connecting dialing disconnected disconnecting error held, holding incoming resuming statechange voicechange sensor events compassneedscalibration devicemotion deviceorientation orientationchange smartcard events icccardlockerror iccinfochange smartcard-insert smartcard-remove stkcommand stksessionend cardstatechange sms and ussd events delivered received sent ussdreceived frame events mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserlocationchange mozbrowserloadend mozbrowserloadstart mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange dom mutation events domattributenamechanged domattrmodified domcharacterdatamodified domcontentloaded domelementnamechanged...
Live streaming web audio and video - Developer guides
tion when streaming media to a browser is the fact that rather than playing a finite file we are relaying a file that is being created on the fly and has no pre-determined start or end. key differences between streamed and static media in this case, we are using static media to describe media that is represented by a file, whether it be an mp3 or webm file. this file sits on a server and can be delivered — like most other files — to the browser. this is often known as a progressive download. live streamed media lacks a finite start and end time as rather than a static file, it is a stream of data that the server passes on down the line to the browser and is often adaptive (see below). usually, we require different formats and special server-side software to achieve this. adaptive streaming ...
Setting up adaptive streaming media sources - Developer guides
media that make the possible streams. various bitrate streams are broken into segments and placed in appropriate server folders — we have to provide our media players with a link to lookup files or playlists specifying the name and location of these stream folders. mpeg-dash encoding mpeg-dash is an adaptive bitrate streaming technique that enables streaming of media content over the internet delivered from conventional http web servers. a media presentation description (mpd) file is used to hold the information on the various streams and the bandwidths they are associated with. in your video source (src) attribute you point to the mpd instead of to the media file as you would with non-adaptive media. the mpd file tells the browser where the various pieces of media are located, it also includ...
Media buffering, seeking, and time ranges - Developer guides
merange code running live on js bin. seekable the seekable attribute returns a timeranges object and tells us which parts of the media can be played without delay; this is irrespective of whether that part has been downloaded or not. some parts of the media may be seekable but not buffered if byte-range requests are enabled on the server. byte range requests allow parts of the media file to be delivered from the server and so can be ready to play almost immediately — thus they are seekable. var seekabletimeranges = myaudio.seekable; creating our own buffering feedback if we wish to create our own custom player, we may want to provide feedback on how much of the media is ready to be played. in practice a good way to do this is use the seekable attribute, although as we have seen above seekab...
Audio and Video Delivery - Developer guides
uri specification implemented by gecko, and it can only be used when specifying the source for media elements, and not in the address bar. error handling starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), error handling has been revised to match the latest version of the html5 specification. instead of the error event being dispatched to the media element itself, it now gets delivered to the child <source> elements corresponding to the sources resulting in the error. this lets you detect which sources failed to load, which may be useful. consider this html: <video> <source id="mp4_src" src="video.mp4" type='video/mp4; codecs="avc1.42e01e, mp4a.40.2"'> </source> <source id="3gp_src" src="video.3gp" type='video/3gpp; codecs="mp4v.20.8, samr"'> </source> <source id="ogg...
<input type="datetime-local"> - HTML: Hypertext Markup Language
in how the inputs work, it may currently still be best to use a framework or library to present these, or to use a custom input of your own. another option is to use separate date and time inputs, each of which is more widely supported than datetime-local. some browsers may resort to a text-only input element that validates that the results are legitimate date/time values before letting them be delivered to the server, as well, but you shouldn't rely on this behavior since you can't easily predict it. for those of you not using a supporting browser, the chrome/opera datetime-local control looks like the below screenshot. clicking the down arrow on the right hand side brings up a date picker to allow you to choose a date; you have to enter the time manually. the edge datetime-local control loo...
<keygen> - HTML: Hypertext Markup Language
Web › HTML › Element › keygen
a signedpublickeyandchallenge. the signedpublickeyandchallenge is base64 encoded, and the ascii data is finally submitted to the server as the value of a form name/value pair, where the name is name as specified by the name attribute of the keygen element. if no challenge string is provided, then it will be encoded as an ia5string of length zero. ...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
Web › HTML › Element › link
indicates to the browser that the resource is of low priority. note: the importance attribute may only be used for the <link> element if rel="preload" or rel="prefetch" is present. integrity contains inline metadata — a base64-encoded cryptographic hash of the resource (file) you’re telling the browser to fetch. the browser can use this to verify that the fetched resource has been delivered free of unexpected manipulation. see subresource integrity. media this attribute specifies the media that the linked resource applies to. its value must be a media type / media query. this attribute is mainly useful when linking to external stylesheets — it allows the user agent to pick the best adapted one for the device it runs on. notes: in html 4, this can only be a simple white-s...
<script>: The Script element - HTML: Hypertext Markup Language
Web › HTML › Element › script
defer attribute will execute in the order in which they appear in the document. this attribute allows the elimination of parser-blocking javascript where the browser would have to load and evaluate scripts before continuing to parse. async has a similar effect in this case. integrity this attribute contains inline metadata that a user agent can use to verify that a fetched resource has been delivered free of unexpected manipulation. see subresource integrity. nomodule this boolean attribute is set to indicate that the script should not be executed in browsers that support es2015 modules — in effect, this can be used to serve fallback scripts to older browsers that do not support modular javascript code. nonce a cryptographic nonce (number used once) to whitelist scripts in a script-src ...
MIME types (IANA media types) - HTTP
bled by the recipient. multipart list at iana data that is comprised of multiple components which may individually have different mime types. examples include multipart/form-data (for data produced using the formdata api) and multipart/byteranges (defined in rfc 7233: 5.4.1 and used with http's 206 "partial content" response returned when the fetched data is only part of the content, such as is delivered using the range header). important mime types for web developers application/octet-stream this is the default for binary files. as it means unknown binary file, browsers usually don't execute it, or even ask if it should be executed. they treat it as if the content-disposition header was set to attachment, and propose a "save as" dialog. text/plain this is the default for textual files. eve...
Clear-Site-Data - HTTP
if a user signs out of your website or service, you might want to remove locally stored data. you can achieve that by adding the clear-site-data header when sending the page confirming that logging out from the site has been accomplished successfully (https://example.com/logout, for example): clear-site-data: "cache", "cookies", "storage", "executioncontexts" clearing cookies if this header is delivered with the response at https://example.com/clear-cookies, all cookies on the same domain https://example.com and any subdomains (like https://stage.example.com, etc), will be cleared out. clear-site-data: "cookies" specifications specification status title clear site data working draft initial definition. ...
Strict-Transport-Security - HTTP
trict-transport-security header, the browser records this information, so that future attempts to load the site using http will automatically use https instead. when the expiration time specified by the strict-transport-security header elapses, the next attempt to load the site via http will proceed as normal instead of automatically using https. whenever the strict-transport-security header is delivered to the browser, it will update the expiration time for that site, so sites can refresh this information and prevent the timeout from expiring. should it be necessary to disable strict transport security, setting the max-age to 0 (over a https connection) will immediately expire the strict-transport-security header, allowing access via http. preloading strict transport security google maintains ...
Network Error Logging - HTTP
s can add and send their own error types: dns.unreachable the user's dns server is unreachable dns.name_not_resolved the user's dns server responded but was unable to resolve an ip address for the requested uri. dns.failed request to the dns server failed due to reasons not covered by previous errors (e.g. servfail) dns.address_changed for security reasons, if the server ip address that delivered the original report is different to the current server ip address at time of error generation, the report data will be downgraded to only include information about this problem and the type set to dns.address_changed. tcp.timed_out tcp connection to the server timed out tcp.closed the tcp connection was closed by the server tcp.reset the tcp connection was reset tcp.refused the tcp connec...
Autoplay guide for media and Web Audio APIs - Web media technologies
hich receives as input the play event. handlefirstplay() looks like this: function handlefirstplay(event) { let vid = event.target; vid.onplay = null; // start whatever you need to do after playback has started } after getting a reference to the video element from the event object's target, the element's onplay handler is set to null. this will prevent any future play events from being delivered to the handler. that could happen if the video is paused and resumed by the user or automatically by the browser when the document is in a background tab. at this point, your site or app can begin whatever it needs to do that relies upon the video having been started up. note: this approach doesn't differentiate between autoplay and the user starting playback manually. the play() method the...
Web audio codec guide - Web media technologies
ire archival-quality storage, or because the audio samples will be remixed and recompressed, and you wish to avoid the amplification of artifacts in the audio due to recompression. for real-time streaming of audio, a lossy codec is usually required in order to ensure the flow of data can keep up with the audio playback rate regardless of network performance. maximum number of channels the audio delivered to each speaker in a sound system is provided by one audio channel in a stream. monaural sound is a single channel. stereo sound is two. 5.1 surround sound has five audio channels, plus one low frequency enhancement (lfe) channel. lfe channels are specifically designed to store low-frequency audio data, and are commonly used to provide audio data for subwoofers, for example. when you see the num...
Lazy loading - Web Performance
s) in the app dynamic splitting: separates code where dynamic import() statements are used javascript script type module any script tag with type="module" is treated like a javascript module and is deferred by default. css by default, css is treated as a render blocking resource, so the browser won't render any processed content until the cssom is constructed. css must be thin, delivered as quickly as possible, and the usage media types and queries are advised to unblock rendering. <link href="style.css" rel="stylesheet" media="all"> <link href="portrait.css" rel="stylesheet" media="orientation:portrait"> <link href="print.css" rel="stylesheet" media="print"> it is possible to perform some css optimizations to achieve that. fonts by default, font requests are delayed ...
Getting started - SVG: Scalable Vector Graphics
operties of svg files the first important thing to notice is the order of rendering elements. the globally valid rule for svg files is, that later elements are rendered atop previous elements. the further down an element is the more it will be visible. svg files on the web can be displayed directly in the browser or embedded in html files via several methods: if the html is xhtml and is delivered as type application/xhtml+xml, the svg can be directly embedded in the xml source. if the html is html5, and the browser is a conforming html5 browser, the svg can also be directly embedded. however, there may be syntax changes necessary to conform to the html5 specification. the svg file can be referenced with an object element: <object data="image.svg" type="image/svg+xml" /> ...
How to fix a website with blocked mixed content - Web security
consequently, your website may appear broken to users (if iframes or plugins don't load, etc.). ...