Search completed in 1.18 seconds.
PaymentRequest.PaymentRequest() - Web APIs
the payment
request() constructor creates a new payment
request object which will be used to handle the process of generating, validating, and submitting a payment
request.
... syntax var payment
request = new payment
request(methoddata, details, [options]); parameters methoddata contains an array of identifiers for the payment methods the merchant web site accepts and any associated payment method specific data.
...for basic credit card services, this structure should match the basiccard
request dictionary.
...And 17 more matches
XMLHttpRequest.setRequestHeader() - Web APIs
the xmlhttp
request method set
requestheader() sets the value of an http
request header.
... when using set
requestheader(), you must call it after calling open(), but before calling send().
... if this method is called several times with the same header, the values are merged into one single
request header.
...And 5 more matches
PaymentRequestUpdateEvent.PaymentRequestUpdateEvent() - Web APIs
the payment
requestupdateevent constructor creates a new payment
requestupdateevent object which enables a web page to update the details of a payment
request in response to a user action.
... syntax var payment
requestupdateevent = new payment
requestupdateevent() parameters none.
... return value a new payment
requestupdateevent object.payment
request apithe definition of 'payment
requestupdateevent' in that specification.
... specifications specification status comment payment
request apithe definition of 'payment
requestupdateevent()' in that specification.
PaymentRequestEvent.paymentRequestOrigin - Web APIs
the payment
requestorigin read-only property of the payment
requestevent interface returns the origin where the payment
request object was initialized.
... syntax var ausvstring = payment
requestevent.payment
requestorigin value a usvstring.
... specifications specification status comment payment handler apithe definition of 'payment
requestorigin' in that specification.
XMLHttpRequest.mozBackgroundRequest - Web APIs
xmlhttp
request.mozbackground
request is a boolean, indicating if the object represents a background service
request.
... if true, no load group is associated with the
request, with security dialogs prevented from being shown to the user.
... in cases in where a security dialog (such as authentication or a bad certificate notification) would normally be shown, this
request fails instead.
XMLHttpRequest.openRequest() - Web APIs
this mozilla-specific method is available only from within privileged code, and is only called from a c++ context in order to initialize an xmlhttp
request.
... to initialize a
request from javascript code, use the standard open() method instead.
WebRequest.jsm
the web
request module is new in firefox 41.
... the web
request module provides an api to add event listeners for the various stages of making an http
request.
... the event listener receives detailed information about the
request, and can modify or cancel the
request.
...And 63 more matches
Using XMLHttpRequest - Web APIs
in this guide, we'll take a look at how to use xmlhttp
request to issue http
requests in order to exchange data between the web site and a server.
... examples of both common and more obscure use cases for xmlhttp
request are included.
... to send an http
request, create an xmlhttp
request object, open a url, and send the
request.
...And 52 more matches
XMLHttpRequest - Web APIs
xmlhttp
request (xhr) objects are used to interact with servers.
...xmlhttp
request is used heavily in ajax programming.
...fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/xmlhttp
requesteventtarget" target="_top"><rect x="151" y="1" width="250" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="276" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">xmlhttp
requesteventtarget</text></a><polyline points="401,25 411,20 411,30 401,25" stroke="#d4dde4" fill="none"/><line x1...
...And 51 more matches
Network request list - Firefox Developer Tools
the
request list of the network monitor shows a list of all the network
requests made in the course of loading the page.
... network
request list by default, the network monitor shows a list of all the network
requests made in the course of loading the page.
... each
request is displayed in its own row: by default, the network monitor is cleared each time you navigate to a new page or reload the current page.
...And 47 more matches
Using the Payment Request API - Web APIs
the payment
request api provides a browser-based method of connecting users and their preferred payment systems and platforms to merchants that they want to pay for goods and services.
... this article is a guide to making use of the payment
request api, with examples and suggested best practices.
... the basics of making a payment this section details the basics of using the payment
request api to make a payment.
...And 32 more matches
Setting HTTP request headers
in addition to the actual content, some important information is passed with http headers for both http
requests and responses.
... you can add your own http headers to any
request the application makes, whether the
request is initiated by your code explicitly opening an http channel, because of xmlhttp
request activity, an <img> element in content, or even from css.
... http channels when you deal with http
requests and responses, typically you are doing this with an nsihttpchannel.
...And 29 more matches
request - Archive of obsolete content
examples outlined in this document are no longer relevent in regards to the twitter api calls and need to be updated make simple network
requests.
... for more advanced usage, check out the net/xhr module, based on the browser's xmlhttp
request object.
... globals constructors
request(options) this constructor creates a
request object that can be used to make network
requests.
...And 27 more matches
nsIRequest
netwerk/base/nsi
request.idlscriptable this interface is used by the
request initiator to control the
request.
... inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) for example nsichannel typically passes itself as the nsi
request argument to the nsistreamlistener on each onstart
request, ondataavaliable, and onstop
request invocation.
... method overview void cancel(in nsresult astatus); boolean ispending(); void resume(); void suspend(); attributes attribute type description loadflags nsloadflags the load flags of this
request.
...And 26 more matches
Synchronous and asynchronous requests - Web APIs
xmlhttp
request supports both synchronous and asynchronous communications.
... in general, however, asynchronous
requests should be preferred to synchronous
requests for performance reasons.
... synchronous
requests block the execution of code which causes "freezing" on the screen and an unresponsive user experience.
...And 26 more matches
HTTP conditional requests - HTTP
http has a concept of conditional
requests, where the result, and even the success of a
request, can be changed by comparing the affected resources with the value of a validator.
... such
requests can be useful to validate the content of a cache, and sparing a useless control, to verify the integrity of a document, like when resuming a download, or when preventing to lose updates when uploading or modifying a document on the server.
... principles http conditional
requests are
requests that are executed differently, depending on the value of specific headers.
...And 25 more matches
Network request details - Firefox Developer Tools
the
request details pane appears when you click on a network
request in the
request list.
... this pane provides more detailed information about the
request.
... network
request details clicking on a row displays a new pane in the right-hand side of the network monitor, which provides more detailed information about the
request.
...And 24 more matches
IDBRequest - Web APIs
the idb
request interface of the indexeddb api provides access to results of asynchronous
requests to databases and database objects using event handler attributes.
... each reading and writing operation on a database is done using a
request.
... the
request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the
request, and the information becomes available through the properties of the idb
request instance.
...And 23 more matches
Request - Web APIs
the
request interface of the fetch api represents a resource
request.
... you can create a new
request object using the
request() constructor, but you are more likely to encounter a
request object being returned as the result of another api operation, such as a service worker fetchevent.
request.
... constructor
request() creates a new
request object.
...And 21 more matches
nsISmsRequestManager
nsisms
requestmanager dom/sms/interfaces/nsisms
requestmanager.idlscriptable used to manage sms related
requests and notifications for the websms api 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/sms
requestmanager;1.
... to create an instance, use: var sms
requestmanager = components.classes["@mozilla.org/sms/sms
requestmanager;1"] .createinstance(components.interfaces.nsisms
requestmanager); method overview long add
request(in nsidommozsms
request a
request); long create
request(in nsidommozsmsmanager amanager, out nsidommozsms
request a
request); void notifycreatemessagelist(in long a
requestid, in long alistid, in nsidommozsmsmessage amessage); void notifygetsmsfailed(in long a
requestid, in long aerror); void notifygotnextmessage(in long a
requestid, in nsidommozsmsmessage amessage); void notifygotsms(in long a
requestid, in nsidommozsmsmessage amessage); void notifymarkedmessageread(in long a
requestid, in bool aread); void notifymarkmessagereadfailed(in long a
requestid, in long ...
...aerror); void notifynomessageinlist(in long a
requestid); void notifyreadmessagelistfailed(in long a
requestid, in long aerror); void notifysmsdeleted(in long a
requestid, in bool adeleted); void notifysmsdeletefailed(in long a
requestid, in long aerror); void notifysmssendfailed(in long a
requestid, in long aerror); void notifysmssent(in long a
requestid, in nsidommozsmsmessage amessage); constants all sms related errors that could apply to sms
request objects.
...And 20 more matches
Request() - Web APIs
the
request() constructor creates a new
request object.
... syntax var my
request = new
request(input[, init]); parameters input defines the resource that you wish to fetch.
... a
request object, effectively creating a copy.
...And 18 more matches
LockManager.request() - Web APIs
the
request() method of the lockmanager interface
requests a lock object with parameters specifying its name and characteristics.
... the
requested lock is passed to a callback, while the function itself returns a promise that resolves with undefined.
...
request an "exclusive" lock when it should only be held by one code instance at a time.
...And 17 more matches
PaymentRequest.show() - Web APIs
the payment
request interface's show() method instructs the user agent to begin the process of showing and handling the user interface for the payment
request to the user.
... for security reasons, the payment
request.show() method can't just be initiated at any time.
... only one payment
request can be in the process of being handled at once, across all documents.
...And 17 more matches
imgIRequest
modules/libpr0n/public/imgi
request.idlscriptable please add a summary to this article.
... inherits from: nsi
request last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void cancelandforgetobserver(in nsresult astatus); imgi
request clone(in imgidecoderobserver aobserver); void decrementanimationconsumers(); imgi
request getstatic
request(); void incrementanimationconsumers(); void lockimage(); void
requestdecode(); void unlockimage(); attributes attribute type description corsmode long the cors mode that this image was loaded with.
... status_load_partial 0x2 used internally by img
request to flag that a
request is being cancelled as a result of a failure of a proxy holder and not an internal failure.
...And 16 more matches
Document.requestStorageAccess() - Web APIs
the
requeststorageaccess() method of the document interface returns a promise that resolves if the access to first-party storage was granted, and rejects if access was denied.
... grant the document access to cookies and other site storage and store that fact for the purposes of future calls to document.hasstorageaccess() and
requeststorageaccess().
... assuming all of the requirements above are satisfied, firefox will automatically grant storage access to the
requesting origin on up to a threshold number of first-party origins in the current session for the duration of user’s session, up to a maximum of 24 hours.
...And 16 more matches
XDomainRequest - Web APIs
xdomain
request is an implementation of http access control (cors) that worked in internet explorer 8 and 9.
... it was removed in internet explorer 10 in favor of using xmlhttp
request with proper cors; if you are targeting internet explorer 10 or later, or wish to support any other browser, you need to use standard http access control.
... this interface can send both get and post
requests.
...And 16 more matches
HTTP range requests - HTTP
http range
requests allow to send only a portion of an http message from a server to a client.
... partial
requests are useful for large media or downloading files with pause and resume functions, for example.
... checking if a server supports partial
requests if the accept-ranges is present in http responses (and its value isn't "none"), the server supports range
requests.
...And 15 more matches
Payment Request API - Web APIs
the payment
request api provides a consistent user experience for both merchants and users.
... payment
request concepts and usage many problems related to online shopping-cart abandonment can be traced to checkout forms, which can be difficult and time consuming to fill out and often require multiple steps to complete.
... the payment
request api is meant to reduce the number of steps needed to complete a payment online, potentially doing away with checkout forms.
...And 14 more matches
Request.cache - Web APIs
the cache read-only property of the
request interface contains the cache mode of the
request.
... it controls how the
request will interact with the browser's http cache.
... syntax var currentcachemode =
request.cache; value a
requestcache value.
...And 12 more matches
HTML in XMLHttpRequest - Web APIs
the w3c xmlhttp
request specification adds html parsing support to xmlhttp
request, which originally supported only xml parsing.
... this feature allows web apps to obtain an html resource as a parsed dom using xmlhttp
request.
... to get an overview of how to use xmlhttp
request in general, see using xmlhttp
request.
...And 12 more matches
generateCRMFRequest() - Archive of obsolete content
crmfobject = crypto.generatecrmf
request("
requesteddn", "regtoken", "authenticator", "escrowauthoritycert", "crmf generation done code", keysize1, "keyparams1", "keygenalg1", ..., keysizen, "keyparamsn", "keygenalgn"); this method will generate a sequence of crmf
requests that h...
...as n
requests.
... one
request for each key pair that is generated.
...And 11 more matches
JS_BeginRequest
syntax void js_begin
request(jscontext *cx); void js_end
request(jscontext *cx); name type description cx jscontext * the context in which the calling thread intends to call jsapi functions.
... description when your multithreaded application wants to use a jscontext, it must use js_begin
request and js_end
request to bracket maximal non-blocking hunks of native code that call the jsapi.
... this "
request model" is necessary to interlock with the global garbage collector.
...And 11 more matches
PaymentRequest - Web APIs
the payment
request api's payment
request interface the primary access point into the api, and lets web content and apps accept payments from the end user on behalf of the operator of the site or the publisher of the app.
... constructor payment
request() secure context creates a new payment
request object.
... properties payment
request.id read only secure context an unique identifier for a particular payment
request, which can be set via details.id.
...And 10 more matches
XMLHttpRequest.send() - Web APIs
the xmlhttp
request method send() sends the
request to the server.
... if the
request is asynchronous (which is the default), this method returns as soon as the
request is sent and the result is delivered using events.
... if the
request is synchronous, this method doesn't return until the response has arrived.
...And 10 more matches
NPN_RequestRead - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary
requests a range of bytes from a seekable stream.
...syntax #include <npapi.h> nperror npn_
requestread(npstream* stream, npbyterange* rangelist); parameters the function has the following parameters: stream stream of type np_seek from which to read bytes.
... rangelist range of bytes in the form of a linked list of npbyterange objects, each of which specifies a
request for a range of bytes.
...And 9 more matches
JS_SuspendRequest
suspends the calling thread's current
request, if any, to allow the thread to block or perform time-consuming calculations.
... syntax jsrefcount js_suspend
request(jscontext *cx); void js_resume
request(jscontext *cx, jsrefcount savedepth); name type description cx jscontext * the context whose current
request is to be suspended or resumed.
... savedepth jsrefcount (only in js_resume
request) the valued returned by the matching js_suspend
request call.
...And 9 more matches
IDBRequest.error - Web APIs
the error read-only property of the idb
request interface returns the error in the event of an unsuccessful
request.
... syntax var myerror =
request.error; value a domerror containing the relevant error.
...the following error codes are returned under certain conditions: error explanation aborterror if you abort the transaction, then all
requests still in progress receive this error.
...And 9 more matches
Window.requestAnimationFrame() - Web APIs
the window.
requestanimationframe() method tells the browser that you wish to perform an animation and
requests that the browser calls a specified function to update an animation before the next repaint.
... note: your callback routine must itself call
requestanimationframe() if you want to animate another frame at the next repaint.
...this will
request that your animation function be called before the browser performs the next repaint.
...And 9 more matches
XRSession.requestAnimationFrame() - Web APIs
the xrsession method
requestanimationframe(), much like the window method of the same name, schedules a callback to be executed the next time the browser is ready to paint the session's virtual environment to the xr display.
... the specified callback is executed once before the next repaint; if you wish for it to be executed for the following repaint, you must call
requestanimationframe() again.
... note: despite the obvious similarities between these methods and the global
requestanimationframe() function provided by the window interface, you must not treat these as interchangeable.
...And 9 more matches
JS_YieldRequest
momentarily suspend the current jsapi
request, allowing garbage collection to run if another thread has
requested it.
... syntax void js_yield
request(jscontext *cx); name type description cx jscontext * the jscontext that is currently in a
request on the calling thread.
... requires
request.
...And 8 more matches
BasicCardRequest - Web APIs
the basiccard
request dictionary is a javascript object-structure that can be used in the payment
request api.
... the properties of basiccard
request are defined in the basic card payment spec).
... properties basiccard
request.supportednetworks optional secure context an optional array of domstrings representing the card networks that the retailer supports (e.g.
...And 8 more matches
IDBRequest.transaction - Web APIs
the transaction read-only property of the idb
request interface returns the transaction for the
request, that is, the transaction the
request is being made inside.
... this property can be null for
requests not made within transactions, such as for
requests returned from idbfactory.open — in this case you're just connecting to a database, so there is no transaction to return.
... syntax var mytransaction =
request.transaction; value an idbtransaction.
...And 8 more matches
PaymentRequest.canMakePayment() - Web APIs
the payment
request method canmakepayment() determines whether or not the
request is configured in a way that is compatible with at least one payment method supported by the user agent.
... for instance, you might call canmakepayment() to determine if the browser will let the user pay using payment
request api, and if it won't, you could fall back to another payment method, or offer a list of methods that aren't handled by payment
request api (or even provide instructions for paying by mail or by phone).
... syntax payment
request.canmakepayment() .then( canpay => { ...
...And 8 more matches
Request.mode - Web APIs
the mode read-only property of the
request interface contains the mode of the
request (e.g., cors, no-cors, same-origin, or navigate.) this is used to determine if cross-origin
requests lead to valid responses, and which properties of the response are readable.
... syntax var mymode =
request.mode; value a
requestmode value.
... the associated mode, available values of which are: same-origin — if a
request is made to another origin with this mode set, the result is simply an error.
...And 8 more matches
IDBRequest.readyState - Web APIs
the readystate read-only property of the idb
request interface returns the state of the
request.
... every
request starts in the pending state.
... the state changes to done when the
request completes successfully or when an error occurs.
...And 7 more matches
PaymentRequest.onshippingaddresschange - Web APIs
the onshippingaddresschange event of the payment
request interface is fired whenever the user changes their shipping address, including when an address is added by the user for the first time.
... syntax payment
request.addeventlistener('shippingaddresschange', shippingaddresschangeevent => { ...
... }); payment
request.onshippingaddresschange = function(shippingaddresschangeevent) { ...
...And 7 more matches
PaymentRequest.onshippingoptionchange - Web APIs
the onshippingoptionchange event of the payment
request interface is fired whenever the user changes a shipping option.
... syntax payment
request.addeventlistener('shippingoptionchange', shippingoptionchangeevent => { ...
... }); payment
request.onshippingoptionchange = function(shippingoptionchangeevent) { ...
...And 7 more matches
XMLHttpRequestEventTarget - Web APIs
xmlhttp
requesteventtarget is the interface that describes the event handlers you can implement in an object that will handle events for an xmlhttp
request.
...fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/xmlhttp
requesteventtarget" target="_top"><rect x="151" y="1" width="250" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="276" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">xmlhttp
requesteventtarget</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties...
... xmlhttp
requesteventtarget.onabort contains the function to call when a
request is aborted and the abort event is received by this object.
...And 7 more matches
XRSystem: requestSession() - Web APIs
the xrsystem interface's
requestsession() method returns a promise which resolves to an xrsession object through which you can manage the
requested type of webxr session.
... syntax var sessionpromise = xr.
requestsession(sessionmode, sessioninit) parameters sessionmode a domstring whose value is one of those included in the xrsessionmode enum.
... return value a promise that resolves with an xrsession object if the device and user agent support the
requested mode and features.
...And 7 more matches
nsIXMLHttpRequest
nsixmlhttp
request along with nsijsxmlhttp
request and nsixmlhttp
requesteventtarget are mozilla's implementation details of the dom xmlhttp
request object.
... note: if you're a web developer or a mozilla add-on developer, please refer to the xmlhttp
request documentation instead.
... the interface definition: //github.com/realityripple/uxp/blob/master/dom/xhr/nsixmlhttp
request.idl elevated privileges as mentioned in the "non-standard properties" the property of channel was read-only.
...And 6 more matches
IDBOpenDBRequest - Web APIs
the idbopendb
request interface of the indexeddb api provides access to the results of
requests to open or delete databases (performed using idbfactory.open and idbfactory.deletedatabase), using specific event handler attributes.
...50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/idb
request" target="_top"><rect x="151" y="1" width="100" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="201" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idb
request</text></a><polyline points="251,25 261,20 261,30 251,25" stroke="#d4dde4" fill="none"/><line x1="261" y1="25" x2="291" y2...
...="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/idbopendb
request" target="_top"><rect x="291" y="1" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="371" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbopendb
request</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits methods from its parents idb
request and eventtarget.
...And 6 more matches
PaymentRequest.prototype.id - Web APIs
the id read-only attribute of the payment
request interface returns a unique identifier for a particular payment
request instance.
... when constructing an instance of the payment
request, you are able to supply an custom id via paymentdetailsinit dictionary's id member.
... example this example shows how to give a payment
request instance a custom id.
...And 6 more matches
PaymentRequest.shippingAddress - Web APIs
the shippingaddress read-only property of the payment
request interface returns the shipping address provided by the user.
... syntax var paymentaddress = payment
request.shippingaddress; example generally, the user agent will fill the shippingaddress property value.
... you can trigger this by setting paymentoptions.
requestshipping to true when calling the payment
request constructor.
...And 6 more matches
PaymentRequest.shippingOption - Web APIs
the shippingoption read-only attribute of the payment
request interface returns either the id of a selected shipping option, null (if no shipping option was set to be selected) or a shipping option selected by the user.
... this attribute is only populated if the constructor is called with the
requestshipping flag set to true.
... if
requestshipping was false (or missing), shippingoption returns null, even the developer provides a selected a shipping option.
...And 6 more matches
PublicKeyCredentialRequestOptions - Web APIs
the publickeycredential
requestoptions dictionary of the web authentication api holds the options passed to navigator.credentials.get() in order to fetch a given publickeycredential.
... properties publickeycredential
requestoptions.challenge a buffersource, emitted by the relying party's server and used as a cryptographic challenge.
... publickeycredential
requestoptions.timeout optional a numerical hint, in milliseconds, which indicates the time the caller is willing to wait for the retrieval operation to complete.
...And 6 more matches
nsIRequestObserver
netwerk/base/public/nsi
requestobserver.idlscriptable this interface is used by various streams (such as nsichannel ) to indicate the start and end of a
request.
... inherits from: nsisupports last changed in gecko 1.0 method overview void onstart
request(in nsi
request a
request, in nsisupports acontext); void onstop
request(in nsi
request a
request, in nsisupports acontext, in nsresult astatuscode); methods onstart
request() called to signify the beginning of an asynchronous
request.
... note: an exception thrown from onstart
request has the side-effect of causing the
request to be canceled.
...And 5 more matches
HTMLIFrameElement.allowPaymentRequest - Web APIs
the allowpayment
request property of the htmliframeelement interface returns a boolean indicating whether the payment
request api may be invoked on a cross-origin iframe.
... syntax var allow = htmliframeelement.allowpayment
request value a boolean.
... specifications specification status comment payment
request apithe definition of 'allowpayment
request' in that specification.
...And 5 more matches
IDBOpenDBRequest.onupgradeneeded - Web APIs
the onupgradeneeded property of the idbopendb
request interface is the event handler for the upgradeneeded event, triggered when a database of a bigger version number than the existing stored database is loaded.
... syntax idbopendb
request.onupgradeneeded = function(event) { ...
...for a full working example, see our to-do notifications app (view example live.) var db; //
request version 3 of the database.
...And 5 more matches
PaymentRequest.abort() - Web APIs
the payment
request.abort() method of the payment
request interface causes the user agent to end the payment
request and to remove any user interface that might be shown.
... syntax payment
request.abort(); returns void.
... parameters none examples the following example sets up a timeout to clear the payment
request that might have been abandoned or neglected.
...And 5 more matches
XMLHttpRequest() - Web APIs
the xmlhttp
request() constructor creates a new xmlhttp
request.
... for details about how to use xmlhttp
request, see using xmlhttp
request.
... syntax const
request = new xmlhttp
request(); parameters none.
...And 5 more matches
XMLHttpRequest.response - Web APIs
the xmlhttp
request response property returns the response's body content as an arraybuffer, blob, document, javascript object, or domstring, depending on the value of the
request's responsetype property.
... syntax var body = xmlhttp
request.response; value an appropriate object based on the value of responsetype.
... you may attempt to
request the data be provided in a specific format by setting the value of responsetype after calling open() to initialize the
request but before calling send() to send the
request to the server.
...And 5 more matches
XMLHttpRequest.responseType - Web APIs
the xmlhttp
request property responsetype is an enumerated string value specifying the type of data contained in the response.
... syntax var type = xmlhttp
request.responsetype; xmlhttp
request.responsetype = type; value a string taken from the xmlhttp
requestresponsetype enum which specifies what type of data the response contains.
...see html in xmlhttp
request to learn more about using xhr to fetch html content.
...And 5 more matches
CSP: upgrade-insecure-requests - HTTP
the http content-security-policy (csp) upgrade-insecure-
requests directive instructs user agents to treat all of a site's insecure urls (those served over http) as though they have been replaced with secure urls (those served over https).
... the upgrade-insecure-
requests directive is evaluated before block-all-mixed-content and if it is set, the latter is effectively a no-op.
... the upgrade-insecure-
requests directive will not ensure that users visiting your site via links on third-party sites will be upgraded to https for the top-level navigation and thus does not replace the strict-transport-security (hsts) header, which should still be set with an appropriate max-age to ensure that users are not subject to ssl stripping attacks.
...And 5 more matches
HTTP request methods - HTTP
http defines a set of
request methods to indicate the desired action to be performed for a given resource.
... although they can also be nouns, these
request methods are sometimes referred to as http verbs.
...a
request method can be safe, idempotent, or cacheable.
...And 5 more matches
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
a
request header is an http header that can be used in an http
request, and that doesn't relate to the content of the message.
...
request headers, like accept, accept-*, or if-* allow to perform conditional
requests; others like cookie, user-agent, or referer precise the context so that the server can tailor the answer.
... not all headers appearing in a
request are
request headers.
...And 4 more matches
Element.requestFullscreen() - Web APIs
the element.
requestfullscreen() method issues an asynchronous
request to make the element be displayed in full-screen mode.
... syntax var promise = element.
requestfullscreen(options); parameters options optional a fullscreenoptions object providing options that control the behavior of the transition to full-screen mode.
... exceptions rather than throw a traditional exception, the
requestfullscreen() procedure announces error conditions by rejecting the promise it has returned.
...And 4 more matches
HTMLFormElement.requestSubmit() - Web APIs
the htmlformelement method
requestsubmit()
requests that the form be submitted using a specific submit button.
... syntax htmlformelement.
requestsubmit(submitter); parameters submitter optional the submit button whose attributes describe the method by which the form is to be submitted.
... notfounderror the specified submitter isn't a member of the form on which
requestsubmit() was called.
...And 4 more matches
IDBOpenDBRequest.onblocked - Web APIs
the onblocked event handler of the idbopendb
request interface is the event handler for the blocked event.
... syntax idbopendb
request.onblocked = function(event) { ...
... }; example var db; // let us open our database var
request = indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not
request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; };
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...And 4 more matches
IDBRequest.onerror - Web APIs
the onerror event handler of the idb
request interface handles the error event, fired when a
request returns an error.
... syntax
request.onerror = function(event) { ...
... }; example the following example
requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitle
request.result), updates one property of the record, and then puts the updated record back into the object store.
...And 4 more matches
IDBRequest.source - Web APIs
the source read-only property of the idb
request interface returns the source of the
request, such as an index or an object store.
... syntax var idbindex =
request.source; var idbcursor =
request.source; var idbobjectstore =
request.source; value an object representing the source of the
request, such as an idbindex, idbobjectstore or idbcursor.
... example the following example
requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitle
request.result), updates one property of the record, and then puts the updated record back into the object store in another
request.
...And 4 more matches
PaymentRequest.onpaymentmethodchange - Web APIs
the payment
request event handler onpaymentmethodchange is invoked when the paymentmethodchange is fired, indicating that the user has changed payment methods within a given payment handler.
... syntax payment
request.addeventlistener('paymentmethodchange', paymentmethodchangeevent => { ...
... }); payment
request.onpaymentmethodchange = function(paymentmethodchangeevent) { ...
...And 4 more matches
PaymentRequestEvent - Web APIs
the payment
requestevent interface of the the payment
request api is the object passed to a payment handler when a payment
request is made.
... constructor payment
requestevent() creates a new payment
requestevent object.
... payment
requestidread only returns the id of the payment
request object.
...And 4 more matches
RTCIceCandidatePairStats.requestsReceived - Web APIs
the rtcicecandidatepairstats dictionary's
requestsreceived property indicates the total number of stun connectivity check
requests that have been received so far on the connection described by this pairing of candidates.
... syntax
requestsreceived = rtcicecandidatepairstats.
requestsreceived; value an integer value which specifies the number of stun connectivity and/or consent
requests that have been received to date on the connection described by this pair of ice candidates.
... because there's no way to tell the difference between
requests made to check connectivity and
requests made to check consent, the returned figure includes both.
...And 4 more matches
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
here is a an example javascript function that prints the security details of an xmlhttp
request sent over ssl.
... the function is passed the channel property of an xmlhttp
request to extract the following information: was the connection secure?
... the channel property becomes available only after the
request is sent and the connection was established, that is, on readystate loaded, interactive or completed.
...And 4 more matches
XMLHttpRequest.open() - Web APIs
the xmlhttp
request method open() initializes a newly-created
request, or re-initializes an existing one.
... note: calling this method for an already active
request (one for which open() has already been called) is the equivalent of calling abort().
... syntax xmlhttp
request.open(method, url[, async[, user[, password]]]) parameters method the http
request method to use, such as "get", "post", "put", "delete", etc.
...And 4 more matches
XMLHttpRequest.timeout - Web APIs
the xmlhttp
request.timeout property is an unsigned long representing the number of milliseconds a
request can take before automatically being terminated.
...timeout shouldn't be used for synchronous xmlhttp
requests
requests used in a document environment or it will throw an invalidaccesserror exception.
... note: you may not use a timeout for synchronous
requests with an owning window.
...And 4 more matches
XMLHttpRequest.withCredentials - Web APIs
the xmlhttp
request.withcredentials property is a boolean that indicates whether or not cross-site access-control
requests should be made using credentials such as cookies, authorization headers or tls client certificates.
... setting withcredentials has no effect on same-site
requests.
...xmlhttp
request from a different domain cannot set cookie values for their own domain unless withcredentials is set to true before making the
request.
...And 4 more matches
BasicCardRequest.supportedNetworks - Web APIs
the supportednetworks property of the basiccard
request dictionary contains an array of domstrings representing the card networks that the retailer supports (e.g.
...legal values are defined in the w3c's document card network identifiers approved for use with payment
request api, and are currently: amex cartebancaire diners discover jcb mastercard mir unionpay visa example the following example shows a sample definition of the first parameter of the payment
request() constructor, the data property of which contains supportednetworks and supportedtypes properties.
...}; var
request = new payment
request(supportedinstruments, details, options); specifications specification status comment basic card paymentthe definition of 'supportednetworks' in that specification.
...And 3 more matches
Bluetooth.requestDevice() - Web APIs
the bluetooth.
requestdevice() method of the bluetooth interface returns a promise to a bluetoothdevice object with the specified options.
... syntax bluetooth.
requestdevice([options]) .then(function(bluetoothdevice) { ...
... parameters options optional an object that sets options for the device
request.
...And 3 more matches
IDBCursor.request - Web APIs
the
request read-only property of the idbcursor interface returns the idb
request used to obtain the cursor.
... syntax var
request = cursor.
request; value an idb
request object instance.
... examples when you open a cursor, the
request property is then available on that cursor object, to tell you what
request object the cursor originated from.
...And 3 more matches
IDBRequest.onsuccess - Web APIs
the onsuccess event handler of the idb
request interface handles the success event, fired when the result of a
request is successfully returned.
... syntax
request.onsuccess = function(event) { ...
... }; example the following example
requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitle
request.result), updates one property of the record, and then puts the updated record back into the object store.
...And 3 more matches
IDBRequest.result - Web APIs
the result read-only property of the idb
request interface returns the result of the
request.
... if the
request failed and the result is not available, an invalidstateerror exception is thrown.
... syntax var myresult =
request.result; value any example the following example
requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitle
request.result), updates one property of the record, and then puts the updated record back into the object store.
...And 3 more matches
Notification.requestPermission() - Web APIs
the
requestpermission() method of the notification interface
requests permission from the user for the current origin to display notifications.
... syntax the latest spec has updated this method to a promise-based syntax that works like this: notification.
requestpermission().then(function(permission) { ...
... }); previously, the syntax was based on a simple callback; this version is now deprecated: notification.
requestpermission(callback); parameters callback optional deprecated since gecko 46 an optional callback function that is called with the permission value.
...And 3 more matches
PaymentRequest: paymentmethodchange event - Web APIs
paymentmethodchange events are delivered by the payment
request api to a payment
request object when the user changes payment methods within a given payment handler.
...this code creates a new payment
request, adds a handler for the paymentmethodchange event by calling the
request's addeventlistener(), then calls show() to present the payment interface to the user.
... const options = {
requestshipping: true }; const payment
request = new payment
request(paymentmethods, detailsforshipping("ground"), options); payment
request.addeventlistener("paymentmethodchange", handlepaymentchange, false); payment
request.show() .then(response => response.complete("success")) .catch(err => console.log("error handling payment
request: " + err)); the event handler function itself, handlepaymentchange(), looks like this: handlepaymentchange = event => { const details...
...And 3 more matches
PaymentRequest.shippingType - Web APIs
the shippingtype read-only property of the payment
request interface returns one of "shipping", "delivery", "pickup", or null if one was not provided by the constructor.
... syntax var shippingtype = payment
request.shippingtype value one of "shipping", "delivery", "pickup", or null.
... specifications specification status comment payment
request apithe definition of 'shippingtype' in that specification.
...And 3 more matches
PaymentRequestEvent() - Web APIs
the payment
requestevent constructor creates a new payment
requestevent object which is a constructor for a payment
requestevent which is the object passed to a payment handler when a payment
request is made..
... syntax var payment
requestevent = new payment
requesteventy(type, options) parameters type must always be 'payment
request'.
... payment
requestid: the id of the payment
request object.
...And 3 more matches
PaymentResponse.requestId - Web APIs
the
requestid read-only property of the paymentresponse interface rreturns the free-form identifier supplied by the paymentresponse() constructor by details.id.
... syntax var id = payment
request.id value a domstring.
... specifications specification status comment payment
request apithe definition of '
requestid' in that specification.
...And 3 more matches
PerformanceResourceTiming.requestStart - Web APIs
the
requeststart read-only property returns a timestamp of the time immediately before the browser starts
requesting the resource from the server, cache, or local resource.
... if the transport connection fails and the browser retires the
request, the value returned will be the start of the retry
request.
... there is no end property for
requeststart.
...And 3 more matches
RTCIceCandidatePairStats.requestsSent - Web APIs
the rtcicecandidatepairstats dictionary's
requestssent property indicates the total number of stun connectivity check
requests that have been sent so far on the connection described by this pair of candidates.
... syntax
requestssent = rtcicecandidatepairstats.
requestssent; value an integer value which specifies the number of stun connectivity
requests that have been sent to date on the connection described by this pair of ice candidates.
... note: the reported number of
requests does not include retransmissions.
...And 3 more matches
Request.clone() - Web APIs
the clone() method of the
request interface creates a copy of the current
request object.
...in fact, the main reason clone() exists is to allow multiple uses of body objects (when they are one-use only.) if intend to modify the
request, you may prefer the
request constructor.
... syntax var new
request =
request.clone(); parameters none.
...And 3 more matches
XMLHttpRequest.getAllResponseHeaders() - Web APIs
the xmlhttp
request method getallresponseheaders() returns all the response headers, separated by crlf, as a string, or returns null if no response has been received.
... note: for multipart
requests, this returns the headers from the current part of the
request, not from the original channel.
... syntax var headers = xmlhttp
request.getallresponseheaders(); parameters none.
...And 3 more matches
XMLHttpRequest.onreadystatechange - Web APIs
the xmlhttp
request.onreadystatechange property contains the event handler to be called when the readystatechange event is fired, that is every time the readystate property of the xmlhttp
request changes.
... warning: this should not be used with synchronous
requests and must not be used from native code.
... syntax xmlhttp
request.onreadystatechange = callback; values callback is the function to be executed when the readystate changes.
...And 3 more matches
XMLHttpRequest.responseText - Web APIs
the read-only xmlhttp
request property responsetext returns the text received from a server following a
request being sent.
... syntax var resulttext = xmlhttp
request.responsetext; value a domstring which contains either the textual data received using the xmlhttp
request or null if the
request failed or "" if the
request has not yet been sent by calling send().
... while handling an asynchronous
request, the value of responsetext always has the current content received from the server, even if it's incomplete because the data has not been completely received yet.
...And 3 more matches
XMLHttpRequestResponseType - Web APIs
the xmlhttp
requestresponsetype type is an enumerated set of strings which are used to specify the type of data contained in the response of an xmlhttp
request.
... these values are used when getting or setting the responsetype on the
request.
...see html in xmlhttp
request to learn more about using xhr to fetch html content.
...And 3 more matches
CORS-safelisted request header - MDN Web Docs Glossary: Definitions of Web-related terms
a cors-safelisted
request header is one of the following http headers: accept, accept-language, content-language, content-type.
... when containing only these headers (and values that meet the additional requirements laid out below), a
requests doesn't need to send a preflight
request in the context of cors.
... you can safelist more headers using the access-control-allow-headers header and also list the above headers there to circumvent the following additional restrictions: additional restrictions cors-safelisted headers must also fulfill the following requirements in order to be a cors-safelisted
request header: for accept-language and content-language: can only have values consisting of 0-9, a-z, a-z, space or *,-.;=.
...And 2 more matches
Preflight request - MDN Web Docs Glossary: Definitions of Web-related terms
a cors preflight
request is a cors
request that checks to see if the cors protocol is understood and a server is aware using specific methods and headers.
... it is an options
request, using three http
request headers: access-control-
request-method, access-control-
request-headers, and the origin header.
... a preflight
request is automatically issued by a browser and in normal cases, front-end developers don't need to craft such
requests themselves.
...And 2 more matches
nsIInterfaceRequestor
xpcom/base/nsiinterface
requestor.idlscriptable this interface defines a generic interface for
requesting interfaces that a given object might provide access to.
...the main difference is that interfaces returned are not required to provide a way back to the object implementing nsiinterface
requestor.
...nsiinterface
requestor, however, allows you to obtain an interface c from a that may (or most likely) will not have the ability to get back to a.
...And 2 more matches
CanvasCaptureMediaStreamTrack.requestFrame() - Web APIs
the canvascapturemediastreamtrack method
requestframe()
requests that a frame be captured from the canvas and sent to the stream.
... applications that need to carefully control the timing of rendering and frame capture can use
requestframe() to directly specify when it's time to capture a frame.
... to prevent automatic capture of frames, so that frames are only captured when
requestframe() is called, specify a value of 0 for the capturestream() method when creating the stream.
...And 2 more matches
FetchEvent.request - Web APIs
the
request read-only property of the fetchevent interface returns the
request that triggered the event handler.
... this property is non-nullable (since version 46, in the case of firefox.) if a
request is not provided by some other means, the constructor init object must contain a
request (see fetchevent.fetchevent().) syntax var recent
request = fetchevent.
request; value a
request object.
...this promise resolves to the first matching url
request in the cache object.
...And 2 more matches
IDBRequest: error event - Web APIs
the error handler is executed when an error caused a
request to fail.
... bubbles yes cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.addeventlistener('upgradeneeded', event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'ho...
...urs', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }); dbopen
request.addeventlistener('success', event => { const db = dbopen
request.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstore
request = objectstore.add(newitem); objectstore
request.addeventlistener('error', () => { console.log(`error add...
...And 2 more matches
IDBVersionChangeRequest.setVersion() - Web APIs
the idbversionchange
request.setversion method updates the version of the database, returning immediately and running a versionchange transaction on the connected database in a separate thread.
...the new way is to define the version in the idbdatabase.open() method and create and delete object stores in the onupgradeneeded event handler associated with the returned
request.
... syntax idbversionchange
request setversion ([treatnullas=emptystring] in domstring version); example tbd parameters version the version to store in the database.
...And 2 more matches
IDBVersionChangeRequest - Web APIs
the new way to do it is to use the idbopendb
request interface which has now the onblocked handler and the newly needed onupgradeneeded one.
... the idbversionchange
request interface the indexeddb api represents a
request to change the version of a database.
... methods inherits from: idb
request idbversionchange
request.setversion updates the version of the database.
...And 2 more matches
MediaRecorder.requestData() - Web APIs
the mediarecorder.
requestdata() method (part of the mediarecorder api) is used to raise a dataavailable event containing a blob object of the captured media as it was when the method was called.
... when the
requestdata() method is invoked, the browser queues a task that runs the following steps: if mediarecorder.state is not "recording", raise a dom invalidstate error and terminate these steps.
... syntax mediarecorder.
requestdata() errors an invalidstate error is raised if the
requestdata() method is called while the mediarecorder object’s mediarecorder.state is not "recording" — the media cannot be captured if recording is not occurring.
...And 2 more matches
PaymentRequest: merchantvalidation event - Web APIs
merchantvalidation events are delivered by the payment
request api to a payment
request object when a payment handler requires that the merchant
requesting the purchase validate itself as permitted to use the payment handler.
...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.
...
request.addeventlistener("merchantvalidation", event => { event.complete(async () => { const merchantserverurl = window.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.
...And 2 more matches
PaymentRequest: shippingoptionchange event - Web APIs
for payment
requests that
request shipping information, and for which shipping options are offered, the shippingoptionchange event is sent to the payment
request whenever the user chooses a shipping option from the list of available options.
... bubbles no cancelable no interface payment
requestupdateevent event handler property onshippingoptionchange examples this code snippet sets up a handler for the shippingoptionchange event.
... payment
request.addeventlistener("shippingoptionchange", event => { const value = calculatenewtotal(payment
request.shippingoption); const total = { currency: "eur", label: "total due", value, }; event.updatewith({ total }); }, false); after caling a custom function, calculatenewtotal(), to compute the updated total based on the newly-selected shipping option as specified by the shippingoption.
...And 2 more matches
PaymentRequest.payerName - Web APIs
this option is only present when the
requestpayername option is set to true in the options parameter of the payment
request() constructor.
... specifications specification status comment payment
request apithe definition of 'payername' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
...And 2 more matches
ReadableStreamBYOBRequest - Web APIs
the readablestreambyob
request interface of the streams api represents a pull
request into a readablebytestreamcontroller view.
...readablestreambyob
request instance is created automatically by readablebytestreamcontroller as needed.
... properties readablestreambyob
request.view read only returns the current view.
...And 2 more matches
Request.context - Web APIs
the deprecated context read-only property of the
request interface contains the context of the
request (e.g., audio, image, iframe).
... the context of a
request is only relevant in the serviceworker api; a service worker can make decisions based on whether the url is for an image, or an embeddable object such as a <video>, iframe, etc.
... note: you can find a full list of the different available contexts including associated context frame types, csp directives, and platform feature examples in the fetch spec
request context section.
...And 2 more matches
Request.destination - Web APIs
the destination read-only property of the
request interface returns a string describing the type of content being
requested.
... the string must be one of those found in the
requestdestination enumerated type or the empty string, which is the default value.
... the destination is used by the user 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.
...And 2 more matches
USB.requestDevice() - Web APIs
the
requestdevice() method of the usb interface returns a promise that resolves with an instance of usbdevice if the specified device is found.
... syntax usb.
requestdevice([filters]) parameters filters an array of filter objects for possible devices you would like to pair.
...both are passed to
requestdevice().
...And 2 more matches
WakeLock.request() - Web APIs
the
request() method of the wakelock interface returns a promise that resolves with a wakelocksentinel object, which allows control over screen dimming and locking.
... syntax var wakelock = navigator.wakelock.
request(type); parameters type options are as follows: 'screen':
requests a screen wake lock.
... examples the following asynchronous function
requests a wakelocksentinel object.
...And 2 more matches
Window.requestFileSystem() - Web APIs
the non-standard window method
requestfilesystem() method is a google chrome-specific method which lets a web site or app gain access to a sandboxed file system for its own use.
... even compared to the rest of the file and directory entries api,
requestfilesystem() is especially non-standard; only chrome implements it, and all other browser makers have decided that they will not implement it.
... window.
requestfilesystem(type, size, successcallback[, errorcallback]); parameters type the type of storage to
request.
...And 2 more matches
window.requestIdleCallback() - Web APIs
the window.
requestidlecallback() method queues a function to be called during a browser's idle periods.
... you can call
requestidlecallback() within an idle callback function to schedule another callback to take place no sooner than the next pass through the event loop.
... syntax var handle = window.
requestidlecallback(callback[, options]) return value an id which can be used to cancel the callback by passing it into the window.cancelidlecallback() method.
...And 2 more matches
XMLHttpRequest.getResponseHeader() - Web APIs
the xmlhttp
request method getresponseheader() returns the string containing the text of a particular header's value.
... syntax var myheader = xmlhttp
request.getresponseheader(headername); parameters headername a bytestring indicating the name of the header you want to return the text value of.
... example in this example, a
request is created and sent, and a readystatechange handler is established to look for the readystate to indicate that the headers have been received; when that is the case, the value of the content-type header is fetched.
...And 2 more matches
XMLHttpRequest.overrideMimeType() - Web APIs
the xmlhttp
request method overridemimetype() specifies a mime type other than the one provided by the server to be used instead when interpreting the data being transferred in a
request.
... syntax xmlhttp
request.overridemimetype(mimetype) parameters mimetype a domstring specifying the mime type to use instead of the one specified by the server.
... if the server doesn't specify a type, xmlhttp
request assumes "text/xml".
...And 2 more matches
XMLHttpRequest.readyState - Web APIs
the xmlhttp
request.readystate property returns the state an xmlhttp
request client is in.
... unsent the xmlhttp
request client has been created, but the open() method hasn't been called yet.
...during this state, the
request headers can be set using the set
requestheader() method and the send() method can be called which will initiate the fetch.
...And 2 more matches
XMLHttpRequest.responseXML - Web APIs
the xmlhttp
request.responsexml read-only property returns a document containing the html or xml retrieved by the
request; or null if the
request was unsuccessful, has not yet been sent, or if the data can't be parsed as xml or html.
...if the responsetype is set to "document" and the
request was made asynchronously, instead the response is parsed as "text/html".
... if the server doesn't specify the content-type as "text/xml" or "application/xml", you can use xmlhttp
request.overridemimetype() to parse it as xml anyway.
...And 2 more matches
XRSession.requestReferenceSpace() - Web APIs
the
requestreferencespace() method of the xrsession interface returns a promise that resolves with an instance of either xrreferencespace or xrboundedreferencespace as appropriate given the type of reference space
requested.
... syntax refspacepromise = xrsession.
requestreferencespace(referencespacetype); parameters type a domstring specifying the type of reference space for which an instance is to be returned.
... the reference space returned by xrsession.
requestreferencespace() is either xrreferencespace or xrboundedreferencespace.
...And 2 more matches
Requests For Enhancement - Archive of obsolete content
introduction the purpose of this page is to gather
requests for enhancement to the mozilla xforms implementation.
... if you have an idea that might improve mozilla's xforms implementation then you should choose one of the following rfe categories and put your
request there.
... you can also contact the xforms team about your
request.
...an additional way to attract the xforms team's attention to an enhancement
request you are promoting is to vote for the bug that is related with the feature
request (if there is no bug yet then please feel free to file it).
BasicCardRequest.supportedTypes - Web APIs
the obsolete supportedtypes property of the basiccard
request dictionary can optionally be provided to specify an array of domstrings representing the card types that the retailer supports (e.g.
... syntax basiccard
request.supportedtypes = [cardtype1...cardtypen]; value an array containing one or more domstrings, which describe the card types the retailer supports.
... legal values are defined in basiccardtype enum, and are currently: credit debit prepaid example the following example shows a sample definition of the first parameter of the payment
request() constructor, the data property of which contains supportednetworks and supportedtypes properties.
...}; var
request = new payment
request(supportedinstruments, details, options); ...
FileRequest - Web APIs
summary the file
request interface extends the dom
request interface to provide some extra properties necessary for the lockedfile objects.
... properties file
request.lockedfile read only the lockedfile object from which the
request was started.
... file
request.onprogress a callback handler called repeatedly while the operation represented by the file
request is in progress.
... the file
request interface also inherits from the dom
request interface.
IDBRequest: success event - Web APIs
the success event is fired when an idb
request succeeds.
... bubbles no cancelable no interface event event handler property onsuccess examples this example tries to open a database and listens for the success event using addeventlistener(): // open the database const open
request = window.indexeddb.open('todolist', 4); open
request.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createi...
...ndex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; open
request.addeventlistener('success', (event) => { console.log('database opened successfully!'); }); the same example, but using the onsuccess event handler property: // open the database const open
request = window.indexeddb.open('todolist', 4); open
request.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { uni...
...que: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; open
request.onsuccess = (event) => { console.log('database opened successfully!'); }; ...
Navigator.requestMediaKeySystemAccess() - Web APIs
the navigator.
requestmediakeysystemaccess() method returns a promise which delivers a mediakeysystemaccess object that can be used to access a particular media key system, which can in turn be used to create keys for decrypting a media stream.
...consider that when deciding when to call
requestmediakeysystemaccess(); you don't want those
requests to happen at inconvenient times.
... syntax promise = navigator.
requestmediakeysystemaccess(keysystem, supportedconfigurations); parameters keysystem a domstring identifying the key system.
... specifications specification status comment encrypted media extensionsthe definition of '
requestmediakeysystemaccess()' in that specification.
PaymentRequest.onmerchantvalidation - Web APIs
the payment
request event handler onmerchantvalidation is invoked when the merchantvalidation is fired, indicating that the payment handler (e.g., apple pay) requires the merchant to validate themselves.
... syntax payment
request.onmerchantvalidation = eventhandlerfunction; value an event handler function which is to be called whenever the merchantvalidation event is fired at the payment
request, indicating that the payment handler requires the merchant to validate themselves as allowed to use this payment handler.
... examples an example merchant validation handler for the payment
request object
request looks like this:
request.onmerchantvalidation = ev => { ev.complete(async () => { const merchantserverurl = window.location.origin + '/validation?url=' + encodeuricomponent(ev.validationurl); // get validation data, and complete validation; return await fetch(merchantserverurl).then(r => r.text()); }) }; const response = await
request.show(); for more information, see merchant validation in payment processing concepts.
... specifications specification status comment payment
request apithe definition of 'onmerchantvalidation' in that specification.
PaymentRequest: shippingaddresschange event - Web APIs
the shippingaddresschange event is sent to the payment
request object when the user selects a shipping address or changes details of their shipping address.
... bubbles no cancelable no interface payment
requestupdateevent event handler property onshippingaddresschange usage notes depending on the browser, the shipping address information may be redacted for privacy reasons.
... const payment
request = new payment
request(methoddata, details, options); payment
request.addeventlistener("shippingaddresschange", event => { let detailsupdate = checkaddress(payment
request.shippingaddress); event.updatewith(detailsupate); }, false); const checkaddress = theaddress => { let detailsupdate = {}; // check the address, return a paymentdetailsupdate object // with any changes or errors.
... return detailsupdate; }; you can also establish a handler for shippingaddresschange using the onshippingaddresschange event handler property: payment
request.onshippingaddresschange = event => { let detailsupdate = checkaddress(payment
request.shippingaddress); event.updatewith(detailsupdate); }; specifications specification status comment payment
request apithe definition of 'shippingaddresschange' in that specification.
PaymentRequestUpdateEvent - Web APIs
the payment
requestupdateevent interface is used for events sent to a payment
request instance when changes are made to shipping-related information for a pending payment
request.
... constructor payment
requestupdateevent() secure context creates a new payment
requestupdateevent object.
... methods in addition to methods inherited from the parent interface, event, payment
requestupdateevent offers the following methods: payment
requestupdateevent.updatewith() secure context if the event handler determines that information included in the payment
request needs to be changed, or that new information needs to be added, it calls updatewith() with the information that needs to be replaced or added.
... specifications specification status comment payment
request apithe definition of 'payment
requestupdateevent' in that specification.
RequestDestination - Web APIs
the
requestdestination enumerated type contains the permitted values for a
request's destination.
... these string values indicate potential types of content that a
request may try to retrieve.
...navigator.sendbeacon(), eventsource, <a ping>, <area ping>, fetch(), xmlhttp
request, websocket, cache and more.
... specifications specification status comment fetchthe definition of '
requestdestination' in that specification.
StorageQuota.requestPersistentQuota - Web APIs
the
requestpersistentquota() property of the storagequota interface
requests persistent storage for the
requesting application and returns a promise to an instance of storageinfo.
... there is no guarantee that the
requested space will be granted by the user agent.
... syntax storagequota.
requestpersistentquota().then(function(storageinfo) { ...
... specifications specification status comment quota management apithe definition of '
requestpersistentquota()' in that specification.
XDomainRequest.onprogress - Web APIs
this method is called periodically as an event handler for progress events on xdomain
requests, so that code can monitor progress while loading content.
... note: while handling this event, you can look at xdomain
request.responsetext to get the response so far.
... once loading is complete, the xdomain
request.onload event handler gets called.
... example var xdr = new xdomain
request(); xdr.open("post", "http://example.com/api/method"); xdr.onprogress = function(){ //handle partial response with xdr.responsetext } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1¶m2=value2"); specification not part of any specification.
XDomainRequest.open() - Web APIs
opens an xdomain
request which is configured to use a given method (get/post) and url.
... syntax xdr.open(method, url); parameters method the http method to use for the
request.
... (get or post) url the url to which to send the
request.
... example var xdr = new xdomain
request(); xdr.open("get", "http://example.com/api/method"); specification not part of any specification.
XDomainRequest.send() - Web APIs
sends an xdomain
request which has previously been opened calling xdomain
request.open().
... syntax xdr.send(data); parameters data the form data to be sent with the
request.
... this parameter is optional for get
requests.
... example var xdr = new xdomain
request(); xdr.open("post", "http://example.com/api/method"); xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1¶m2=value2"); specification not part of any specification.
XMLHttpRequest.abort() - Web APIs
the xmlhttp
request.abort() method aborts the
request if it has already been sent.
... when a
request is aborted, its readystate is changed to xmlhttp
request.unsent (0) and the
request's status code is set to 0.
... syntax xmlhttp
request.abort() parameters none.
... var xhr = new xmlhttp
request(), method = "get", url = "https://developer.mozilla.org/"; xhr.open(method, url, true); xhr.send(); if (oh_noes_we_need_to_cancel_right_now_or_else) { xhr.abort(); } specifications specification status comment xmlhttp
request living standard whatwg living standard ...
XMLHttpRequest.sendAsBinary() - Web APIs
the obsolete xmlhttp
request method sendasbinary() is a variant of the send() method that sends binary data.
... syntax xmlhttp
request.sendasbinary(binarystring); parameters binarystring a domstring which encodes the binary content to be sent.
... /*\ |*| |*| :: xmlhttp
request.prototype.sendasbinary() polyfill :: |*| |*| https://developer.mozilla.org/docs/dom/xmlhttp
request#sendasbinary() |*| \*/ if (!xmlhttp
request.prototype.sendasbinary) { xmlhttp
request.prototype.sendasbinary = function (sdata) { var nbytes = sdata.length, ui8data = new uint8array(nbytes); for (var nidx = 0; nidx < nbytes; nidx++) { ui8data[nidx] = sdata.charcodeat(nidx) & 0xff; } ...
...however, on google chrome, when you try to send an arraybuffer, the following warning message will appear: arraybuffer is deprecated in xmlhttp
request.send().
XMLHttpRequest.status - Web APIs
the read-only xmlhttp
request.status property returns the numerical http status code of the xmlhttp
request's response.
... before the
request completes, the value of status is 0.
... browsers also report a status of 0 in case of xmlhttp
request errors.
... example var xhr = new xmlhttp
request(); console.log('unsent: ', xhr.status); xhr.open('get', '/server'); console.log('opened: ', xhr.status); xhr.onprogress = function () { console.log('loading: ', xhr.status); }; xhr.onload = function () { console.log('done: ', xhr.status); }; xhr.send(); /** * outputs the following: * * unsent: 0 * opened: 0 * loading: 200 * done: 200 */ specifications specification status comment xmlhttp
request living standard whatwg living standard ...
XMLHttpRequest.statusText - Web APIs
the read-only xmlhttp
request.statustext property returns a domstring containing the response's status message as returned by the http server.
... unlike xmlhttp
request.status which indicates a numerical status code, this property contains the text of the response status, such as "ok" or "not found".
... if the
request's readystate is in unsent or opened state, the value of statustext will be an empty string.
... example var xhr = new xmlhttp
request(); console.log('0 unsent', xhr.statustext); xhr.open('get', '/server', true); console.log('1 opened', xhr.statustext); xhr.onprogress = function () { console.log('3 loading', xhr.statustext); }; xhr.onload = function () { console.log('4 done', xhr.statustext); }; xhr.send(null); /** * outputs the following: * * 0 unsent * 1 opened * 3 loading ok * 4 done ok */ specifications specification status comment xmlhttp
request living standard whatwg living standard ...
XMLHttpRequest.upload - Web APIs
the xmlhttp
request upload property returns an xmlhttp
requestupload object that can be observed to monitor an upload's progress.
... it is an opaque object, but because it's also an xmlhttp
requesteventtarget, event listeners can be attached to track its process.
... timeout ontimeout the upload timed out because a reply did not arrive within the time interval specified by the xmlhttp
request.timeout.
... specifications specification status comment xmlhttp
request living standard whatwg living standard ...
XMLHttpRequestEventTarget.onabort - Web APIs
the xmlhttp
requesteventtarget.onabort is the function called when an xmlhttp
request transaction is aborted, such as when the xmlhttp
request.abort() function is called.
... syntax xmlhttp
request.onabort = callback; values callback is the function to be executed when the transaction is aborted.
... example var xmlhttp = new xmlhttp
request(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onabort = function () { console.log('** the
request was aborted'); }; xmlhttp.send(); //..
... xmlhttp.abort(); // this will invoke our onabort handler above specifications specification status comment xmlhttp
request living standard whatwg living standard ...
XMLHttpRequestEventTarget.onload - Web APIs
the xmlhttp
requesteventtarget.onload is the function called when an xmlhttp
request transaction completes successfully.
... syntax xmlhttp
request.onload = callback; values callback is the function to be executed when the
request completes successfully.
...the context) is the same xmlhttp
request this callback is related to.
... example var xmlhttp = new xmlhttp
request(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onload = function () { // do something with the retrieved data ( found in xmlhttp.response ) }; xmlhttp.send(); specifications specification status comment xmlhttp
request living standard whatwg living standard ...
Reason: CORS request did not succeed - HTTP
reason reason: cors
request did not succeed what went wrong?
... the http
request which makes use of cors failed because the http connection failed at either the network or protocol level.
...an ad blocker or privacy protector) blocking the
request.
... the server did not respond to the actual
request (even if it responded to the preflight
request).
Access-Control-Request-Headers - HTTP
the access-control-
request-headers
request header is used by browsers when issuing a preflight
request, to let the server know which http headers the client might send when the actual
request is made.
... header type
request header forbidden header name yes syntax access-control-
request-headers: <header-name>, <header-name>, ...
... directives <header-name> a comma-delimited list of http headers that are included in the
request.
... examples access-control-
request-headers: x-pingother, content-type specifications specification status comment fetchthe definition of 'access-control-
request-headers' in that specification.
Access-Control-Request-Method - HTTP
the access-control-
request-method
request header is used by browsers when issuing a preflight
request, to let the server know which http method will be used when the actual
request is made.
... this header is necessary as the preflight
request is always an options and doesn't use the same method as the actual
request.
... header type
request header forbidden header name yes syntax access-control-
request-method: <method> directives <method> one of the http
request methods, for example get, post, or delete.
... examples access-control-
request-method: post specifications specification status comment fetchthe definition of 'access-control-
request-method' in that specification.
431 Request Header Fields Too Large - HTTP
the http 431
request header fields too large response status code indicates that the server refuses to process the
request because the
request’s http headers are too long.
... the
request may be resubmitted after reducing the size of the
request headers.
... 431 can be used when the total size of
request headers is too large, or when a single header field is too large.
... servers will often produce this status if: the referer url is too long there are too many cookies sent in the
request status 431
request header fields too large specifications specification title rfc 6585, section 5: 431
request header fields too large additional http status codes ...
The life of an HTML HTTP request - Archive of obsolete content
[note: passes nswebshell.mobserver as nsistreamobserver and the webshell as nsicontentviewercontainer to the docloader.] (2) the document loader calls ns_openuri with the url to begin transfering the
requested file.
... (3) when data is starting to come from the webserver the nsichannel calls the onstart
request in the documenloader.
...this streamlistener is returned to the documentloader and connected to the nsichannel of the
request.
Fetch metadata request header - MDN Web Docs Glossary: Definitions of Web-related terms
a fetch metadata
request header is a http
request header that provides additional information about the context the
request originated from.
... fetch metadata
request headers provide the server with additional information about where the
request originated from, enabling it to ignore potentially malicious
requests.
... the following are fetch metadata
request headers: sec-fetch-site sec-fetch-mode sec-fetch-user sec-fetch-dest ...
Element.requestPointerLock() - Web APIs
the element.
requestpointerlock() method lets you asynchronously ask for the pointer to be locked on the given element.
... to track the success or failure of the
request, it is necessary to listen for the pointerlockchange and pointerlockerror events at the document level.
... syntax instanceofelement.
requestpointerlock(); specifications specification status comment pointer lockthe definition of '
requestpointerlock()' in that specification.
FileRequest.onprogress - Web APIs
summary this property specifies a callback function to be run repeatedly while the operation represented by a file
request object is in progress.
... syntax instanceoffile
request.onprogress = function; where instanceoffile
request is a file
request object and function is the javascript function to execute.
... example // assuming '
request' which is a file
request object
request.onprogress = function (status) { var progress = document.queryselector('progress'); progress.value = status.loaded; progress.max = status.total; } specification not part of any current specification.
IDBOpenDBRequest: blocked event - Web APIs
bubbles no cancelable no interface idbversionchangeevent event handler property onblocked examples using addeventlistener(): // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objects...
...tore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = (event) => { // let's try to open the same database with a higher revision version const req2 = indexeddb.open('todolist', 5); // in this case the onblocked handler will be executed req2.addeventlistener('blocked', () => { console.log('
request was blocked'); }); }; using the onblocked property: // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating d...
...asktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = (event) => { // let's try to open the same database with a higher revision version const req2 = indexeddb.open('todolist', 5); // in this case the onblocked handler will be executed req2.onblocked = () => { console.log('
request was blocked'); }; }; ...
generateRequest() - Web APIs
the mediakeysession.generate
request() method returns a promise after generating a media
request based on initialization data.
... syntax mediakeysession.generate
request().then(function) { ...
... }); specifications specification status comment encrypted media extensionsthe definition of 'generate
request()' in that specification.
paymentRequestId - Web APIs
the payment
requestid read-only property of the payment
requestevent interface returns the id of the payment
request object.
... syntax var id = payment
requestevent.payment
requestid value a domstring contains the id.
... specifications specification status comment payment handler apithe definition of 'payment
requestid' in that specification.
PaymentRequestUpdateEvent.updateWith() - Web APIs
the updatewith() method of the payment
requestupdateevent interface updates the details of an existing payment
request.
... syntax payment
requestupdateevent.updatewith(details); parameters details a paymentdetailsupdate object specifying the changes applied to the payment
request: displayitems optional an array of paymentitem objects, each describing one line item for the payment
request.
... specifications specification status comment payment
request apithe definition of 'payment
requestupdateevent.updatewith()' in that specification.
PerformanceTiming.requestStart - Web APIs
the legacy performancetiming.
requeststart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the browser sent the
request to obtain the actual document, from the server or from a cache.
... if the transport layer fails after the start of the
request and the connection is reopened, this property will be set to the time corresponding to the new
request.
... syntax time = performancetiming.
requeststart; specifications specification status comment navigation timingthe definition of 'performancetiming.
requeststart' in that specification.
PublicKeyCredentialRequestOptions.extensions - Web APIs
extensions, an optional property of the publickeycredential
requestoptions dictionary, is an object providing the client extensions and their input values.
... extensions are values
requesting additional processing by the client and by the authenticator.
... syntax extensions = publickeycredential
requestoptions.extensions value an object with various keys and values.
RTCIceCandidatePairStats.consentRequestsSent - Web APIs
the rtcicecandidatepairstats property consent
requestssent specifies the number of consent
requests that have been sent by this peer to the remote peer on the connection described by the pair of candidates.
... syntax consent
requestssent = rtcicecandidatepairstats.consent
requestssent; value an integer indicating the number of consent
requests this peer has sent to the other peer over the connection described by the pair of candidates referenced by this rtcicecandidatepairstats object.
... specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.consent
requestssent' in that specification.
RTCIceCandidatePairStats.firstRequestTimestamp - Web APIs
the rtcicecandidatepairstats property first
requesttimestamp specifies the time at which the first stun
request was sent on the described candidate pair.
... syntax first
requesttimestamp = rtcicecandidatepairstats.first
requesttimestamp; value a domhighrestimestamp object indicating the timestamp at which the first stun
request was sent on the connection described by the described pair of candidates.
... you can use this value in combination with last
requesttimestamp and
requestssent to compute the average interval between consecutive connectivity checks: avgcheckinterval = (candidatepairstats.last
requesttimestamp - candidatepairstats.first
requesttimestamp) / candidatepairstats.
requestssent; specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.first
requesttimestamp' in that specification.
RTCIceCandidatePairStats.lastRequestTimestamp - Web APIs
the rtcicecandidatepairstats property last
requesttimestamp indicates the time at which the most recent stun
request was sent on the described candidate pair.
... syntax last
requesttimestamp = rtcicecandidatepairstats.last
requesttimestamp; value a domhighrestimestamp object indicating the timestamp at which the last (most recent) stun
request was sent on the connection indicated by the described pair of candidates.
... you can use this value in combination with first
requesttimestamp and
requestssent to compute the average interval between consecutive connectivity checks: avgcheckinterval = (candidatepairstats.last
requesttimestamp - candidatepairstats.first
requesttimestamp) / candidatepairstats.
requestssent; specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.last
requesttimestamp' in that specification.
ReadableByteStreamController.byobRequest - Web APIs
the byob
request read-only property of the readablebytestreamcontroller interface returns the current byob pull
request, or undefined if there are no pending
requests.
... syntax var
request = readablebytestreamcontroller.byob
request; value a readablestreambyob
request object instance, or undefined.
... specifications specification status comment streamsthe definition of 'byob
request' in that specification.
Request.credentials - Web APIs
the credentials read-only property of the
request interface indicates whether the user agent should send cookies from the other domain in the case of cross-origin
requests.
... syntax var mycred =
request.credentials; value a
requestcredentials dictionary value indicating whether the user agent should send cookies from the other domain in the case of cross-origin
requests.
... example in the following snippet, we create a new
request using the
request.
request() constructor (for an image file in the same directory as the script), then save the
request credentials in a variable: var my
request = new
request('flowers.jpg'); var mycred = my
request.credentials; // returns "same-origin" by default specifications specification status comment fetchthe definition of 'credentials' in that specification.
Request.headers - Web APIs
the headers read-only property of the
request interface contains the headers object associated with the
request.
... syntax var myheaders =
request.headers; value a headers object.
... example in the following snippet, we create a new
request using the
request.
request() constructor (for an image file in the same directory as the script), then save the
request headers in a variable: var my
request = new
request('flowers.jpg'); var myheaders = my
request.headers; // headers {} to add a header to the headers object we use headers.append; we then create a new
request along with a 2nd init parameter, passing headers in as an init option: var myheaders = new headers(); myheaders.append('content-type', 'image/jpeg'); var myinit = { method: 'get', headers: myheaders, mode: 'cors', cache: 'default' }; var my
request = new
request('flowers.jpg', myinit); mycontenttype = my
request.headers.get('content-type'); // returns 'image/jpeg' specifications specification ...
Request.integrity - Web APIs
the integrity read-only property of the
request interface contains the subresource integrity value of the
request.
... syntax var myintegrity =
request.integrity; value the subresource integrity value of the
request (e.g., sha256-bpfbw7ivv8q2jlit13fxdyae2tjllusrsz273h2nfse=).
... example in the following snippet, we create a new
request using the
request.
request() constructor (for an image file in the same directory as the script), then save the
request integrity value in a variable: var my
request = new
request('flowers.jpg'); var myintegrity = my
request.integrity; specifications specification status comment fetchthe definition of 'integrity' in that specification.
Request.redirect - Web APIs
the redirect read-only property of the
request interface contains the mode for how redirects are handled.
... syntax var myredirect =
request.redirect; value a
requestredirect enum value, which can be one the following strings: follow error manual if not specified when the
request is created, it takes the default value of follow.
... example in the following snippet, we create a new
request using the
request.
request() constructor (for an image file in the same directory as the script), then save the
request redirect value in a variable: var my
request = new
request('flowers.jpg'); var mycred = my
request.redirect; specifications specification status comment fetchthe definition of 'redirect' in that specification.
Request.referrer - Web APIs
the referrer read-only property of the
request interface is set by the user agent to be the referrer of the
request.
... syntax var myreferrer =
request.referrer; value a domstring representing the
request's referrer.
... example in the following snippet, we create a new
request using the
request.
request() constructor (for an image file in the same directory as the script), then save the
request referrer in a variable: var my
request = new
request('flowers.jpg'); var myreferrer = my
request.referrer; // returns "about:client" by default specifications specification status comment fetchthe definition of 'referrer' in that specification.
Request.referrerPolicy - Web APIs
the referrerpolicy read-only property of the
request interface returns the referrer policy, which governs what referrer information, sent in the referer header, should be included with the
request.
... syntax var myreferrerpolicy =
request.referrerpolicy; value a domstring representing the
request's referrerpolicy.
... example in the following snippet, we create a new
request using the
request.
request() constructor (for an image file in the same directory as the script), then save the
request referrer policy in a variable: var my
request = new
request('flowers.jpg'); var myreferrer = my
request.referrerpolicy; // returns "" by default specifications specification status comment fetchthe definition of 'referrerpolicy' in that specification.
Request.url - Web APIs
the url read-only property of the
request interface contains the url of the
request.
... syntax var myurl =
request.url; value a usvstring indicating the url of the
request.
... example in the following snippet, we create a new
request using the
request.
request() constructor (for an image file in the same directory as the script), then save the url of the
request in a variable: var my
request = new
request('flowers.jpg'); var myurl = my
request.url; // "http://mdn.github.io/fetch-examples/fetch-
request/flowers.jpg" specifications specification status comment fetchthe definition of 'url' in that specification.
XDomainRequest.onerror - Web APIs
an event handler which is called when an xdomain
request encounters an error.
... note: there is no way to determine the cause of the error from the xdomain
request interface.
... example var xdr = new xdomain
request(); xdr.open("post", "http://example.com/api/method"); xdr.onerror = function(){ //handle error } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1¶m2=value2"); specification not part of any specification.
XDomainRequest.onload - Web APIs
an event handler for when an xdomain
request has finished receiving the response from the server.
... you can find the entire server response in the xdomain
request.responsetext property.
... syntax xdr.onload = funcref; example var xdr = new xdomain
request(); xdr.open("post", "http://example.com/api/method"); xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1¶m2=value2"); specification not part of any specification.
XDomainRequest.responseText - Web APIs
returns the response body of an xdomain
request as a string.
... note: this property is valid during the xdomain
request.onprogress and xdomain
request.onload events.
... syntax var response = xdr.responsetext; this sets response to contain the response body of the
request, as a string.
Using XMLHttpRequest in IE6 - Web APIs
xmlhttp
request was first introduced by microsoft in internet explorer 5.0 as an activex control.
... however, in ie7 and other browsers xmlhttp
request is a native javascript object.
... in all modern browsers, you can create a new xmlhttp
request object using the following code: var
request = new xmlhttp
request() however, if you need to also support internet explorer 6 and older, you need to extend your code like this: if (window.xmlhttp
request) { //firefox, opera, ie7, and other browsers will use the native object var
request = new xmlhttp
request(); } else { //ie 5 and 6 will use the activex control var
request = new activexobject("microsoft.xmlhttp"); } see also using xmlhttp
request ...
XMLHttpRequest: abort event - Web APIs
the abort event is fired when a
request has been aborted, for example because the program called xmlhttp
request.abort().
...ion addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttp
request(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.moz...
...illademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttp
request living standard ...
XMLHttpRequest: error event - Web APIs
the error event is fired when the
request encountered an error.
...ion addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttp
request(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.moz...
...illademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttp
request living standard ...
XMLHttpRequest: load event - Web APIs
the load event is fired when an xmlhttp
request transaction completes successfully.
...ion addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttp
request(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.moz...
...illademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttp
request living standard ...
XMLHttpRequest: loadend event - Web APIs
the loadend event is fired when a
request has completed, whether successfully (after load) or unsuccessfully (after abort or error).
...ion addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttp
request(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.moz...
...illademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttp
request living standard ...
XMLHttpRequest: loadstart event - Web APIs
the loadstart event is fired when a
request has started to load data.
...ion addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttp
request(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.moz...
...illademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttp
request living standard ...
XMLHttpRequest: progress event - Web APIs
the progress event is fired periodically when a
request receives more data.
...ion addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttp
request(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.moz...
...illademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comment xmlhttp
request living standard ...
XMLHttpRequestEventTarget.onerror - Web APIs
the xmlhttp
requesteventtarget.onerror is the function called when an xmlhttp
request transaction fails due to an error.
... syntax xmlhttp
request.onerror = callback; values callback is the function to be executed when the
request fails.
... example var xmlhttp = new xmlhttp
request(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onerror = function () { console.log("** an error occurred during the transaction"); }; xmlhttp.send(); specifications specification status comment xmlhttp
request living standard whatwg living standard ...
XMLHttpRequestEventTarget.onloadstart - Web APIs
the xmlhttp
requesteventtarget.onloadstart is the function called when an xmlhttp
request transaction starts transferring data.
... syntax xmlhttp
request.onloadstart = callback; values callback is the function to be called when the transaction begins to transfer data.
... example var xmlhttp = new xmlhttp
request(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onloadstart = function () { console.log("download underway"); }; xmlhttp.send(); specifications specification status comment xmlhttp
request living standard whatwg living standard ...
XMLHttpRequestEventTarget.onprogress - Web APIs
the xmlhttp
requesteventtarget.onprogress is the function called periodically with information when an xmlhttp
request before success completely.
... syntax xmlhttp
request.onprogress = callback; values callback is the function to be called periodically before the
request is completed.
... xmlhttp
request.onprogress = function (event) { event.loaded; event.total; }; example var xmlhttp = new xmlhttp
request(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onprogress = function () { //do something }; xmlhttp.send(); specifications specification status comment xmlhttp
request living standard whatwg living standard ...
XRFrameRequestCallback - Web APIs
the xrframe
requestcallback is a callback function passed into xrsession.
requestanimationframe (part of webxr api) to obtain the current time and the current xrframe.
... syntax function xrframe
requestcallback(time, xrframe){ // process xrframe here } xrsession.
requestanimationframe(xrframe
requestcallback) parameters domhighrestimestamp a timestamp corresponding to the returned xrframe.
... specifications specification status comment webxr device apithe definition of 'xrframe
requestcallback' in that specification.
Reason: CORS request external redirect not allowed - HTTP
reason reason: cors
request external redirect not allowed what went wrong?
... the cors
request was responded to by the server with an http redirect to a url on a different origin than the original
request, which is not permitted during cors
requests.
... for example, if the page https://service.tld/fetchdata were
requested, and the http response is "301 moved permanently", "307 temporary redirect", or "308 permanent redirect" with a location of https://anotherservice.net/getdata, the cors
request will fail in this manner.
Reason: CORS request not HTTP - HTTP
reason reason: cors
request not http what went wrong?
... cors
requests may only use the https url scheme, but the url specified by the
request is of a different type.
... to fix this problem, simply make sure you use https urls when issuing
requests involving cors, such as xmlhttp
request, fetch apis, web fonts (@font-face), and webgl textures, and xsl stylesheets.
Upgrade-Insecure-Requests - HTTP
the http upgrade-insecure-
requests
request header sends a signal to the server expressing the client’s preference for an encrypted and authenticated response, and that it can successfully handle the upgrade-insecure-
requests csp directive.
... header type
request header forbidden header name no syntax upgrade-insecure-
requests: 1 examples a client's
request signals to the server that it supports the upgrade mechanisms of upgrade-insecure-
requests: get / http/1.1 host: example.com upgrade-insecure-
requests: 1 the server can now redirect to a secure version of the site.
... location: https://example.com/ vary: upgrade-insecure-
requests specifications specification status comment upgrade insecure
requeststhe definition of 'upgrade-insecure-
requests' in that specification.
400 Bad Request - HTTP
the hypertext transfer protocol (http) 400 bad
request response status code indicates that the server cannot or will not process the
request due to something that is perceived to be a client error (e.g., malformed
request syntax, invalid
request message framing, or deceptive
request routing).
... the client should not repeat this
request without modification.
... status 400 bad
request specifications specification title rfc 7231, section 6.5.1: 400 bad
request hypertext transfer protocol (http/1.1): semantics and content ...
408 Request Timeout - HTTP
the hypertext transfer protocol (http) 408
request timeout response status code means that the server would like to shut down this unused connection.
... it is sent on an idle connection by some servers, even without any previous
request by the client.
... status 408
request timeout specifications specification title rfc 7231, section 6.5.7: 408
request timeout hypertext transfer protocol (http/1.1): semantics and content ...
429 Too Many Requests - HTTP
the http 429 too many
requests response status code indicates the user has sent too many
requests in a given amount of time ("rate limiting").
... a retry-after header might be included to this response indicating how long to wait before making a new
request.
... status 429 too many
requests example http/1.1 429 too many
requests content-type: text/html retry-after: 3600 specifications specification title rfc 6585, section 4: 429 too many
requests additional http status codes ...
CRMF Request object - Archive of obsolete content
rfc 4211, the internet x.509 public key infrastructure certificate
request message format (crmf), defines a certreqmessage.
... the object returned by generatecrmf
request() contains one of those.
Blocked: All storage access requests
message firefox: cookieblockedall=
request to access cookies or storage on “x” was blocked because we are blocking all storage access
requests.
... a
request to access cookies or storage was blocked because the browser is blocking all storage access.
Blocked: All third-party storage access requests
message firefox: cookieblockedforeign=
request to access cookies or storage on “x” was blocked because we are blocking all third-party storage access
requests and content blocking is enabled.
... a
request to access cookies or storage was blocked because it came from a third-party (a different origin) and content blocking is enabled.
Blocked: Storage access requests from trackers
message firefox: cookieblockedtracker=
request to access cookies or storage on “x” was blocked because it came from a tracker and content blocking is enabled.
... a
request to access cookies or storage was blocked because the browser identified it as coming from a tracker and content blocking is enabled.
PRMcastRequest
structure used to specify values for the pr_sockopt_addmember and pr_sockopt_dropmember socket options that define a
request to join or leave a multicast group.
... syntax #include <prio.h> struct prmcast
request { prnetaddr mcaddr; prnetaddr ifaddr; }; typedef struct prmcast
request prmcast
request; fields the structure has the following fields: mcaddr ip multicast address of group.
nsIDNSRequest
netwerk/dns/nsidns
request.idlscriptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 method overview void cancel(); methods cancel() called to cancel a pending asynchronous dns
request.
nsIXMLHttpRequestEventTarget
content/base/public/nsixmlhttp
request.idlscriptable this interface provides access to the event listeners used when uploading data using the xmlhttp
request object.
...see also using xmlhttp
request xmlhttp
request nsixmlhttp
request nsidomprogressevent ...
nsIXMLHttpRequestUpload
content/base/public/nsixmlhttp
request.idlscriptable this interface provides access to the features needed when uploading data using nsixmlhttp
request.
...y 2.0) attributes attribute type description onabort nsidomeventlistener onerror nsidomeventlistener onload nsidomeventlistener onloadstart nsidomeventlistener onprogress nsidomeventlistener see also nsixmlhttp
request nsixmlhttp
requesteventtarget xmlhttp
request using xmlhttp
request ...
FileRequest.lockedFile - Web APIs
summary the lockedfile property represents the lockedfile object from which the
request was started.
... syntax var lockedfile = instanceoffile
request.lockedfile value a lockedfile object.
IDBOpenDBRequest: upgradeneeded event - Web APIs
// open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.addeventlistener('upgradeneeded', event => { const db = event.target.result; console.log(`upgrading to version ${db.version}`); // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('h...
... // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = event => { const db = event.target.result; console.log(`upgrading to version ${db.version}`); // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', ...
PaymentRequestEvent.instrumentKey - Web APIs
the instrumentkey read-only property of the payment
requestevent interface returns a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument.
... syntax var instrumentkey = payment
requestevent.instrumentkey value a paymentinstrument object.
PaymentRequestEvent.methodData - Web APIs
the methoddata read-only property of the payment
requestevent interface returns an array of paymentmethoddata objects containing payment method identifers for the payment methods that the web site accepts and any associated payment method specific data.
... syntax var methoddata[] = payment
requestevent.methoddata value an array of paymentmethoddata objects.
PaymentRequestEvent.openWindow() - Web APIs
the openwindow property of the payment
requestevent interface opens the specified url in a new window, if and only if the given url is on the same origin as the calling page.
... syntax var apromise = payment
requestevent.openwindow(url) parameters url the url to open in the new window.
PaymentRequestEvent.respondWith() - Web APIs
the respondwith property of the payment
requestevent interface prevents the default event handling and allows you to provide a promise for a paymentresponse object yourself.
... syntax payment
requestevent.respondwith( // promise that resolves with a paymentresponse.
PaymentRequestEvent.topOrigin - Web APIs
the toporigin read-only property of the payment
requestevent interface returns the top level payee origin where the payment
request object was initialized.
... syntax var ausvstring = payment
requestevent.toporigin value a usvstring specifications specification status comment payment handler apithe definition of 'toporigin' in that specification.
PaymentRequestEvent.total - Web APIs
the total readonly property of the payment
requestevent interface returns a paymentcurrencyamount object containing the total amount being
requested for payment.
... syntax var paymentcurrencyamount = payment
requestevent.total value a paymentcurrencyamount object.
PublicKeyCredentialRequestOptions.allowCredentials - Web APIs
allowcredentials is an optional property of the publickeycredential
requestoptions dictionary which indicates the existing credentials acceptable for retrieval.
... syntax allowcredentials = publickeycredential
requestoptions.allowcredentials value an array whose elements are objects with the following properties: type a string describing type of public-key credential to be created.
PublicKeyCredentialRequestOptions.challenge - Web APIs
the challenge property of the publickeycredential
requestoptions dictionary is a buffersource used as a cryptographic challenge.
... syntax challenge = publickeycredential
requestoptions.challenge value a buffersource which is at least 16 bytes long.
PublicKeyCredentialRequestOptions.rpId - Web APIs
the rpid property, of the publickeycredential
requestoptions dictionary, is an optional property which indicates the relying party's identifier as a usvstring.
... syntax rpid = publickeycredential
requestoptions.rpid value a usvstring for the identifier of the relying party.
PublicKeyCredentialRequestOptions.timeout - Web APIs
the timeout property, of the publickeycredential
requestoptions dictionary, represents an hint, given in milliseconds, for the time the script is willing to wait for the completion of the retrieval operation.
... syntax timeout = publickeycredential
requestoptions.timeout value a numerical hint, expressed in milliseconds, giving the time to wait for the creation operation to complete.
PublicKeyCredentialRequestOptions.userVerification - Web APIs
userverification is an optional property of the publickeycredential
requestoptions.
... syntax userverification = publickeycredential
requestoptions.userverification value a string qualifying how the user verification should be part of the authentication process.
ReadableStreamBYOBRequest.respond() - Web APIs
the error() method of the readablestreambyob
request interface xxx syntax readablestreambyob
requestinstance.respond(byteswritten); parameters byteswritten xxx return value void.
... exceptions typeerror the source object is not a readablestreambyob
request, or there is no associated controller, or the associated internal array buffer is detached.
ReadableStreamBYOBRequest.respondWithNewView() - Web APIs
the respondwithnewview() method of the readablestreambyob
request interface xxx syntax readablestreambyob
requestinstance.respondwithnewview(view); parameters view xxx return value void.
... exceptions typeerror the source object is not a readablestreambyob
request, or there is no associated controller, or the associated internal array buffer is non-existant or detached.
ReadableStreamBYOBRequest.view - Web APIs
the view getter property of the readablestreambyob
request interface returns the current view.
... syntax var view = readablestreambyob
requestinstance.view; value a typed array representing the destination region to which the controller can write generated data.
Request.method - Web APIs
the method read-only property of the
request interface contains the
request's method (get, post, etc.) syntax var mymethod =
request.method; value a bytestring indicating the method of the
request.
... example in the following snippet, we create a new
request using the
request.
request() constructor (for an image file in the same directory as the script), then save the method of the
request in a variable: var my
request = new
request('flowers.jpg'); var mymethod = my
request.method; // get specifications specification status comment fetchthe definition of 'method' in that specification.
XDomainRequest.abort() - Web APIs
aborts an xdomain
request.
... syntax xdr.abort(); example var xdr = new xdomain
request(); xdr.open("get", "http://example.com/api/method"); xdr.send(); xdr.abort(); specification not part of any specification.
XDomainRequest.ontimeout - Web APIs
an event handler which is called when a pending xdomain
request times out.
... example var xdr = new xdomain
request(); xdr.open("post", "http://example.com/api/method"); xdr.ontimeout = function(){ //handle timeout } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1¶m2=value2"); specification not part of any specification.
XMLHttpRequest.channel - Web APIs
xmlhttp
request.channel is an nsichannel that used by the object when performing the
request.
...in the case of a multi-part
request, this is the initial channel, not the different parts in the multi-part
request.
XMLHttpRequest.multipart - Web APIs
all
requests must be asynchronous.
... this enables support for server push; for each xml document that's written to this
request, a new xml dom document is created and the onload handler is called between documents.
XMLHttpRequest.responseURL - Web APIs
the read-only xmlhttp
request.responseurl property returns the serialized url of the response or the empty string if the url is null.
... example var xhr = new xmlhttp
request(); xhr.open('get', 'http://example.com/test', true); xhr.onload = function () { console.log(xhr.responseurl); // http://example.com/test }; xhr.send(null); specifications specification status comment xmlhttp
request living standard whatwg living standard ...
XMLHttpRequest: timeout event - Web APIs
bubbles no cancelable no interface progressevent event handler property ontimeout examples const client = new xmlhttp
request(); client.open('get', 'http://www.example.org/example.txt'); client.ontimeout = () => { console.error('timeout!!') }; client.send(); you could also set up the event handler using the addeventlistener() method: client.addeventlistener('timeout', () => { console.error("timeout!!"); }); specifications specification status comment xmlhttp
requestthe definition of 'timeout event' in that specification.
Index - Web APIs
6 abortcontroller api, abortcontroller, experimental, interface, reference the abortcontroller interface represents a controller object that allows you to abort one or more dom
requests as and when desired.
... 8 abortcontroller.abort() api, abortcontroller, experimental, fetch, method, reference, abort() the abort() method of the abortcontroller interface aborts a dom
request (e.g.
... a fetch
request) before it has completed.
...And 431 more matches
HTTP Index - HTTP
http follows a classical client-server model, with a client opening a connection to make a
request, then waiting until it receives a response.
... http is a stateless protocol, meaning that the server does not keep any data (state) between two
requests.
... 2 a typical http session http in client-server protocols, like http, sessions consist of three phases: 3 an overview of http html, http, overview, webmechanics, l10n:priority http isthe foundation of any data exchange on the web and it is a client-server protocol, which means
requests are initiated by the recipient, usually the web browser.
...And 175 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
a web application executes a cross-origin http
request when it
requests a resource that has a different origin (domain, protocol, or port) from its own.
... an example of a cross-origin
request: the front-end javascript code served from https://domain-a.com uses xmlhttp
request to make a
request for https://domain-b.com/data.json.
... for security reasons, browsers restrict cross-origin http
requests initiated from scripts.
...And 76 more matches
Index - HTTP
found 122 pages: # page tags and summary 1 http headers http, http header, networking, overview, reference http headers allow the client and the server to pass additional information with the
request or the response.
... 2 accept http, http header, reference,
request header the accept
request http header advertises which content types, expressed as mime types, the client is able to understand.
...browsers set adequate values for this header depending on the context where the
request is done: when fetching a css stylesheet a different value is set for the
request than when fetching an image, video or a script.
...And 73 more matches
nsIWebProgressListener
uriloader/base/nsiwebprogresslistener.idlscriptable this interface is implemented by clients wishing to listen in on the progress associated with the loading of asynchronous
requests in the context of a nsiwebprogress instance as well as any child nsiwebprogress instances.
... method overview void onlocationchange(in nsiwebprogress awebprogress, in nsi
request a
request, in nsiuri alocation, [optional] in unsigned long aflags); void onprogresschange(in nsiwebprogress awebprogress, in nsi
request a
request, in long acurselfprogress, in long amaxselfprogress, in long acurtotalprogress, in long amaxtotalprogress); void onsecuritychange(in nsiwebprogress awebprogress, in nsi
request a
request, in unsigned long astate); void onstatechange(in nsiwebprogress awebprogress, in nsi
request a
request, in unsigned long astateflags, in nsresult astatus); void...
... onstatuschange(in nsiwebprogress awebprogress, in nsi
request a
request, in nsresult astatus, in wstring amessage); constants state transition flags these flags indicate the various states that
requests may transition through as they are being loaded.
...And 55 more matches
HTTP response status codes - HTTP
http response status codes indicate whether a specific http
request has been successfully completed.
... information responses 100 continue this interim response indicates that everything so far is ok and that the client should continue the
request, or ignore the response if the
request is already finished.
... 101 switching protocol this code is sent in response to an upgrade
request header from the client, and indicates the protocol the server is switching to.
...And 52 more matches
Client-Server Overview - Learn web development
previous overview: first steps next now that you know the purpose and potential benefits of server-side programming we're going to examine in detail what happens when a server receives a "dynamic
request" from a browser.
... as most website server-side code handles
requests and responses in similar ways, this will help you understand what you need to do when writing most of your own code.
...when you click a link on a web page, submit a form, or run a search, the browser sends an http
request to the server.
...And 51 more matches
Using IndexedDB - Web APIs
start a transaction and make a
request to do some database operation, like adding or retrieving data.
... do something with the results (which can be found on the
request object).
...such and such feature will not be available."); } opening a database we start the whole process like this: // let us open our database var
request = window.indexeddb.open("mytestdatabase", 3); see that?
...And 49 more matches
HTTP headers - HTTP
http headers let the client and the server pass additional information with an http
request or response.
... headers can be grouped according to their contexts: general headers apply to both
requests and responses, but with no relation to the data transmitted in the body.
...
request headers contain more information about the resource to be fetched, or about the client
requesting the resource.
...And 46 more matches
Getting Started - Developer guides
in a nutshell, it is the use of the xmlhttp
request object to communicate with servers.
... the two major features of ajax allow you to do the following: make
requests to the server without reloading the page receive and work with data from the server step 1 – how to make an http
request in order to make an http
request to the server with javascript, you need an instance of an object with the necessary functionality.
... this is where xmlhttp
request comes in.
...And 44 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
2 404 glossary, http errors, infrastructure, navigation a 404 is a standard response code meaning that the server cannot find the
requested resource.
... 14 ajax ajax, codingscripting, glossary, infrastructure, l10n:priority ajax, which initially stood for asynchronous javascript and xml, is a programming practice of building complex, dynamic webpages using a technology known as xmlhttp
request.
...these servers store duplicate copies of data so that servers can fulfill data
requests based on which servers are closest to the respective end-users.
...And 39 more matches
Index
73 setting http
request headers add-ons, extensions, http, xul, xulrunner http is one of the core technologies behind the web.
... in addition to the actual content, some important information is passed with http headers for both http
requests and responses.
... 182 amiwebinstaller extension manager, interfaces, interfaces:scriptable, reference, xpcom interface reference installs an array of add-ons at the
request of a webpage.
...And 39 more matches
Index
the usual approach is to create a certificate signing
request (csr) as soon as an application is done with the creation step, which will have created a handle to the key pair, and which can be used for the necessary related operations, like producing a proof-of-ownership of the private key, which is usually required when submitting the public key with a csr to a ca.
...the crmf library, which is used to produce certain kinds of certificate
requests, is available as a library for static linking only.
...an arena is
requested once processing of a task starts, and all memory allocations that are logically associated to that task are
requested from the associated arena.
...And 35 more matches
nsIHttpChannel
netwerk/protocol/http/nsihttpchannel.idlscriptable this interface allows for the modification of http
request parameters and the inspection of the resulting http response status and headers when they become available.
... http channel, use nsiioservice with a http uri, for example: var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var ch = ios.newchannel("https://www.example.com/", null, null); method overview void getoriginalresponseheader(in acstring aheader, in nsihttpheadervisitor avisitor); acstring get
requestheader(in acstring aheader); acstring getresponseheader(in acstring header); boolean isnocacheresponse(); boolean isnostoreresponse(); void redirectto(in nsiuri anewuri); void setempty
requestheader(in acstring aheader); void setreferrerwithpolicy(in nsiuri referrer, in unsigned long referrerpolicy); void set
requestheader(in acstring...
... aheader, in acstring avalue, in boolean amerge); void setresponseheader(in acstring header, in acstring value, in boolean merge); void visitoriginalresponseheaders(in nsihttpheadervisitor avisitor); void visit
requestheaders(in nsihttpheadervisitor avisitor); void visitresponseheaders(in nsihttpheadervisitor avisitor); constants constant description referrer_policy_no_referrer_when_downgrade default; indicates not to pass on the referrer when downgrading from https to http referrer_policy_no_referrer indicates no referrer will be sent referrer_policy_origin only send the origin of the referring uri referrer_policy_origin_when_xorigin same as the default; only send the origin of the referring u...
...And 33 more matches
Client-side storage - Learn web development
this api is designed for storing http responses to specific
requests, and is very useful for doing things like storing website assets offline so the site can subsequently be used without a network connection.
... inside the window.onload handler, add the following: // open our database; it is created if it doesn't already exist // (see onupgradeneeded below) let
request = window.indexeddb.open('notes_db', 1); this line creates a
request to open version 1 of a database called notes_db.
...you will see this
request pattern used very often throughout indexeddb.
...And 30 more matches
Fetching data from the server - Learn web development
this seemingly small detail has had a huge impact on the performance and behavior of sites, so in this article, we'll explain the concept and look at technologies that make it possible, such as xmlhttp
request and the fetch api.
... originally page loading on the web was simple — you'd send a
request for a website to a server, and as long as nothing went wrong, the assets that made the web page would be downloaded and displayed on your computer.
... enter ajax this led to the creation of technologies that allow web pages to
request small chunks of data (such as html, xml, json, or plain text) and display them only when needed, helping to solve the problem described above.
...And 30 more matches
Index - Archive of obsolete content
55
request needsupdate, sdk, add-on make simple network
requests.
... 95 net/xhr provides access to xmlhttp
request functionality.
... 189 html to dom code snippets, dom, guide, html, intermediate, needsupdate although you can now natively parse html using domparser and xmlhttp
request, this is a new feature that is not yet supported by all browsers in use in the wild.
...And 29 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
introduction when you click a link on a web page, your web browser makes a
request to a web server which usually results in a new web page as a response.
...an implementation can also use other transport technologies such as soap-based remote procedure calls, xmlhttp
request interfaces, or dom 3 load.
...this implementation uses xmlhttp
request.
...And 26 more matches
An overview of HTTP - HTTP
it is the foundation of any data exchange on the web and it is a client-server protocol, which means
requests are initiated by the recipient, usually the web browser.
...the messages sent by the client, usually a web browser, are called
requests and the messages sent by the server as an answer are called responses.
... components of http-based systems http is a client-server protocol:
requests are sent by one entity, the user-agent (or a proxy on behalf of it).
...And 26 more matches
nsIContentPolicy - Archive of obsolete content
method overview short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri a
requestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra, in nsiprincipal a
requestprincipal); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri a
requestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra, in nsiprincipal a
requestprincipal); constants content types constant value...
... type_xbl 9 indicates an xbl binding
request, triggered either by -moz-binding css property or the document.addbinding() method.
... type_xmlhttp
request 11 indicates an xmlhttp
request.
...And 25 more matches
Web Console remoting - Firefox Developer Tools
the networkeventactor is used for each new network
request.
... the client can
request further network event details - like response body or
request headers.
...when you attach to the global consoleactor you receive all of the network
requests, page errors, and the other events from all of the tabs and windows, including chrome errors and network events.
...And 24 more matches
Using Fetch - Web APIs
the fetch api provides a javascript interface for accessing and manipulating parts of the http pipeline, such as
requests and responses.
... this kind of functionality was previously achieved using xmlhttp
request.
...instead, it will resolve normally (with ok status set to false), and it will only reject on network failure or if anything prevented the
request from completing.
...And 24 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
requestanimationframe() the modern version of setinterval().
...
requestanimationframe()
requestanimationframe() is a specialized looping function created for running animations efficiently in the browser.
... (read more about this on creativejs.) note: you can find examples of using
requestanimationframe() elsewhere in the course — see for example drawing graphics, and object building practice.
...And 23 more matches
Streams - Plugins
streams produced by the browser can be automatically sent to or
requested by the plug-in instance.
... random-access mode: the plug-in calls the npn_
requestread method to "pull" stream data.
...seekable streams support random access (for example, local files or http servers that support byte-range
requests).
...And 23 more matches
Anatomy of a video game - Game development
on the web, window.
requestanimationframe() will be the foundation of most well-programmed per-frame main loops.
...here is an example of a simple main loop: window.main = function () { window.
requestanimationframe( main ); // whatever your main loop needs to do }; main(); // start the cycle note: in each of the main() methods discussed here, we schedule a new
requestanimationframe before performing our loop contents.
...calling the next
requestanimationframe early ensures the browser receives it on time to plan accordingly even if your current frame misses its vsync window.
...And 22 more matches
Sending forms through JavaScript - Learn web development
html forms can send an http
request declaratively.
... but forms can also prepare an http
request to send via javascript, for example via xmlhttp
request.
... the xmlhttp
request (xhr) dom object can build http
requests, send them, and retrieve their results.
...And 21 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
generates encryption/mac keys and outputs public key as pkcs11 certificate signing
request /* this source code form is subject to the terms of the mozilla public * license, v.
...-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" #define lab_header "-----begin key label-----" #define lab_trailer "-----end key label-----" #define pubkey_header "-----begin pub key -----" #define pubkey_trailer "-----end pub key -----" #define ns_certreq_header "-----begin new certificate
request-----" #define ns_certreq_trailer "-----end new certificate
request-----" #define ns_cert_enc_header "-----begin certificate for encryption-----" #define ns_cert_enc_trailer "-----end certificate for encryption-----" #define ns_cert_vfy_header "-----begin certificate for signature verification-----" #define ns_cert_vfy_trailer "-----end certificate for signature verification-----...
... "-n <nickname> -b <headerfilename> | ", "-b <headerfilename> -i <ipfilename> -e <encryptfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -e <encryptfilename> -o <opfilename> \n"); fprintf(stderr, "commands:\n\n"); fprintf(stderr, "%s %s\n --for generating cert
request (for ca also)\n\n", progname, "-g -s <subject> -r <csr>"); fprintf(stderr, "%s %s\n --to input and store cert (for ca also)\n\n", progname, "-a -n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ]"); fprintf(stderr, "%s %s\n --to put cert in header\n\n", progname, "-h -n <nickname> -b <headerfilename>...
...And 21 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
i'll also cover nonstandard technologies, such as xmlhttp
request and rich text editing, that mozilla does support because no w3c equivalent existed at the time.
...it also supports some non-standard internet explorer extensions, such as xmlhttp
request.
... xmlhttp
request internet explorer allows you to send and retrieve xml files using msxml's xmlhttp class, which is instantiated through activex using new activexobject("msxml2.xmlhttp") or new activexobject("microsoft.xmlhttp").
...And 20 more matches
Listening to events on all tabs
void onlocationchange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsi
request a
request, nsiuri alocation [optional] in unsigned long aflags ); parameters abrowser the browser representing the tab whose location changed.
... a
request the nsi
request object representing the associated
request.
...void onprogresschange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsi
request a
request, print32 acurselfprogress, print32 amaxselfprogress, print32 acurtotalprogress, print32 amaxtotalprogress ); parameters abrowser the browser representing the tab for which updated progress information is being provided.
...And 20 more matches
IME handling guide
finally, this class guarantees that
requesting to commit or cancel current composition to ime is perefored synchronously.
...this may be too big but ime may
request all text in the editor.
...therefore, editorbase
requests to commit composition when the following cases occur: the editor loses focus the caret is moved by mouse or javascript value of the editor is changed by javascript node of the editor is removed from dom tree somethings object is modified in an html editor, e.g., resizing an image composition string is moved to a different position which is specified by native ime (e.g., only a part of co...
...And 20 more matches
JS_THREADSAFE
requests in a js_threadsafe build, the application must separate code that uses the jsapi from code that performs blocking i/o or time-consuming calculations.
... a
request is a region of code that uses the jsapi.
...
requests must be bracketed with calls to js_begin
request() and js_end
request().
...And 20 more matches
Migrating from Firebug - Firefox Developer Tools
show network
requests the console panel in firebug allows to log ajax
requests (aka xmlhttp
requests).
...furthermore, the web console even allows to display all other network
requests via net > log.
... view json and xml structures to view json and xml responses of ajax
requests, firebug has special tabs when expanding the
request within the console panel.
...And 20 more matches
WindowOrWorkerGlobalScope.fetch() - Web APIs
the promise resolves to the response object representing the response to your
request.
... note: the fetch() method's parameters are identical to those of the
request() constructor.
... a
request object.
...And 20 more matches
nsIDOMMozNetworkStatsManager
you can test for the presence of the service as follows, for example: if ("moznetworkstats" in navigator) { /* networkstats is available */ } else { alert("i'm sorry, but networkstats services are not supported."); } method overview nsidomdom
request getsamples(in nsisupports network, in jsval start, in jsval end, [optional] in jsval options /* networkstatsgetoptions */); nsidomdom
request addalarm(in nsisupports network, in long threshold, [optional] in jsval options /* networksta...
...tsalarmoptions */); nsidomdom
request getallalarms([optional] in nsisupports network); nsidomdom
request removealarms([optional] in long alarmid); nsidomdom
request clearstats(in nsisupports network); nsidomdom
request clearallstats(); nsidomdom
request getavailablenetworks(); nsidomdom
request getavailableservicetypes(); attributes attribute type description samplerate long minimum time in milliseconds between samples stored in the database.
... nsidomdom
request getsamples(in nsisupports network, in jsval start, in jsval end, [optional] in jsval options /* networkstatsgetoptions */); parameters network the origin of the data.
...And 19 more matches
nsILoadGroup
netwerk/base/public/nsiloadgroup.idlscriptable a load group maintains a collection of nsi
request objects.
... inherits from: nsi
request last changed in gecko 1.7 method overview void add
request(in nsi
request a
request, in nsisupports acontext); void remove
request(in nsi
request a
request, in nsisupports acontext, in nsresult astatus); attributes attribute type description activecount unsigned long returns the count of "active"
requests (that is
requests without the load_background bit set).
... defaultload
request nsi
request accesses the default load
request for the group.
...And 19 more matches
Background Tasks API - Web APIs
the cooperative scheduling of background tasks api (also referred to as the background tasks api or simply the
requestidlecallback() api) provides the ability to queue tasks to be executed automatically by the user agent when it determines that there is free time to do so.
...window.
requestidlecallback() makes it possible to become actively engaged in helping to ensure that the browser's event loop runs smoothly, by allowing the browser to tell your code how much time it can safely use without causing the system to lag.
...if your callback needs to change the dom, it should use window.
requestanimationframe() to schedule that.
...And 19 more matches
BasicCardResponse - Web APIs
the basiccardresponse dictionary (related to the payment
request api, although defined in the basic card payment spec) defines an object structure for payment response details such as the number/expiry date of the card used to make the payment, and the billing address.
... examples in the following example, the payment
request() constructor is used to create a new payment
request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options.
... the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccard
request dictionary.
...And 19 more matches
A typical HTTP session - HTTP
the client sends its
request, and waits for the answer.
... the server processes the
request, sending back its answer, providing a status code and appropriate data.
... as of http/1.1, the connection is no longer closed after completing the third phase, and the client is now granted a further
request: this means the second and third phases can now be performed any number of times.
...And 19 more matches
Enc Dec MAC Output Public Key as CSR
generates encryption/mac keys and outputs public key as certificate signing
request /* this source code form is subject to the terms of the mozilla public * license, v.
...end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" #define lab_header "-----begin key label-----" #define lab_trailer "-----end key label-----" #define pubkey_header "-----begin pub key -----" #define pubkey_trailer "-----end pub key -----" #define ns_certreq_header "-----begin new certificate
request-----" #define ns_certreq_trailer "-----end new certificate
request-----" typedef enum { gen_csr, encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6 } headertype; /* this is conditionalized because port_errortostring was introduced with nss 3.13.
... "-d "); fprintf(stderr, "%-20s specify db password [optional]\n\n", "-p "); fprintf(stderr, "%-20s specify db password file [optional]\n\n", "-f "); fprintf(stderr, "%-20s specify noise file name [optional]\n\n", "-z "); fprintf(stderr, "%-21s specify subject\n\n", "-s "); fprintf(stderr, "%-21s specify certficate
request file name\n\n", "-r "); fprintf(stderr, "%-21s specify an input file name\n\n", "-i "); fprintf(stderr, "%-21s specify an output file name\n\n", "-o "); fprintf(stderr, "%-7s for encrypt, it takes as an input file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ...
...And 18 more matches
sample2
e mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" #define lab_header "-----begin key label-----" #define lab_trailer "-----end key label-----" #define pubkey_header "-----begin pub key -----" #define pubkey_trailer "-----end pub key -----" #define ns_certreq_header "-----begin new certificate
request-----" #define ns_certreq_trailer "-----end new certificate
request-----" #define ns_cert_enc_header "-----begin certificate for encryption-----" #define ns_cert_enc_trailer "-----end certificate for encryption-----" #define ns_cert_vfy_header "-----begin certificate for signature verification-----" #define ns_cert_vfy_trailer "-----end certificate for signature verification-----" #define ns_sig_h...
...[ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ] | ", "-n <nickname> -b <headerfilename> | ", "-b <headerfilename> -i <ipfilename> -e <encryptfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -i <ipfilename> | ", "-b <headerfilename> -e <encryptfilename> -o <opfilename> \n"); fprintf(stderr, "commands:\n\n"); fprintf(stderr, "%s %s\n --for generating cert
request (for ca also)\n\n", progname, "-g -s <subject> -r <csr>"); fprintf(stderr, "%s %s\n --to input and store cert (for ca also)\n\n", progname, "-a -n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ]"); fprintf(stderr, "%s %s\n --to put cert in header\n\n", progname, "-h -n <nickname> -b <headerfilename> [-v <\"\">]"); fprintf(stderr, "%s %s\n --to find p...
...r, "%-30s - output file name\n\n", "-o <opfilename>"); fprintf(stderr, "%-30s - certificate serial number\n\n", "-m <serialnumber>"); fprintf(stderr, "%-30s - certificate nickname\n\n", "-n <nickname>"); fprintf(stderr, "%-30s - certificate trust\n\n", "-t <trustargs>"); fprintf(stderr, "%-30s - certificate issuer nickname\n\n", "-u <issuernickname>"); fprintf(stderr, "%-30s - certificate signing
request \n\n", "-r <csr>"); fprintf(stderr, "%-30s - generate a self-signed cert [optional]\n\n", "-x"); fprintf(stderr, "%-30s - to enable ascii [optional]\n\n", "-a"); fprintf(stderr, "%-30s - to save certificate to header file as sig verification [optional]\n\n", "-v"); exit(-1); } /* * validate the options used for generate csr command */ static void validategeneratecsrcommand(const char *progname, c...
...And 18 more matches
Using Service Workers - Web APIs
but the overriding problem is that there still isn’t a good overall control mechanism for asset caching and custom network
requests.
...(see our promises test example for the source code, or look at it running live.) note: a real service worker implementation would use caching and onfetch rather than the xmlhttp
request api.
... const imgload = (url) => { return new promise((resolve, reject) => { var
request = new xmlhttp
request();
request.open('get', url);
request.responsetype = 'blob';
request.onload = () => { if (
request.status == 200) { resolve(
request.response); } else { reject(error('image didn\'t load successfully; error code:' +
request.statustext)); } };
request.onerror = () => { reject(error('there was a network error.')); };
request.send(); }); } we return a new promise using the promise() constructor, which takes as an argument a callback function with resolve and reject parameters.
...And 18 more matches
Web Locks API - Web APIs
for example, if a web app running in multiple tabs wants to ensure that only one tab is syncing data between the network and indexed db, each tab could try to acquire a "my_net_db_sync" lock, but only one tab will succeed (the leader election pattern.) the api is used as follows: the lock is
requested.
... navigator.locks.
request('my_resource', async lock => { // the lock has been acquired.
...}); while a lock is held,
requests for the same lock from this execution context, or from other tabs/workers, will be queued.
...And 18 more matches
Connecting to Remote Content - Archive of obsolete content
« previousnext » using xmlhttp
request xmlhttp
request is an api for transferring xml between a local script and a remote server via http.
... let url = "http://www.example.com/"; let
request = components.classes["@mozilla.org/xmlextras/xmlhttp
request;1"] .createinstance(components.interfaces.nsixmlhttp
request);
request.onload = function(aevent) { window.alert("response text: " + aevent.target.responsetext); };
request.onerror = function(aevent) { window.alert("error status: " + aevent.target.status); };
request.open("get", url, true);
request.send(null); in this example we demonstrate how to make a xmlhttp
request call in asynchronous mode.
... you can see that an instance of the xmlhttp
request class is created and it holds all functionality for making a
request.
...And 17 more matches
NSS tools : certutil
-c create a new binary certificate file from a binary certificate
request file.
... use the -i argument to specify the certificate
request file.
... -r create a certificate
request file that can be submitted to a certificate authority (ca) for processing into a finished certificate.
...And 17 more matches
certutil
-c create a new binary certificate file from a binary certificate
request file.
... use the -i argument to specify the certificate
request file.
... -r create a certificate
request file that can be submitted to a certificate authority (ca) for processing into a finished certificate.
...And 16 more matches
imgIDecoderObserver
image/public/imgidecoderobserver.idlscriptable this interface is used both for observing imgidecoder objects and for observing imgi
request objects.
...method overview void ondataavailable(in imgi
request a
request, in boolean acurrentframe, [const] in nsintrect arect); native code only!
... void ondiscard(in imgi
request a
request); void onimageisanimated(in imgi
request a
request); void onstartcontainer(in imgi
request a
request, in imgicontainer acontainer); void onstartdecode(in imgi
request a
request); void onstartframe(in imgi
request a
request, in unsigned long aframe); void onstart
request(in imgi
request a
request); void onstopcontainer(in imgi
request a
request, in imgicontainer acontainer); void onstopdecode(in imgi
request a
request, in nsresult status, in wstring statusarg); void onstopframe(in imgi
request a
request, in unsigned long aframe); void onstop
request(in imgi
request a
request, in boolean aislastpart); methods native code only!ondataavailable decode notification.
...And 16 more matches
URLs - Plugins
plug-ins can
request and receive the data associated with urls of any type that the browser can handle, including http, ftp, news, mailto, and gopher.
...to
request a stream and receive notification of the result in all cases, use npn_geturlnotify.
... for http urls, the browser resolves npn_geturl as the http server method get, which
requests url objects.
...And 16 more matches
HTTP Messages - HTTP
there are two types of messages:
requests sent by the client to trigger an action on the server, and responses, the answer from the server.
... http
requests, and responses, share similar structure and are composed of: a start-line describing the
requests to be implemented, or its status of whether successful or a failure.
... an optional set of http headers specifying the
request, or describing the body included in the message.
...And 16 more matches
Populating the page: how browsers work - Web Performance
to be fast to load, the developers’ goals include sending
requested information as fast as possible, or at least seem super fast.
...it occurs whenever a user
requests a page by entering a url into the address bar, clicking a link, submitting a form, as well as other actions.
... your browser
requests a dns lookup, which is eventually fielded by a name server, which in turn responds with an ip address.
...And 16 more matches
Server-side web frameworks - Learn web development
previous overview: first steps next the previous article showed you what the communication between web clients and servers looks like, the nature of http
requests and responses, and what a server-side web application needs to do in order to respond to
requests from a web browser.
...basic understanding of how server-side code handles and responds to http
requests (see client-server overview).
... work directly with http
requests and responses as we saw in the last article, web servers and browsers communicate via the http protocol — servers wait for http
requests from the browser and then return information in http responses.
...And 15 more matches
AddressErrors - Web APIs
the addresserrors dictionary is used by the payment
request api to to report validation errors in a physical address (typically a billing address or a shipping address).
... addresserrors is the type of the object returned by shippingaddresserrors in the paymentdetailsupdate passed into payment
requestupdateevent.updatewith() by the shippingaddresschange event handler if a change to the address resulted in a validation error occurring.
...in the example, we're handling a donation to an organization that will be sending a "thank you" gift to the donor, so it
requests shipping information along with allowing the donation payment itself.
...And 15 more matches
HTTP caching - HTTP
different kinds of caches caching is a technique that stores a copy of a given resource and serves it back when
requested.
... when a web cache has a
requested resource in its store, it intercepts the
request and returns its copy instead of re-downloading from the originating server.
...the primary cache key consists of the
request method and target uri (oftentimes only the uri is used as only get
requests are caching targets).
...And 15 more matches
Navigation and resource timings - Web Performance
both provide the same read-only properties, but navigation timing measures the main document's timings whereas the resource timing provides the times for all the assets or resources called in by that main document and the resources'
requested resources.
... performance timings the performancetiming api, a javascript api for measuring the loading performance of the
requested page, is deprecated but supported in all browsers.
...as displayed in the image below, the navigation process goes from navigationstart, unloadeventstart, unloadeventend, redirectstart, redirectend, fetchstart, domainlookupstart, domainlookupend, connectstart , connectend, secureconnectionstart,
requeststart, responsestart, responseend, domloading, dominteractive, domcontentloadedeventstart, domcontentloadedeventend, domcomplete, loadeventstart, and loadeventend.
...And 15 more matches
Sending form data - Learn web development
a 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.
...And 14 more matches
Observer Notifications
topic description quit-application-
requested something has
requested that the application be shutdown.
... browser-lastwindow-close-
requested sent when the browser wishes to close the last open browser window.
... browser-lastwindow-close-granted sent when all interested parties have responded to the browser-lastwindow-close-
requested notification and none of them
requested that the close be aborted.
...And 14 more matches
Connection management in HTTP/1.x - HTTP
these connections were short-lived: a new one created each time a
request needed sending, and closed once the answer had been received.
...network latency and bandwidth affect performance when a
request needs sending.
... modern web pages require many
requests (a dozen or more) to serve the amount of information needed, proving this earlier model inefficient.
...And 14 more matches
Creating Sandboxed HTTP Connections
onstart
request - gets called when a new
request is initiated.
... onstop
request - the
request has finished.
... null, null); // get a channel for that nsiuri gchannel = ioservice.newchannelfromuri(uri); // get an listener var listener = new streamlistener(callbackfunc); gchannel.notificationcallbacks = listener; gchannel.asyncopen(listener, null); function streamlistener(acallbackfunc) { this.mcallbackfunc = acallbackfunc; } streamlistener.prototype = { mdata: "", // nsistreamlistener onstart
request: function (a
request, acontext) { this.mdata = ""; }, ondataavailable: function (a
request, acontext, astream, asourceoffset, alength) { var scriptableinputstream = components.classes["@mozilla.org/scriptableinputstream;1"] .createinstance(components.interfaces.nsiscriptableinputstream); scriptableinputstream.init(astream); this.mdata += scriptableinputstream.rea...
...And 13 more matches
sslfnc.html
ssl_
request_certificate is a server option that
requests a client to authenticate itself.
... ssl_require_certificate is a server option that requires a client to authenticate itself (only if ssl_
request_certificate is also on).
... ssl_
request_certificate is a server option that
requests a client to authenticate itself.
...And 13 more matches
Fullscreen API - Web APIs
methods on the document interface document.exitfullscreen()
requests that the user agent switch from full-screen mode back to windowed mode.
... methods on the element interface element.
requestfullscreen() asks the user agent to place the specified element (and, by extension, its descendants) into full-screen mode, removing all of the browser's ui elements as well as all other applications from the screen.
... dictionaries fullscreenoptions provides optional settings you can specify when calling
requestfullscreen().
...And 13 more matches
Using the Notifications API - Web APIs
requesting permission before an app can send a notification, the user must grant the application the right to do so.
...you should only
request consent to display notifications in response to a user gesture (e.g.
...this is not only best practice — you should not be spamming users with notifications they didn't agree to — but going forward browsers will explicitly disallow notification permission
requests not triggered in response to a user gesture.
...And 13 more matches
Starting up and shutting down a WebXR session - Web APIs
finally, you must call
requestsession() from a user event handler, such as the handler for the click event.
...to obtain an xrsession, you call your xrsystem's
requestsession() method, which returns a promise that resolves with an xrsession if it's able to establish one successfully.
... fundamentally, that looks like this: xr.
requestsession("immersive-vr").then((session) => { xrsession = session; /* continue to set up the session */ }); note the parameter passed into
requestsession() in this code snippet: immersive-vr.
...And 13 more matches
Efficient animation for web games - Game development
we touch on css transitions and css animations, and javascript loops involving window.
requestanimationframe.
... use
requestanimationframe when you are animating <canvas> content, or when your dom animations absolutely must synchronise with canvas content animations, do make sure to use window.
requestanimationframe, and not older methods such as window.settimeout.
...
requestanimationframe causes the browser to redraw and call your function before that frame gets to the screen.
...And 12 more matches
Cache - Web APIs
the cache interface provides a storage mechanism for
request / response object pairs that are cached, for example as part of the serviceworker life cycle.
...items in a cache do not get updated unless explicitly
requested; they don’t expire unless deleted.
... methods cache.match(
request, options) returns a promise that resolves to the response associated with the first matching
request in the cache object.
...And 12 more matches
IDBObjectStore - Web APIs
methods idbobjectstore.add() returns an idb
request object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store.
... idbobjectstore.clear() creates and immediately returns an idb
request object, and clears this object store in a separate thread.
... idbobjectstore.count() returns an idb
request object, and, in a separate thread, returns the total number of records that match the provided key or idbkeyrange.
...And 12 more matches
Understanding latency - Web Performance
latency is generally considered to be the amount of time it takes from when a
request is made by the user to the time it takes for the response to get back to that user.
... on a first
request, for the first 14kb bytes, latency is longer because it includes a dns lookup, a tcp handshake, the secure tls negotiation.
... subsequent
requests will have less latency because the connection to the server is already set.
...And 12 more matches
Intercepting Page Loads - Archive of obsolete content
http notifications are fired for all http
requests originating from firefox.
... there are 2 http topics you can listen to, as specified in the observer notifications page: topic description http-on-modify-
request called as an http
request is made.
... observe : function(asubject, atopic, adata) { if (topic_modify_
request == atopic) { let url; asubject.queryinterface(components.interfaces.nsihttpchannel); url = asubject.uri.spec; if (re_url_to_modify.test(url)) { // re_url_to_modify is a regular expression.
...And 11 more matches
Promises - Archive of obsolete content
a task example like the following: components.utils.import("resource://gre/modules/task.jsm"); task.spawn(function* () { var response = yield
request("login", { username: user, password: password }); if (response.messages) { try { yield publish({ username: user, messages: response.messages }); } catch (e) { self.reporterror("publication failed", e); } } }); can be converted to a pure promise-based equivalent as such:
request("login", { username: user, password: password }) .
... config.indexstats = processor.stats; yield os.file.writeatomic(configpath, json.stringify(config), { tmppath: configpath + "." + math.random(), encoding: "utf-8" }) timestamp = new date; }); http
requests http
requests should, in nearly all circumstances, be made via the standard xmlhttp
request api.
...moreover, many third-party wrappers for the xmlhttp
request api now support promises out of the box.
...And 11 more matches
Introduction to the server side - Learn web development
when you click a link on a web page, submit a form, or run a search, an http
request is sent from your browser to the target server.
... the
request includes a url identifying the affected resource, a method that defines the required action (for example to get, delete, or post the resource), and may include additional information encoded in url parameters (the field-value pairs sent via a query string), as post data (data sent by the http post method), or in associated cookies.
... web servers wait for client
request messages, process them when they arrive, and reply to the web browser with an http response message.
...And 11 more matches
sslerr.html
on a server socket, this means the remote client has
requested the use of a version of ssl older than version 2.
... -12278 (unused) ssl_error_wrong_certificate -12277 "client authentication failed: private key in key database does not correspond to public key in certificate database." ssl_error_bad_cert_domain -12276 "unable to communicate securely with peer:
requested domain name does not match the server's certificate." this error code should be returned by the certificate authentication callback function when it detects that the common name in the remote server's certificate does not match the hostname sought by the local client, according to the matching rules specified for cert_verifycertname.
... ssl_error_unknown_cipher_suite -12266 "an unknown ssl cipher suite has been
requested." the application has attempted to configure ssl to use an unknown cipher suite.
...And 11 more matches
NSS Tools certutil
-r create a certificate-
request file that can be submitted to a certificate authority (ca) for processing into a finished certificate.
... -c create a new binary certificate file from a binary certificate-
request file.
... use the -i argument to specify the certificate-
request file.
...And 11 more matches
nsIChannel
netwerk/base/nsichannel.idlscriptable this interface allows clients to construct 'get'
requests for specific protocols, and manage them in a uniform way.
... inherits from: nsi
request last changed in gecko 19.0 (firefox 19.0 / thunderbird 19.0 / seamonkey 2.16) once a channel is created (via nsiioservice.newchannel()), parameters for that
request may be set by using the channel attributes, or by calling queryinterface() to retrieve a subclass of nsichannel for protocol-specific parameters.
...after a
request has been completed, the channel is still valid for accessing protocol-specific results.
...And 11 more matches
nsIDownloadProgressListener
method overview void ondownloadstatechange(in short astate, in nsidownload adownload); void onlocationchange(in nsiwebprogress awebprogress, in nsi
request a
request, in nsiuri alocation, in nsidownload adownload); obsolete since gecko 1.9.1 void onprogresschange(in nsiwebprogress awebprogress, in nsi
request a
request, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress, in nsidownload adownload); void onsecuritychange(in nsiwebprogress awebprogress, in nsireque...
...st a
request, in unsigned long astate, in nsidownload adownload); void onstatechange(in nsiwebprogress awebprogress, in nsi
request a
request, in unsigned long astateflags, in nsresult astatus, in nsidownload adownload); void onstatuschange(in nsiwebprogress awebprogress, in nsi
request a
request, in nsresult astatus, in wstring amessage, in nsidownload adownload); obsolete since gecko 1.9.1 attributes attribute type description document nsidomdocument document the document of the download manager frontend.
... onlocationchange() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) void onlocationchange( in nsiwebprogress awebprogress, in nsi
request a
request, in nsiuri alocation, in nsidownload adownload ); parameters awebprogress the nsiwebprogress instance used by the download manager to monitor downloads.
...And 11 more matches
FetchEvent.respondWith() - Web APIs
for example, if an <img> initiates the
request, the response body needs to be image data.
... for security reasons, there are a few global rules: you can only return response objects of type "opaque" if the fetchevent.
request object's mode is "no-cors".
... you can only return response objects of type "opaqueredirect" if the fetchevent.
request object's mode is "manual".
...And 11 more matches
LocalFileSystem - Web APIs
creating new storage you
request access to a sandboxed file system by calling window.
requestfilesystem().
... using persistent storage the
requestfilesystem() method lets you ask for persistent or temporary storage.
... to use persistent storage with the file system api, chrome exposes a
requestquota api.
...And 11 more matches
RTCIceCandidatePairStats - Web APIs
consent
requestssent optional the total number of consent
requests that have been sent on this candidate pair.
... currentroundtriptime optional a floating-point value indicating the total time, in seconds, that elapsed elapsed between the most recently-sent stun
request and the response being received.
... this may be based upon
requests that were involved in confirming permission to open the connection.
...And 11 more matches
Storage Access API - Web APIs
the api provides methods that allow embedded resources to check whether they currently have access to their first-party storage, and to
request access to their first-party storage from the user agent.
... the storage access api is intended to solve this problem; embedded cross-origin content can
request unrestricted access to its first-party storage on a site-by-site basis via the document.
requeststorageaccess() method, and check whether it already has access via the document.hasstorageaccess() method.
...the embedding website needs to add this to allow storage access
requests to be successful, along with allow-scripts and allow-same-origin to allow it to call the api, and execute in an origin that can have cookies: <iframe sandbox="allow-storage-access-by-user-activation allow-scripts allow-same-origin"> ...
...And 11 more matches
Sending and Receiving Binary Data - Web APIs
receiving binary data using javascript typed arrays the responsetype property of the xmlhttp
request object can be set to change the expected response type from the server.
...this is null if the
request is not complete or was not successful.
... var oreq = new xmlhttp
request(); oreq.open("get", "/myfile.png", true); oreq.responsetype = "arraybuffer"; oreq.onload = function (oevent) { var arraybuffer = oreq.response; // note: not oreq.responsetext if (arraybuffer) { var bytearray = new uint8array(arraybuffer); for (var i = 0; i < bytearray.bytelength; i++) { // do something with each byte in the array } } }; oreq.send(null); you can also read a binary file as a blob by setting the string "blob" to the responsetype property.
...And 11 more matches
Tabbed browser - Archive of obsolete content
from a sidebar basically, if your extension code is a sidebar you can use: var mainwindow = window.queryinterface(components.interfaces.nsiinterface
requestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterface
requestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.gbrowser.addtab(...); from a...
... getting the browser that fires the http-on-modify-
request notification see the observer notifications page for information on http-on-* notifications.
... note that some http
requests aren't associated with a tab; for example, rss feed updates, extension manager
requests, xhr
requests from xpcom components, etc.
...And 10 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
in general, before issuing a certificate, the ca must use its published verification procedures for that type of certificate to ensure that an entity
requesting a certificate is in fact who it claims to be.
... the user has
requested a resource controlled by the server.
... the server requires client authentication before permitting access to the
requested resource.
...And 10 more matches
Working with JSON - Learn web development
we are going to load it into our page, and use some nifty dom manipulation to display it, like this: obtaining the json to obtain the json, we use an api called xmlhttp
request (often called xhr).
... this is a very useful javascript object that allows us to make network
requests to retrieve resources from a server via javascript (e.g.
...add the following at the bottom of your javascript code: let
requesturl = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; to create a
request, we need to create a new
request object instance from the xmlhttp
request constructor, using the new keyword.
...And 10 more matches
Fetch API - Web APIs
it will seem familiar to anyone who has used xmlhttp
request, but the new api provides a more powerful and flexible feature set.
... concepts and usage fetch provides a generic definition of
request and response objects (and other things involved with network
requests).
... this will allow them to be used wherever they are needed in the future, whether it’s for service workers, cache api, and other similar things that handle or modify
requests and responses, or any kind of use case that might require you to generate your responses programmatically (that is, the use of computer program or personal programming instructions).
...And 10 more matches
IDBTransaction - Web APIs
is it readonly or readwrite), and you access an idbobjectstore to make a
request.
...0" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbtransaction</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} transactions are started when the transaction is created, not when the first
request is placed; for example consider this: var trans1 = db.transaction("foo", "readwrite"); var trans2 = db.transaction("foo", "readwrite"); var objectstore2 = trans2.objectstore("foo") var objectstore1 = trans1.objectstore("foo") objectstore2.put("2", "key"); objectstore1.put("1", "key"); after the code is executed the object store should contain the value "2", since trans2 should run after trans1...
... transaction failures transactions can fail for a fixed number of reasons, all of which (except the user agent crash) will trigger an abort callback: abort due to bad
requests, e.g.
...And 10 more matches
PaymentResponse - Web APIs
the paymentresponse interface of the payment
request api is returned after a user selects a payment method and approves a payment
request.
...this option is only present when the
requestpayeremail option is set to true in the options parameter of the payment
request() constructor.
...this option is only present when the
requestpayername option is set to true in the options parameter of the payment
request() constructor.
...And 10 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
setup and utility functions next, we declare the variables and constants used throughout the application, starting with those used to store webgl and webxr specific information: let polyfill = null; let xrsession = null; let xrinputsources = null; let xrreferencespace = null; let xrbutton = null; let gl = null; let animationframe
requestid = 0; let shaderprogram = null; let programinfo = null; let buffers = null; let texture = null; let mouseyaw = 0; let mousepitch = 0; this is followed by a set of constants, mostly to contain various vectors and matrices used while rendering the scene.
... async function onxrbuttonclick(event) { if (!xrsession) { navigator.xr.
requestsession(session_type) .then(sessionstarted); } else { await xrsession.end(); if (xrsession) { sessionended(); } } } this begins by looking at the value of xrsession to see if we already have a xrsession object representing an ongoing webxr session.
... if we don't, the click represents a
request to enable webxr mode, so we check to see if the desired webxr session type is supported.
...And 10 more matches
Creating a dynamic status bar extension - Archive of obsolete content
refreshinformation: function() { var http
request = null; var fullurl = 'http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=goog'; // ...
... http
request = new xmlhttp
request(); http
request.open('get', fullurl, true); http
request.onload = inforeceived; http
request.send(null); } the http
request variable will contain an xmlhttp
request object.
... this object is used to configure and run an http
request on a web server, which we'll use to fetch the stock quote data.
...And 9 more matches
New Security Model for Web Services - Archive of obsolete content
securing resources from untrusted scripts behind firewalls introduction this page describes an alternative mechanism which can be used to protect all internal resources against
requests from sandboxed scripts.
... using a soap header for verification soap messages have a distinct processing model allowing a header to be added that the recipient is required to understand and accept, which identifies the untrusted source of a script making a
request.
... soap services which have not been cleared for access by untrusted scripts will reject the
requests.
...And 9 more matches
nsIHttpServer
rectorypath) { var file = components.classes['@mozilla.org/file/local;1'] .createinstance(components.interfaces.nsilocalfile); file.initwithpath(directorypath); return server.registerdirectory(path, file); }, registerpathhandler: function(path, handlercallback) { server.registerpathhandler(path, function (
request, response) { var req = createhttp
request(
request); var resp = new httpresponse(response); handlercallback(req, resp); }); }, registerprefixhandler: function(prefix, handlercallback) { server.registerprefixhandler(prefix, function (
request, response) { var req = createhttpreques...
...t(
request); var resp = new httpresponse(response); handlercallback(req, resp); }); }, close: function(){ server.stop(function(){}); }, get port() { return server.identity.primaryport } } } reference : mozilla-release/netwerk/test/httpserver/nsihttpserver.idl [scriptable, uuid(cea8812e-faa6-4013-9396-f9936cbb74ec)] interface nsihttpserver : nsisupports { /** * starts up this server, listening upon the given port.
... * * @param callback * an asynchronous callback used to notify the user when this server is * stopped and all pending
requests have been fully served * @throws ns_error_null_pointer * if callback is null * @throws ns_error_unexpected * if this server is not running */ void stop(in nsihttpserverstoppedcallback callback); /** * associates the local file represented by the string file with all
requests * which match
request.
...And 9 more matches
nsISmsDatabaseService
= components.classes["@mozilla.org/sms/smsdatabaseservice;1"] .createinstance(components.interfaces.nsismsdatabaseservice); method overview long savereceivedmessage(in domstring asender, in domstring abody, in unsigned long long adate); long savesentmessage(in domstring areceiver, in domstring abody, in unsigned long long adate); void getmessage(in long messageid, in long
requestid, [optional] in unsigned long long processid); void deletemessage(in long messageid, in long
requestid, [optional] in unsigned long long processid); void createmessagelist(in nsidommozsmsfilter filter, in boolean reverse, in long
requestid, [optional] in unsigned long long processid); void getnextmessageinlist(in long listid, in long
requestid, [optional] in unsigned long long processid); ...
... void clearmessagelist(in long listid); void markmessageread(in long messageid, in boolean value, in long
requestid, [optional] in unsigned long long processid) methods savereceivedmessage() void savereceivedmessage( in domstring asender, in domstring abody, in unsigned long long adate ); parameters asender a domstring with the sender of the text message.
... getmessage() void getmessage( in long messageid, in long
requestid, [optional] in unsigned long long processid ); parameters messageid a number representing the id of the message.
...And 9 more matches
nsIWebProgressListener2
last changed in gecko 1.9 (firefox 3) inherits from: nsiwebprogresslistener method overview void onprogresschange64(in nsiwebprogress awebprogress, in nsi
request a
request, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress); boolean onrefreshattempted(in nsiwebprogress awebprogress, in nsiuri arefreshuri, in long amillis, in boolean asameuri); methods onprogresschange64() notification that the progress has changed for one of the
requests associated with awebprogress.
... progress totals are reset to zero when all
requests in awebprogress complete (corresponding to onstatechange being called with astateflags including the state_stop and state_is_window flags).
...void onprogresschange64( in nsiwebprogress awebprogress, in nsi
request a
request, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress ); parameters awebprogress the nsiwebprogress instance that fired the notification.
...And 9 more matches
nsIMsgCloudFileProvider
inherits from: nsisupports method overview void init(in string aaccountkey); void uploadfile(in nsilocalfile afile, in nsi
requestobserver acallback); acstring urlforfile(in nsilocalfile afile); void cancelfileupload(in nsilocalfile afile); void refreshuserinfo(in boolean awithui, in nsi
requestobserver acallback); void deletefile(in nsilocalfile afile, in nsi
requestobserver acallback); void createnewaccount(in acstring aemailaddress, in acstring apassword, in acstring afirstname, in acstring alastname, in nsi
requestobserver acallback); void createexistingaccount(in nsireque...
... constants the following constants are used for the status codes passed to the onstop
request functions of the nsi
requestobserver's used by the asynchronous methods of nsimsgcloudfileprovider.
... void uploadfile(in nsilocalfile afile, in nsi
requestobserver acallback); parameters afile the file to be uploaded.
...And 9 more matches
Guide to the Fullscreen API - Web APIs
activating full-screen mode given an element that you'd like to present in full-screen mode (such as a <video>, for example), you can present it in full-screen mode by simply calling its
requestfullscreen() method.
... let's consider this <video> element: <video controls id="myvideo"> <source src="somevideo.webm"></source> <source src="somevideo.mp4"></source> </video> we can put that video into full-screen mode as follows: var elem = document.getelementbyid("myvideo"); if (elem.
requestfullscreen) { elem.
requestfullscreen(); } this code checks for the existence of the
requestfullscreen() method before calling it.
... when a fullscreen
request fails it's not guaranteed that you'll be able to switch into fullscreen mode.
...And 9 more matches
MediaDevices.getUserMedia() - Web APIs
the mediadevices.getusermedia() method prompts the user for permission to use a media input which produces a mediastream with tracks containing the
requested types of media.
... note: it's possible for the returned promise to neither resolve nor reject, as the user is not required to make a choice at all and may simply ignore the
request.
... syntax var promise = navigator.mediadevices.getusermedia(constraints); parameters constraints a mediastreamconstraints object specifying the types of media to
request, along with any requirements for each type.
...And 9 more matches
Using bounded reference spaces - Web APIs
you can create a session that supports a bounded-floor reference space if available by using code such as the following: async function onactivatexrbutton(event) { if (!xrsession) { navgator.xr.
requestsession("immersive-vr"), { requiredfeatures: ["local-floor"], optionalfeatures: ["bounded-floor"] }).then((session) => { xrsession = session; startsessionanimation(); }); } } this function, called when the user clicks on a button to start the xr experience, works as usual, exiting at once if a session is already in place, then
requesting a new session using imme...
...the options specified when
requesting the session indicate that at a minimum, the session must be compatible with the local-floor reference space, but that it would be nice if the bounded-floor space were supported as well.
... once the session has been created, our startsessionanimation() function can try to establish a bounded-floor reference space, and if it fails to do so it can then fall back to
requesting a local-floor reference space instead (in which we will have to handle boundaries ourselves).
...And 9 more matches
Rendering and the WebXR frame animation callback - Web APIs
before you can render the virtual environment, you need to establish a webxr session by creating an xrsession using the navigator.xr.
requestsession() method; you also need to associate the session with a framebuffer and perform other setup tasks.
...once that's in hand, you
request that the browser call your rendering function the next time it needs a framebuffer to render your scene.
... this is done by calling the xrsession method
requestanimationframe().
...And 9 more matches
Web Authentication API - Web APIs
the full set of required fields, optional fields, and their meanings for creating a registration
request can be found in the publickeycredentialcreationoptions dictionary.
... the registration steps are: application
requests registration - the application makes the initial registration
request.
... the protocol and format of this
request is outside of the scope of the web authentication api.
...And 9 more matches
Event reference
e non-standard events) storage update events checking downloading error noupdate obsolete updateready value change events broadcast checkboxstatechange hashchange input radiostatechange readystatechange valuechange uncategorized events invalid message message open show less common and non-standard events abortable fetch events event name fired when abort a dom
request is aborted, i.e.
... abort progressevent progress and xmlhttp
request progression has been terminated (not due to an error).
... error progressevent progress and xmlhttp
request progression has failed.
...And 9 more matches
Using HTTP cookies - HTTP
the browser may store it and send it back with later
requests to the same server.
... typically, it's used to tell if two
requests came from the same browser — keeping a user logged-in, for example.
...cookies are sent with every
request, so they can worsen performance (especially for mobile data connections).
...And 9 more matches
Redirections in HTTP - HTTP
principle in http, redirection is triggered by a server sending a special redirect response to a
request.
... temporary redirections sometimes the
requested resource can't be accessed from its canonical location, but it can be accessed from another place.
... 304 not modified sent for revalidated conditional
requests.
...And 9 more matches
Types of attacks - Web security
(click-jacking is sometimes called "user interface redressing", though this is a misuse of the term "redress".) cross-site
request forgery (csrf) cross-site scripting (xss) cross-site scripting (xss) is a security exploit which allows an attacker to inject into a website malicious client-side code.
... cross-site scripting attacks usually occur when 1) data enters a web app through an untrusted source (most often a web
request) or 2) dynamic content is sent to a web user without being validated for malicious content.
...the victim then retrieves this malicious script from the server when the browser sends a
request for data.
...And 9 more matches
Third-party APIs - Learn web development
note: some apis handle access to their functionality slightly differently, requiring the developer to make an http
request to a specific url pattern to retrieve data.
...when the developer has registered for a key, they are then known to the api provider, and action can be taken if they start to do anything malicious with the api (such as tracking people's location or trying to spam the api with loads of
requests to stop it working, for example).
...this type of api is known as a restful api — instead of getting data using the features of a javascript library like we did with mapquest, we get data by making http
requests to specific urls, with data like search terms and other properties encoded in the url (often as url parameters).
...And 8 more matches
Handling common JavaScript problems - Learn web development
see the code snippet in how to make an http
request) so developers only have to write one simple bit of code (see jquery.ajax()).
...for example, this ajax example checks to make sure the
request is complete and the response has been returned before trying to use the response for anything.
...this is supposed to be fetched from an external .json file using the following xmlhttp
request call: let
requesturl = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; let
request = new xmlhttp
request();
request.open('get',
requesturl);
request.send(); let superheroes =
request.response; populateheader(superheroes); showheroes(superheroes); but this fails.
...And 8 more matches
Performance best practices for Firefox front-end engineers
use
requestidlecallback() if you simply cannot avoid doing some kind of long job on the main thread, try to break it up into smaller pieces that you can run when the browser has a free moment to spare, and the user isn't doing anything.
... you can do that using
requestidlecallback() and the cooperative scheduling of background tasks api, and doing it only when we have a free second where presumably the user isn’t doing something.
... see also the blog post collective scheduling with
requestidlecallback.
...And 8 more matches
HTTP delegation
background up to version 3.11, nss connects directly over http to an ocsp responder to make the
request and fetch the response.
...this causes ocsp
requests to fail if the network environment requires the use of a proxy.
...or you might choose to leverage an existing http client library and implement the callback functions as a thin layer that forwards
requests from nss to the http client library.
...And 8 more matches
HTTP delegation
background up to version 3.11, nss connects directly over http to an ocsp responder to make the
request and fetch the response.
...this causes ocsp
requests to fail if the network environment requires the use of a proxy.
...or you might choose to leverage an existing http client library and implement the callback functions as a thin layer that forwards
requests from nss to the http client library.
...And 8 more matches
nsIIOService
this is the document/element that will get access to the result of this
request.
...but if the load is coming from a js api (such as xmlhttp
request) or if the load might be coalesced across multiple elements (such as for ) then pass in the document node instead.
...the principal of the document where the result of this
request will be used.
...And 8 more matches
PaymentResponse.complete() - Web APIs
the payment
request method complete() of the payment
request api notifies the user agent that the user interaction is over, and causes any remaining user interface to be closed.
... this method must be called after the user accepts the payment
request and the promise returned by the payment
request.show() method is resolved.
... syntax completepromise = payment
request.complete(result); parameters result optional a domstring indicating the state of the payment operation upon completion.
...And 8 more matches
PaymentResponse.retry() - Web APIs
syntax retrypromise = payment
request.retry(errorfields); parameters errorfields a paymentvalidationerrors object, with the following properties: error optional a general description of a payment error from which the user may attempt to recover by retrying the payment, possibly after correcting mistakes in the payment information.
... typically you will use this by calling show(), then entering a loop or recursive function that checks the paymentresponse for errors or other reasons to retry the payment
request.
...the loop exits only when the user either cancels the payment
request or the
request is successful.
...And 8 more matches
WebXR permissions and security - Web APIs
immersive presentation of vr first, any
requests to activate the immersive-vr mode are rejected if the domain issuing the
request does not have permission to enable an immersive session.
... once that check is passed, the
request to enter immersive-vr mode is allowed if all of the following are true: the
requestsession() call was issued by code executing within the handler for a user event, or the from the startup code for a user-launched web application.
... if all of that is true, the promise returned by
requestsession() is resolved, and the new xrsession object is passed into the fulfillment handler.
...And 8 more matches
Evolution of HTTP - HTTP
http/0.9 is extremely simple:
requests consist of a single line and start with the only possible method get followed by the path to the resource (not the url as both the protocol, server, and port are unnecessary once connected to the server).
... http/1.0 – building extensibility http/0.9 was very limited and both browsers and servers quickly extended it to be more versatile: versioning information is now sent within each
request (http/1.0 is appended to the get line) a status code line is also sent at the beginning of the response, allowing the browser itself to understand the success or failure of the
request and to adapt its behavior in consequence (like in updating or using its local cache in a specific way) the notion of http headers has been introduced, both for the
requests and the responses, allowing metadata to...
... at this point, a typical
request and response looked like this: get /mypage.html http/1.0 user-agent: ncsa_mosaic/2.0 (windows 3.1) 200 ok date: tue, 15 nov 1994 08:12:31 gmt server: cern/3.0 libwww/2.17 content-type: text/html <html> a page with an image <img src="/myimage.gif"> </html> followed by a second connection and
request to fetch the image (followed by a response to that
request): get /myimage.gif http/1.0 user-agent: ncsa_mosaic/2.0 (windows 3.1) 200 ok date: tue, 15 nov 1994 08:12:32 gmt server: cern/3.0 libwww/2.17 content-type: text/gif (image cont...
...And 8 more matches
Protocol upgrade mechanism - HTTP
this means that a typical
request that includes upgrade would look something like: get /index.html http/1.1 host: www.example.com connection: upgrade upgrade: example/1, foo/2 other headers may be required depending on the
requested protocol; for example, websocket upgrades allow additional headers to configure details about the websocket connection as well as to offer a degree of security in opening the connection.
...effectively, the connection becomes a two-way pipe as soon as the upgraded response is complete, and the
request that initiated the upgrade can be completed over the new protocol.
...after creating the initial http/1.1 session, you need to
request the upgrade by adding to a standard
request the upgrade and connection headers, as follows: connection: upgrade upgrade: websocket websocket-specific headers the following headers are involved in the websocket upgrade process.
...And 8 more matches
NPP_NewStream - Archive of obsolete content
stream supports random access through calls to npn_
requestread (for example, local files or http servers that support byte-range
requests).
...the browser must copy data in the stream to the local cache to satisfy random access
requests made through npn_
requestread.
...the plugin should set this value to
request a mode for the stream.
...And 7 more matches
Using IO Timeout And Interrupt On NT - Archive of obsolete content
when a thread calls an io function, the thread issues an overlapped io
request using the overlapped buffer in its <tt>prthread</tt> structure.
...in the meantime, there are dedicated internal threads (called the idle threads) monitoring the io completion port for completed io
requests.
... if a completed io
request appears at the io completion port, an idle thread fetches it and wakes up the thread that issued the io
request earlier.
...And 7 more matches
What is a web server? - Learn web development
at the most basic level, whenever a browser needs a file that is hosted on a web server, the browser
requests the file via http.
... when the
request reaches the correct (hardware) web server, the (software) http server accepts the
request, finds the
requested document, and sends it back to the browser, also through http.
... (if the server doesn't find the
requested document, it returns a 404 response instead.) to publish a website, you need either a static or a dynamic web server.
...And 7 more matches
Website security - Learn web development
while the data from post or get
requests is the most common source of xss vulnerabilities, any data from the browser is potentially vulnerable, such as cookie data rendered by the browser, or user files that are uploaded and displayed.
... cross-site
request forgery (csrf) csrf attacks allow a malicious user to execute actions using the credentials of another user without that user’s knowledge or consent.
...john is a malicious user who knows that a particular site allows logged-in users to send money to a specified account using an http post
request that includes the account name and an amount of money.
...And 7 more matches
Overview of Mozilla embedding APIs
do_getinterface this function simplfies retrieving interfaces via the nsiinterface
requestor::getinterface(...) method.
... using this function, one can use nsisupports instances and still easily access other interfaces via nsiinterface
requestor.
... internally, this function tries to convert the nsisupports argument into an nsiinterface
requestor and then calls getinterface(...) to retrieve the
requested interface.
...And 7 more matches
L20n Javascript API
l20n javascript api var ctx = l20n.getcontext(); ctx.linkresource('./locales/strings.l20n'); ctx.
requestlocales(); when you freeze the context by calling
requestlocales, the resource files will be retrieved, parsed and compiled.
... ctx.registerlocalenegotiator(function(available,
requested, deflocale) { return intl.prioritizelocales(available,
requested, deflocale); }); negotiator is a function which takes the following arguments: available - all locales available to the context instance,
requested - locales preferred by the user, deflocale - the default locale to be used as the ultimate fallback, callback - the function to call when the negotiation completes (useful for ...
... ctx.registerlocalenegotiator(function(available,
requested, deflocale, callback) { yourapp.getallavailablelanguages(function(allavailable) { var fallbackchain = yourapp.intersect(allavailable,
requested); cb(fallbackchain); }); }); ctx.
requestlocales(...
requestedlocales: string?) specify the user's preferred locales for the context instance to negotiate against and freeze the context instance.
...And 7 more matches
NSPR Error Handling
error type prerrorcode error functions pr_seterror pr_seterrortext pr_geterror pr_getoserror pr_geterrortextlength pr_geterrortext error codes error codes defined in prerror.h: pr_out_of_memory_error insufficient memory to perform
request.
... pr_insufficient_resources_error there are insufficient system resources to process the
request.
... pr_no_access_rights_error calling thread does not have privilege to perform the operation
requested.
...And 7 more matches
How to embed the JavaScript engine
tystub, js_propertystub, js_strictpropertystub, js_enumeratestub, js_resolvestub, js_convertstub, }; int main(int argc, const char *argv[]) { jsruntime *rt = js_newruntime(8l * 1024 * 1024, js_use_helper_threads); if (!rt) return 1; jscontext *cx = js_newcontext(rt, 8192); if (!cx) return 1; { // scope for our various stack objects (jsauto
request, rootedobject), so they all go // out of scope before we js_destroycontext.
... jsauto
request ar(cx); // in practice, you would want to exit this any // time you're spinning the event loop js::rootedobject global(cx, js_newglobalobject(cx, &global_class, nullptr)); if (!global) return 1; js::rootedvalue rval(cx); { // scope for jsautocompartment jsautocompartment ac(cx, global); js_initstandardclasses(cx, global); const char *script = "'hello'+'world, it is '+new date()"; const char *filename = "noname"; int lineno = 1; bool ok = js_evaluatescript(cx, global, script, strlen(script), filename, lineno, rval.address()); if (!ok) return 1; } jsstring *str = rval.tostring(); printf("%s\n", js_encodestring(cx, str)); } ...
... js_convertstub, nullptr, nullptr, nullptr, nullptr, js_globalobjecttracehook }; int main(int argc, const char *argv[]) { js_init(); jsruntime *rt = js_newruntime(8l * 1024 * 1024, js_use_helper_threads); if (!rt) return 1; jscontext *cx = js_newcontext(rt, 8192); if (!cx) return 1; { // scope for our various stack objects (jsauto
request, rootedobject), so they all go // out of scope before we js_destroycontext.
...And 7 more matches
nsICachingChannel
the value of this attribute is usually only settable during the processing of a channel's onstart
request.
...depending on the value of nsi
request.loadflags(), the cache entry may be validated, overwritten, or simply read.
...an error of ns_error_document_not_cached will be sent to the listener's onstop
request if network io is necessary to complete the
request.
...And 7 more matches
nsITraceableChannel
is as follows: register for the "http-on-examine-response" notification to track all http responses; skip redirects (responsestatus = 3xx on nsihttpchannel), since otherwise you may end up with two listeners registered for a channel; qi the channel passed as the "subject" to your observer to nsitraceablechannel, and replace the default nsistreamlistener (that passes the data to the original
requester - e.g.
... to xmlhttp
request or to the browser tab that made the
request) with your own implementation (see "implementing nsistreamlistener" below).
... see modify url before loading page in firefox for an overview of how to modify a
request before it is made.
...And 7 more matches
Beacon API - Web APIs
the beacon interface is used to schedule an asynchronous and non-blocking
request to a web server.
... beacon
requests use the http post method and
requests typically do not require a response.
...
requests are guaranteed to be initiated before a page is unloaded and they are run to completion, without requiring a blocking
request (for example xmlhttp
request).
...And 7 more matches
Cache.match() - Web APIs
the match() method of the cache interface returns a promise that resolves to the response associated with the first matching
request in the cache object.
... syntax cache.match(
request, {options}).then(function(response) { // do something with the response }); parameters
request the
request for which you are attempting to find responses in the cache.
... this can be a
request object or a url.
...And 7 more matches
IDBFactory.open() - Web APIs
the open() method of the idbfactory interface
requests opening a connection to a database.
... the method returns an idbopendb
request object immediately, and performs the open operation asynchronously.
... if the operation is successful, a success event is fired on the
request object that is returned from this method, with its result attribute set to the new idbdatabase object for the connection.
...And 7 more matches
Basic concepts - Web APIs
instead, you "
request" that a database operation happens.
...it's not that different from the way that xmlhttp
request works.
... indexeddb uses a lot of
requests.
...And 7 more matches
LocalFileSystemSync - Web APIs
basic concepts you can
request access to a sandboxed file system by
requesting localfilesystemsync object from within a web worker.
... the global methods in the window object
requestfilesystemsync() and resolvelocalfilesystemsyncurl() methods are exposed to the worker's global scope.
... calling window.
requestfilesystemsync() for creates new storage for your web app.
...And 7 more matches
PaymentResponse.shippingAddress - Web APIs
the shippingaddress read-only property of the payment
request interface returns a paymentaddress object containing the shipping address provided by the user.
... syntax var shippingaddress = payment
request.shippingaddress; value a paymentaddress object providing details comprising the shipping address provided by the user.
...you can trigger this by setting paymentoptions.
requestshipping to true when calling the payment
request constructor.
...And 7 more matches
Writing WebSocket servers - Web APIs
for example, let's assume that your server is listening on example.com, port 8000, and your socket server responds to get
requests at example.com/chat.
... tip: the
request-uri (/chat here) has no defined meaning in the spec.
... client handshake
request even though you're building a server, a client still has to start the websocket handshake process by contacting the server and
requesting a websocket connection.
...And 7 more matches
Ajax - Developer guides
asynchronous javascript and xml, while not a technology in itself, is a term coined in 2005 by jesse james garrett, that describes a "new" approach to using a number of existing technologies together, including html or xhtml, css, javascript, dom, xml, xslt, and most importantly the xmlhttp
request object.
... using the xmlhttp
request api the xmlhttp
request api is the core of ajax.
... this article will explain how to use some ajax techniques, like: analyzing and manipulating the response of the server monitoring the progress of a
request submitting forms and upload binary files – in pure ajax, or using formdata objects using ajax within web workers fetch api the fetch api provides an interface for fetching resources.
...And 7 more matches
Standard metadata names - HTML: Hypertext Markup Language
referrer: controls the http referer header for to
requests sent from the document: values for the content attribute of <meta name="referrer"> no-referrer do not send a http referer header.
... origin-when-cross-origin send the full url (stripped of parameters) for same-origin
requests, but only send the origin for other cases.
... same-origin send the full url (stripped of parameters) for same-origin
requests.
...And 7 more matches
Access-Control-Allow-Headers - HTTP
the access-control-allow-headers response header is used in response to a preflight
request which includes the access-control-
request-headers to indicate which http headers can be used during the actual
request.
... this header is required if the
request has an access-control-
request-headers header.
... header type response header forbidden header name no syntax access-control-allow-headers: <header-name>[, <header-name>]* access-control-allow-headers: * directives <header-name> the name of a supported
request header.
...And 7 more matches
HTTP
http follows a classical client-server model, with a client opening a connection to make a
request, then waiting until it receives a response.
... http is a stateless protocol, meaning that the server does not keep any data (state) between two
requests.
...when serving an http
request, a server can send a set-cookie http header with the response.
...And 7 more matches
Microsummary topics - Archive of obsolete content
differentiating between user-initiated and microsummary-related
requests when firefox updates a microsummary generated by a microsummary generator add-on, it automatically downloads the html content of the page being summarized.
...firefox includes the x-moz
request header with these
requests.
...thus, to differentiate
requests initiated manually by users for the purpose of viewing a web page from those initiated automatically by firefox for the purpose of summarizing that page, check for the presence and value of the x-moz
request header.
...And 6 more matches
NPN_GetURLNotify - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary
requests creation of a new stream with the contents of the specified url; gets notification of the result.
... url pointer to the url of the
request.
... notifydata plug-in-private value for associating the
request with the subsequent npp_urlnotify() call, which passes this value (see description below).
...And 6 more matches
Drawing graphics - Learn web development
there are a few javascript functions that will allow you to run functions repeatedly, several times a second, the best one for our purposes here being window.
requestanimationframe().
...if that function draws the new update to your animation, then calls
requestanimationframe() again just before the end of the function, the animation loop will continue to run.
... the loop ends when you stop calling
requestanimationframe() or if you call window.cancelanimationframe() after calling
requestanimationframe() but before the frame is called.
...And 6 more matches
Experimental features in Firefox
nightly 33 no developer edition 33 no beta 33 no release 33 no preference name media.track.enabled dom document property: autoplaypolicy the document property autoplaypolicy returns a string indicating how the browser handles
requests to automatically play media (either using the autoplay property on a media element or by attempting to trigger playback from javascript code.
... nightly 31 yes developer edition 31 no beta 31 no release 31 no preference name layout.css.convertfromnode.enable payment
request api primary payment handling the payment
request api provides support for handling web-based payments within web content or apps.
... nightly 55 no developer edition 55 no beta 55 no release 55 no preference name dom.payments.
request.enabled and dom.payments.
request.supportedregions basic card api extends the payment
request api with dictionaries that define data structures describing card payment types and payment responses.
...And 6 more matches
Storage access policy: Block cookies from trackers
specifically, firefox does this by imposing the following restrictions: cookies: block cookie
request headers and ignore set-cookie response headers.
... return an empty string for calls to document.cookie and ignore
requests to set cookies via document.cookie.
... http connection reuse by domains classified as trackers is limited to
requests that occur under the same top-level origin.
...And 6 more matches
Localization sign-off reviews
this article presents an overview of why we do sign-off reviews of localizations, the details on the criteria used for the sign-off reviews, and the process for
requesting a review and for following its progress.
... how it all works a large part of the review process takes place before you even submit your
request for a sign-off review.
... to put it simply, when we receive your
request, we expect that you have spent time testing your work and making sure all strings have been localized and that your changes are relatively functional.
...And 6 more matches
Localization technical reviews
this guide provides details on what a localization technical review is, what criteria are used for the technical reviews, and the process for
requesting one and following its progress.
...most locales should have the following: #filter substitution pref("general.useragent.locale", "@ab_cd@") how it all works a large part of the review process takes place before you even submit your
request for a technical review.
... to put it simply, when we receive your
request, we expect that you have spent time testing your work and making sure all strings have been localized and that your language pack is relatively functional.
...And 6 more matches
Basic animations - Web APIs
scheduled updates first there's the window.setinterval(), window.settimeout(), and window.
requestanimationframe() functions, which can be used to call a specific function over a set period of time.
...
requestanimationframe(callback) tells the browser that you wish to perform an animation and
requests that the browser call a specified function to update an animation before the next repaint.
... in the examples below, we'll use the window.
requestanimationframe() method to control the animation.
...And 6 more matches
FetchEvent - Web APIs
it contains information about the fetch, including the
request and how the receiver will treat the response.
... fetchevent.
request read only the
request the browser intends to make.
... examples this fetch event uses the browser default for non-get
requests.
...And 6 more matches
IDBObjectStore.add() - Web APIs
the add() method of the idbobjectstore interface returns an idb
request object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store.
... to determine if the add operation has completed successfully, listen for the transaction’s complete event in addition to the idbobjectstore.add
request’s success event, because the transaction may still fail after the success event fires.
...if a record already exists in the object store with the key parameter as its key, then an error constrainerror event is fired on the returned
request object.
...And 6 more matches
PaymentResponse.shippingOption - Web APIs
the shippingoption read-only property of the payment
request interface returns the id attribute of the shipping option selected by the user.
... this option is only present when the
requestshipping option is set to true in the paymentoptions object passed to the payment
request constructor.
... syntax var shippingoption = payment
request.shippingoption; example in the example below, the payment
request.onshippingaoptionchange event is called.
...And 6 more matches
Pointer Lock API - Web APIs
requestpointerlock() the pointer lock api, similar to the fullscreen api, extends dom elements by adding a new method,
requestpointerlock().
... as it has recently unprefixed, you would currently declare it something like this, for example if you wanted to
request pointer lock on a canvas element: canvas.
requestpointerlock = canvas.
requestpointerlock || canvas.moz
requestpointerlock; canvas.
requestpointerlock() if a user has exited pointer lock via the default unlock gesture, or pointer lock has not previously been entered for this document, an event generated as a result of an engagement gesture must be received by the document before
requestpointerlock will succeed.
... here is an example of using pointerlockelement: if(document.pointerlockelement === canvas || document.mozpointerlockelement === canvas) { console.log('the pointer lock status is now locked'); } else { console.log('the pointer lock status is now unlocked'); } the document.exitpointerlock() method is used to exit pointer lock, and like
requestpointerlock, works asynchronously using the pointerlockchange and pointerlockerror events, which you'll see more about below.
...And 6 more matches
Configuring servers for Ogg media - HTTP
handle http 1.1 byte range
requests correctly in order to support seeking and playing back regions of the media that aren't yet downloaded, gecko uses http 1.1 byte-range
requests to retrieve the media from the seek target position.
... in addition, gecko uses byte-range
requests to seek to the end of the media (assuming you serve the content-length header) in order to determine the duration of the media.
... your server should accept the accept-ranges: bytes http header if it can accept byte-range
requests.
...And 6 more matches
Range - HTTP
the range http
request header indicates the part of a document that the server should return.
... several parts can be
requested with one range header at once, and the server may send back these ranges in a multipart document.
... header type
request header forbidden header name no syntax range: <unit>=<range-start>- range: <unit>=<range-start>-<range-end> range: <unit>=<range-start>-<range-end>, <range-start>-<range-end> range: <unit>=<range-start>-<range-end>, <range-start>-<range-end>, <range-start>-<range-end> range: <unit>=-<suffix-length> directives <unit> the unit in which ranges are specified.
...And 6 more matches
Set-Cookie - HTTP
path=<path-value> optional a path that must exist in the
requested url, or the browser won't send the cookie header.
... secure optional a secure cookie is only sent to the server when a
request is made with the https: scheme.
...note that a cookie that has been created with httponly will still be sent with javascript-initiated
requests, e.g.
...And 6 more matches
Link prefetching FAQ - HTTP
the browser observes all of these hints and queues up each unique
request to be prefetched when the browser is idle.
...this is when we kick off prefetch
requests.
...when the user visits a prefetched document for real, the remaining portion of the document will be fetched using a http byte-range
request.
...And 6 more matches
Network Error Logging - HTTP
success_fraction floating point value between 0 and 1 which specifies the proportion of successful network
requests to report.
... defaults to 0, so that no successful network
requests will be reported if the key is not present in the json payload.
... failure_fraction floating point value between 0 and 1 which specifies the proportion of failed network
requests to report.
...And 6 more matches
Proxy servers and tunneling - HTTP
reverse proxies as the name implies, a reverse proxy does the opposite of what a forward proxy does: a forward proxy acts in behalf of clients (or
requesting hosts), a reverse proxy acts in behalf of servers.
... forwarding client information through proxies proxies can make
requests appear as if they originated from the proxy's ip address.
... this can be useful if a proxy is used to provide client anonymity, but in other cases information from the original
request is lost.
...And 6 more matches
CSS and JavaScript animation performance - Web Performance
there are many ways to implement web animations, such as css transitions/animations or javascript-based animations (using
requestanimationframe()).
...
requestanimationframe the
requestanimationframe() api provides an efficient way to make animations in javascript.
...compared to settimeout()/setinterval(), which need a specific delay parameter,
requestanimationframe() is much more efficient.
...And 6 more matches
Critical rendering path - Web Performance
the html may
request javascript, which may, in turn, alter the dom.
... the html includes or makes
requests for styles, which in turn builds the css object model.
... understanding crp web performance includes the server
requests and responses, loading, scripting, rendering, layout, and the painting of the pixels to the screen.
...And 6 more matches
net/xhr - Archive of obsolete content
provides access to xmlhttp
request functionality.
... usage security concerns by default, the xmlhttp
request object grants full access to any protocol scheme, which means that it can be used to read from (but not write to) the host system's entire filesystem.
... threat model the xmlhttp
request object can be used by an add-on to "phone home" and transmit potentially sensitive user data to third parties.
...And 5 more matches
NPP_URLNotify - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary notifies the plug-in instance of the completion of a url
request.
... url url of the npn_geturlnotify() or npn_posturlnotify()
request that has completed.
... reason reason code for completion of
request.
...And 5 more matches
NPAPI plugin reference - Archive of obsolete content
browser-side plug-in api this chapter describes methods in the plug-in api that are provided by the browser; these allow call back to the browser to
request information, tell the browser to repaint part of the window, and so forth.
... npn newstream
requests the creation of a new data stream produced by the plug-in and consumed by the browser.
... npn_geturlnotify
requests creation of a new stream with the contents of the specified url; gets notification of the result.
...And 5 more matches
Necko walkthrough
has onstart
request, onstop
request, ondataavailable, the three functions in which channel responses are received asynchronously.
...but the interface for clients of necko is important to consider: send
request uri helps creates channel setup channel (headers,
request data, response callback...) channel->asyncopen.
... receive response get a callback to each of these: nsistreamlistener::onstart
request (header info) nsistreamlistener::ondataavailable (data in single or multiple chunks) nsistreamlistener::onstop
request (no more data from http) this all happens on the main thread, in a non-blocking fashion: make your
request on the main thread, then carry on and get the async response later, also on the main thread.
...And 5 more matches
Invariants
(here "the global object" refers to the object at the end of the scope chain of the function object we're executing.)
requests many functions require a
request.
... that is, they take a parameter cx of type jscontext *, and require that cx is in a
request on the current thread.
... "are we in a
request on cx?", where cx is any variable of type jscontext *, is a static yes for most lines of code where such a variable exists.
...And 5 more matches
nsICacheEntryDescriptor
inherits from: nsicacheentryinfo last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void close(); void doom(); void doomandfailpending
requests(in nsresult status); string getmetadataelement(in string key); void markvalid(); nsiinputstream openinputstream(in unsigned long offset); nsioutputstream openoutputstream(in unsigned long offset); void setdatasize(in unsigned long size); void setexpirationtime(in pruint32 expirationtime); void setmetadataelement(in string key, in string value); void visitmetadata(in nsicachemetadatavisitor visitor); attributes attribute type description accessgranted nscacheaccessmode get th...
...a descriptor with write access can doom the cache entry and choose to fail pending
requests.
... this means that pending
requests will not get a cache descriptor.
...And 5 more matches
nsIParentalControlsService
toolkit/components/parentalcontrols/public/nsiparentalcontrolsservice.idlscriptable this interface provides access to the operating system's parental controls feature, allowing code to detect whether such a service is enabled and to
request overrides to bypass the feature.
...to create an instance, use: var parentalcontrolsservice = components.classes["@mozilla.org/parental-controls-service;1"] .createinstance(components.interfaces.nsiparentalcontrolsservice); method overview void log(in short aentrytype, in boolean aflag, in nsiuri asource, [optional] in nsifile atarget); boolean
requesturioverride(in nsiuri atarget, [optional] in nsiinterface
requestor awindowcontext); boolean
requesturioverrides(in nsiarray atargets, [optional] in nsiinterface
requestor awindowcontext); attributes attribute type description blockfiledownloadsenabled boolean true if the current user account's parental controls restrictions include the blocking of all ...
...
requesturioverride()
requests that a blocked uri be allowed through parental control filters.
...And 5 more matches
nsIProgressEventSink
notifications will cease once the channel calls its listener's onstop
request method or once the channel is canceled (via nsi
request.cancel()).
... note: this interface is actually not specific to channels and may be used with other implementations of nsi
request.
... method overview void onprogress(in nsi
request a
request, in nsisupports acontext, in unsigned long long aprogress, in unsigned long long aprogressmax); void onstatus(in nsi
request a
request, in nsisupports acontext, in nsresult astatus, in wstring astatusarg); methods onprogress() called to notify the event sink that progress has occurred for the given
request.
...And 5 more matches
Intensive JavaScript - Firefox Developer Tools
the first is to split long-running functions into pieces and use
requestanimationframe to schedule each piece, and the second is to run the whole function in a separate thread using a web worker.
... there's also a video version of this walkthrough: the demo website looks like this: it has three controls: a radio button group to control how to run the javascript: as a single blocking operation in the main thread, as a series of smaller operations in the main thread using
requestanimationframe(), or in another thread using a worker.
... using
requestanimationframe in the first attempt at fixing this, we'll split up the function into a number of much smaller self-contained functions, and schedule each one using
requestanimationframe().
...And 5 more matches
Cache.put() - Web APIs
often, you will just want to fetch() one or more
requests, then add the result straight to your cache.
... fetch(url).then(function(response) { if (!response.ok) { throw new typeerror('bad response status'); } return cache.put(url, response); }) note: put() will overwrite any key/value pair previously stored in the cache that matches the
request.
... note: cache.add/cache.addall do not cache responses with response.status values that are not in the 200 range, whereas cache.put lets you store any
request/response pair.
...And 5 more matches
CacheStorage.match() - Web APIs
the match() method of the cachestorage interface checks if a given
request or url string is a key for a stored response.
... syntax caches.match(
request, options).then(function(response) { // do something with the response }); parameters
request the
request you want to match.
... this can be a
request object or a url string.
...And 5 more matches
Using files from web applications - Web APIs
function fileupload(img, file) { const reader = new filereader(); this.ctrl = createthrobber(img); const xhr = new xmlhttp
request(); this.xhr = xhr; const self = this; this.xhr.upload.addeventlistener("progress", function(e) { if (e.lengthcomputable) { const percentage = math.round((e.loaded * 100) / e.total); self.ctrl.update(percentage); } }, false); xhr.upload.addeventlistener("load", function(e){ self.ctrl.update(100); const canvas = self.ctrl.ctx.c...
..."post", "http://demos.hacks.mozilla.org/paul/demos/resources/webservices/devnull.php"); xhr.overridemimetype('text/plain; charset=x-user-defined-binary'); reader.onload = function(evt) { xhr.send(evt.target.result); }; reader.readasbinarystring(file); } the fileupload() function shown above creates a throbber, which is used to display progress information, and then creates an xmlhttp
request to handle uploading the data.
... before actually transferring the data, several preparatory steps are taken: the xmlhttp
request's upload progress listener is set to update the throbber with new percentage information so that as the upload progresses the throbber will be updated based on the latest information.
...And 5 more matches
Using FormData Objects - Web APIs
the formdata object lets you compile a set of key/value pairs to send using xmlhttp
request.
...var blob = new blob([content], { type: "text/xml"}); formdata.append("webmasterfile", blob); var
request = new xmlhttp
request();
request.open("post", "http://foo.com/submitform.php");
request.send(formdata); note: the fields "userfile" and "webmasterfile" both contain a file.
... this example builds a formdata instance containing values for fields named "username", "accountnum", "userfile" and "webmasterfile", then uses the xmlhttp
request method send() to send the form's data.
...And 5 more matches
Using the Gamepad API - Web APIs
performing such checks tends to involve using the gamepad object in conjunction with an animation loop (e.g.,
requestanimationframe), where developers want to make decisions for the current frame based on the state of the gamepad or gamepads.
... to start with, we declare some variables: the gamepadinfo paragraph that the connection info is written into, the ball that we want to move, the start variable that acts as the id for
requestanimation frame, the a and b variables that act as position modifiers for moving the ball, and the shorthand variables that will be used for the
requestanimationframe() and cancelanimationframe() cross browser forks.
...if so, we stop the
requestanimationframe() loop (see below) and revert the gamepad information back to what it was originally.
...And 5 more matches
IDBDatabaseException - Web APIs
constant value description abort_err 8 a
request was aborted, for example, through a call to idbtransaction.abort.
...for example, an object, such as an object store or index, already exists and a
request attempted to create a new one.
...it also occurs if a
request is made on a source object that has been deleted or removed.
...And 5 more matches
IDBFactory.deleteDatabase() - Web APIs
the deletedatabase() method of the idbfactory interface
requests the deletion of a database.
... the method returns an idbopendb
request object immediately, and performs the deletion operation asynchronously.
... if the database is successfully deleted, then a success event is fired on the
request object returned from this method, with its result set to undefined.
...And 5 more matches
IDBIndex - Web APIs
methods inherits from: eventtarget idbindex.count() returns an idb
request object, and in a separate thread, returns the number of records within a key range.
... idbindex.get() returns an idb
request object, and, in a separate thread, finds either the value in the referenced object store that corresponds to the given key or the first corresponding value, if key is an idbkeyrange.
... idbindex.getkey() returns an idb
request object, and, in a separate thread, finds either the given key or the primary key, if key is an idbkeyrange.
...And 5 more matches
IDBObjectStore.delete() - Web APIs
the delete() method of the idbobjectstore interface returns an idb
request object, and, in a separate thread, deletes the specified record or records.
... syntax var
request = objectstore.delete(key); var
request = objectstore.delete(keyrange); parameters key the key of the record to be deleted, or an idbkeyrange to delete all records with keys in range.
... return value an idb
request object on which subsequent events related to this operation are fired.
...And 5 more matches
IDBObjectStore.get() - Web APIs
the get() method of the idbobjectstore interface returns an idb
request object, and, in a separate thread, returns the object store selected by the specified key.
... if a value is successfully found, then a structured clone of it is created and set as the result of the
request object.
... syntax var
request = objectstore.get(key); parameters key the key or key range that identifies the record to be retrieved.
...And 5 more matches
IDBObjectStore.put() - Web APIs
it returns an idb
request object, and, in a separate thread, creates a structured clone of the value and stores the cloned value in the object store.
...if the record is successfully stored, then a success event is fired on the returned
request object with the result set to the key for the stored record, and the transaction set to the transaction in which this object store is opened.
... syntax let
request = objectstore.put(item); let
request = objectstore.put(item, key); parameters item the item you wish to update (or insert).
...And 5 more matches
Capabilities, constraints, and settings - Web APIs
this may not represent the actual current state of the track, due to properties whose
requested values had to be adjusted and because platform default values aren't represented.
... the most important thing to understand is that most constraints aren't requirements; instead, they're
requests.
...
requesting a specific value for a setting most simply, each constraint may be a specific value indicating a desired value for the setting.
...And 5 more matches
Payment processing concepts - Web APIs
the payment
request api makes it easy to handle payments in a web site or app.
... payee (or merchant) the merchant—either a person or an organization—whose web site or app wishes to receive money through the payment
request api.
...see basiccard
request for details.
...And 5 more matches
Service Worker API - Web APIs
they are intended, among other things, to enable the creation of effective offline experiences, intercept network
requests and take appropriate action based on whether the network is available, and update assets residing on the server.
...it takes the form of a javascript file that can control the web-page/site that it is associated with, intercepting and modifying navigation and resource
requests, and caching resources in a very granular fashion to give you complete control over how your app behaves in certain situations (the most obvious one being when the network is not available).
...having modified network
requests, wide open to man in the middle attacks would be really bad.
...And 5 more matches
XRSession - Web APIs
to open a webxr session, use the xrsystem interface's
requestsession() method.
... cancelanimationframe() removes a callback from the animation frame painting callback from xrsession's set of animation frame rendering callbacks, given the identifying handle returned by a previous call to
requestanimationframe().
...
requestanimationframe() schedules the specified method to be called the next time the user agent is working on rendering an animation frame for the webxr device.
...And 5 more matches
Web APIs
ensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source extensions mediastream recordingnnavigation timingnetwork information api ppage visibility apipayment
request apiperformance apiperformance timeline apipermissions apipointer eventspointer lock apiproximity events push api rresize observer apiresource timing apisserver sent eventsservice workers apistoragestorage access apistreams ttouch eventsuurl apivvibration apivisual viewport wweb animationsweb audio apiweb authentication apiweb crypto apiweb notificationsweb storage apiweb workers apiwebglwebrt...
...udiodestinationnode audiolistener audionode audionodeoptions audioparam audioparamdescriptor audioparammap audioprocessingevent audioscheduledsourcenode audiotrack audiotracklist audioworklet audioworkletglobalscope audioworkletnode audioworkletnodeoptions audioworkletprocessor authenticatorassertionresponse authenticatorattestationresponse authenticatorresponse b baseaudiocontext basiccard
request basiccardresponse batterymanager beforeinstallpromptevent beforeunloadevent biquadfilternode blob blobbuilder blobevent bluetooth bluetoothadvertisingdata bluetoothcharacteristicproperties bluetoothdevice bluetoothremotegattcharacteristic bluetoothremotegattdescriptor bluetoothremotegattserver bluetoothremotegattservice body broadcastchannel budgetservice budgetstate...
...gtc ext_texture_filter_anisotropic eckeygenparams eckeyimportparams ecdhkeyderiveparams ecdsaparams effecttiming element elementcssinlinestyle elementtraversal errorevent event eventlistener eventsource eventtarget extendableevent extendablemessageevent f featurepolicy federatedcredential fetchevent file fileentrysync fileerror fileexception filelist filereader filereadersync file
request filesystem filesystemdirectoryentry filesystemdirectoryreader filesystementry filesystementrysync filesystemfileentry filesystemflags filesystemsync focusevent fontface fontfaceset fontfacesetloadevent formdata formdataentryvalue formdataevent fullscreenoptions g gainnode gamepad gamepadbutton gamepadevent gamepadhapticactuator geolocation geolocationcoordinates geolocati...
...And 5 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
... crossorigin indicates if the fetching of the image must be done using a cors
request.
... image data from a cors-enabled image returned from a cors
request can be reused in the <canvas> element without being marked "tainted".
...And 5 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...the crossorigin attribute indicates whether the resource should be fetched with a cors
request.
...it specifies the type of content being loaded by the <link>, which is necessary for
request matching, application of correct content security policy, and setting of correct accept
request header.
...And 5 more matches
CORS errors - HTTP
this is used to explicitly allow some cross-origin
requests while rejecting others.
... if the cors configuration isn't setup correctly, the browser console will present an error like "cross-origin
request blocked: the same origin policy disallows reading the remote resource at $somesite" indicating that the
request was blocked due to violating the cors security rules.
...it's possible that the
request is in fact intentionally being disallowed by the user's web application and remote external service.
...And 5 more matches
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
service workers are quite powerful as they can take control over network
requests, modify them, serve custom responses retrieved from the cache, or synthesize responses completely.
... here, we open a cache with a given name, then add all the files our app uses to the cache, so they are available next time it loads (identified by
request url).
... responding to fetches we also have a fetch event at our disposal, which fires every time an http
request is fired off from our app.
...And 5 more matches
Appendix D: Loading Scripts - Archive of obsolete content
javascript files or urls may be loaded in this manner by first retrieving their contents into memory using an xmlhttp
request.
... in addition to compile time, reading files synchronously from disk has its own overhead, and xmlhttp
requests have significantly more overhead than native loading methods.
... const xmlhttp
request = components.constructor("@mozilla.org/xmlextras/xmlhttp
request;1", "nsixmlhttp
request", "open"); function loadscript(name, context) { // create the sandbox let sandbox = components.utils.sandbox(context, { sandboxprototype: context, wantxrays: false }); // get the caller'...
...And 4 more matches
JavaScript crypto - Archive of obsolete content
services are provided to enable: smart card events, generating certificate
requests, importing user certs, generating random numbers, logging out of your tokens, and signing text.
... generating keys and issuing user certificates there are several crypto object methods used in generating keys for certificates: generatecrmf
request(), importusercertificates().
... the generatecrmf
request() function generates a key and creates a crmf
request object.
...And 4 more matches
Using workers in extensions - Archive of obsolete content
how this differs from previous versions this version of the stock ticker extension moves the xmlhttp
request call that fetches updated stock information into a worker thread, which then passes that information back to the main body of the extension's code to update the display in the status bar.
... this demonstrates not only how to use workers in an extension, but also how to perform xmlhttp
request in a worker, and how workers and main thread code can pass data back and forth.
... the worker the worker thread's job in this example is to issue the xmlhttp
request calls that fetch the updated stock information.
...And 4 more matches
CORS - MDN Web Docs Glossary: Definitions of Web-related terms
cors (cross-origin resource sharing) is a system, consisting of transmitting http headers, that determines whether browsers block frontend javascript code from accessing responses for cross-origin
requests.
... access-control-allow-credentials indicates whether or not the response to the
request can be exposed when the credentials flag is true.
... access-control-allow-headers used in response to a preflight
request to indicate which http headers can be used when making the actual
request.
...And 4 more matches
Cacheable - MDN Web Docs Glossary: Definitions of Web-related terms
a cacheable response is an http response that can be cached, that is stored to be retrieved and used later, saving a new
request to the server.
... not all http responses can be cached, these are the following constraints for an http response to be cached: the method used in the
request is itself cacheable, that is either a get or a head method.
... a response to a post or patch
request can also be cached if freshness is indicated and the content-location header is set, but this is rarely implemented.
...And 4 more matches
Index - Learn web development
49 asynchronous javascript beginner, codingscripting, guide, javascript, landing, promises, async, asynchronous, await, callbacks,
requestanimationframe, setinterval, settimeout in this module we take a look at asynchronous javascript, why it is important, and how it can be used to effectively handle potential blocking operations such as fetching resources from a server.
... 50 choosing the right approach beginner, intervals, javascript, learn, optimize, promises, async, asynchronous, await,
requestanimationframe, setinterval, settimeout, timeouts to finish this module off, we'll provide a brief discussion of the different coding techniques and features we've discussed throughout, looking at which one you should use when, with recommendations and reminders of common pitfalls where appropriate.
... 51 cooperative asynchronous javascript: timeouts and intervals animation, beginner, codingscripting, guide, intervals, javascript, loops, asynchronous,
requestanimationframe, setinterval, settimeout, timeouts this tutorial looks at the traditional methods javascript has available for running code asychronously after a set time period has elapsed, or at a regular interval (e.g.
...And 4 more matches
Choosing the right approach - Learn web development
single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no yes (recursive callbacks) yes (nested callbacks) no code example an example that loads a resource via the xmlhttp
request api (run it live, and see the source): function loadasset(url, type, callback) { let xhr = new xmlhttp
request(); xhr.open('get', url); xhr.responsetype = type; xhr.onload = function() { callback(xhr.response); }; xhr.send(); } function displayimage(blob) { let objecturl = url.createobjecturl(blob); let image = document.createelement('img'); image.src = objecturl; docu...
...not as efficient as
requestanimationframe(), but allows you to choose a running rate/frame rate.
...unless you need to choose a specific (slower) framerate, it is generally better to use
requestanimationframe().
...And 4 more matches
Http.jsm
http.jsm http.jsm provides http
request - a wrapper for xmlhttp
request that provides convenient and simplified api for dealing with http
requests.
... http
request supports the following parameters: name meaning headers an array of headers postdata this can be: a string: send it as is an array of parameters: encode as form values null/undefined: no post data.
... submitting post data http
request allows attaching data to the post
requests.
...And 4 more matches
Investigating leaks using DMD heap scan mode
in one debugging session where i was investigating the leak from bug 1451985, i eventually reduced the list of entries until this was the most suspicious looking entry: 0x7f0892f29630 size = 392 bytes at byte offset 56 mozilla::dom::scriptloader::processexternalscript[...] [...] i went to that line of scriptloader::processexternalscript(), and it contained a call to scriptloader::createload
request().
... fortunately, this method mostly just contains two calls to new, one for scriptload
request and one for moduleload
request.
...unfortunately, in this particular case, the unoptimized build was so slow i wasn’t getting any logs.) i then looked through the list of leaked objects generated by xpcom_mem_bloat_log and saw that we were leaking a scriptload
request, so i went and looked at its class definition, where i noticed that scriptload
request had a strong reference to an element that it wasn’t telling the cycle collector about, which seemed suspicious.
...And 4 more matches
An overview of NSS Internals
the usual approach is to create a certificate signing
request (csr) as soon as an application is done with the creation step, which will have created a handle to the key pair, and which can be used for the necessary related operations, like producing a proof-of-ownership of the private key, which is usually required when submitting the public key with a csr to a ca.
...the crmf library, which is used to produce certain kinds of certificate
requests, is available as a library for static linking only.
...an arena is
requested once processing of a task starts, and all memory allocations that are logically associated to that task are
requested from the associated arena.
...And 4 more matches
JS_SetInterruptCallback
syntax jsinterruptcallback js_setinterruptcallback(jsruntime *rt, jsinterruptcallback callback); jsinterruptcallback js_getinterruptcallback(jsruntime *rt); void js_
requestinterruptcallback(jsruntime *rt); name type description rt jsruntime * the runtime.
... provides
request.
... in js_threadsafe builds, the javascript engine calls this callback only from within an active
request on cx.
...And 4 more matches
XML Extras
feature status feature status xmlserializer available xmlhttp
request available domparser (string and stream input source) available web services with soap and wsdl no longer available from gecko 1.9/firefox 3.
... qa and testing there are some online tests for mainly exercising the http get method via xmlhttp
request.
... for xmlhttp
request object you can mostly rely on the microsoft xmlhttp
request documentation, with some caveats: all functions and property names begin with a lower case letter and the object creation is different.
...And 4 more matches
Starting WebLock
the category name also maps nicely onto the notion of a notification "topic." the topic name could be something like "xpcom-startup", for instance, and the name-value pair could contain the contract ids required to create the components
requesting startup.
...the interface callback looks like this: [scriptable, uuid(bbf8cab0-d43a-11d3-8cc2-00609792278c)] interface nsidirectoryserviceprovider: nsisupports { /** * getfile * * directory service calls this when it gets the first
request for * a prop or on every
request if the prop is not persistent.
...subsequent
requests for this prop will * bypass the provider and use the cache.
...And 4 more matches
Mozilla internal string guide
capacity-aware means that the caller is made aware of how the caller-
requested buffer capacity was rounded up to mozjemalloc buckets.
... this is useful when initially
requesting best-case buffer size without yet knowing the true size need.
... if the data that actually needs to be written is larger than the best-case estimate but still fits within the rounded-up capacity, there is no need to reallocate despite
requesting the best-case capacity.
...And 4 more matches
IAccessibleText
the whole text can be
requested by passing the indices zero and ncharacters().
...text returns the
requested text() portion.
...s_false if the
requested boundary type is not implemented, such as ::ia2_text_boundary_sentence, or if there is nothing to return; [out] values are 0s and null respectively.
...And 4 more matches
imgIContainer
nsiframe getrootlayoutframe(); violates the xpcom interface guidelines pruint16 gettype(); violates the xpcom interface guidelines void init(in print32 awidth, in print32 aheight, in imgicontainerobserver aobserver); obsolete since gecko 2.0 void lockimage(); void removeframe(in gfxiimageframe item); obsolete since gecko 1.9.2 void
requestdecode(); void
requestdiscard(); void
requestrefresh([const] in timestamp atime); violates the xpcom interface guidelines void resetanimation(); void restoredatadone(); native code only!
...you can only be guaranteed that querying this will not throw if status_decode_complete is set on the imgi
request.
...exceptions thrown missing exception missing description removeframe() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) void removeframe( in gfxiimageframe item ); parameters item missing description exceptions thrown missing exception missing description
requestdecode() void
requestdecode(); parameters none.
...And 4 more matches
imgILoader
inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by @mozilla.org/image/loader;1 as a service: var imgiloader = components.classes["@mozilla.org/image/loader;1"] .getservice(components.interfaces.imgiloader); method overview imgi
request loadimage(in nsiuri auri, in nsiuri ainitialdocumenturl, in nsiuri areferreruri, in nsiprincipal aloadingprincipal, in nsiloadgroup aloadgroup, in imgidecoderobserver aobserver, in nsisupports acx, in nsloadflags aloadflags, in nsisupports cachekey, in imgi
request a
request, in nsichannelpolicy channelpolicy); imgi
request loadimagewithchannel(in nsichannel achannel, in imgidecoderobserver aobser...
...imgi
request loadimage( in nsiuri auri, in nsiuri ainitialdocumenturl, in nsiuri areferreruri, in nsiprincipal aloadingprincipal, in nsiloadgroup aloadgroup, in imgidecoderobserver aobserver, in nsisupports acx, in nsloadflags aloadflags, in nsisupports cachekey, in imgi
request a
request, in nsichannelpolicy channelpolicy ); parameters auri the uri to load.
...aloadflags load flags for the
request.
...And 4 more matches
nsICache
access_read 1 access
requested - i only want to read, if there isn't an entry just fail.
... access_write 2 access
requested - i have something new i want to write into the cache, make me a new entry and doom the old one, if any.
... access_read_write 3 access
requested - i want to read, but i'm willing to update an existing entry if necessary, or create a new one if none exists.
...And 4 more matches
nsIContentSecurityPolicy
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean permitsancestry(in nsidocshell docshell); void refinepolicy(in astring policystring, in nsiuri selfuri); void scan
requestdata(in nsihttpchannel achannel); void sendreports(in astring blockeduri, in astring violateddirective); short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri a
requestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri a
requestorigin, in ns...
...void refinepolicy( in astring policystring, in nsiuri selfuri ); parameters policystring selfuri scan
requestdata() called after the content security policy object is created to fill in the appropriate
request and
request header information needed in case a report needs to be sent.
... void scan
requestdata( in nsihttpchannel achannel ); parameters achannel sendreports() manually triggers violation report sending given a uri and reason.
...And 4 more matches
nsIDebug
method overview void abort(in string afile, in long aline); void assertion(in string astr, in string aexpr, in string afile, in long aline); void break(in string afile, in long aline); void warning(in string astr, in string afile, in long aline); methods abort()
requests the process to trigger a fatal abort.
... void abort( in string afile, in long aline ); parameters afile file containing abort
request.
... aline line number of abort
request.
...And 4 more matches
nsIDocShell
g documenturi); void historypurged(in long numentries); void internalload(in nsiuri auri, in nsiuri areferrer, in nsisupports aowner, in pruint32 aflags, in wstring awindowtarget, in string atypehint, in nsiinputstream apostdatastream, in nsiinputstream aheadersstream, in unsigned long aloadflags, in nsishentry ashentry, in boolean firstparty, out nsidocshell adocshell, out nsi
request a
request); native code only!
...all values from here upward are confident enough to be used for xmlhttp
request.
...void internalload( in nsiuri auri, in nsiuri areferrer, in nsisupports aowner, in pruint32 aflags, in wstring awindowtarget, in string atypehint, in nsiinputstream apostdatastream, in nsiinputstream aheadersstream, in unsigned long aloadflags, in nsishentry ashentry, in boolean firstparty, out nsidocshell adocshell, out nsi
request a
request ); parameters auri the uri to load.
...And 4 more matches
nsIHttpChannelInternal
66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void get
requestversion(out unsigned long major, out unsigned long minor); void getresponseversion(out unsigned long major, out unsigned long minor); void httpupgrade(in acstring aprotocolname, in nsihttpupgradelistener alistener); void setcookie(in string acookieheader); void setupfallbackchannel(in string afallbackkey); attributes attribute type description canceled boolean returns true if and only if the ...
... methods get
requestversion() gets the
request's major and minor version numbers.
... void get
requestversion( out unsigned long major, out unsigned long minor ); parameters major on return, contains the
request's major version number.
...And 4 more matches
nsIStreamListener
inherits from: nsi
requestobserver last changed in gecko 1.0 classes which want to consume data from a nsichannel need to implement this interface.
... nsi
requestobserver contains two methods.
... so, in all the three methods - ondataavailable(), nsi
requestobserver.onstart
request() and nsi
requestobserver.onstop
request() have to be implemented.
...And 4 more matches
nsIWebBrowserPersist
the object that the embbedder supplies may also implement nsiinterface
requestor and be prepared to return nsiauthprompt or other interfaces that may be required to download data.
... areferrer the referrer uri to pass with an http
request or nsnull.
... areferrerpolicy the referrer policy to use for the
request, taken from nsihttpchannel.
...And 4 more matches
Console messages - Firefox Developer Tools
network
requests are logged with a line that looks like this: time the time the message was recorded.
... method the specific http
request method.
... if the
request was made as an xmlhttp
request, there's an additional "xhr" tag indicating this.
...And 4 more matches
AbortController - Web APIs
the abortcontroller interface represents a controller object that allows you to abort one or more web
requests as and when desired.
...communicating with a dom
request is done using an abortsignal object.
... properties abortcontroller.signal read only returns a abortsignal object instance, which can be used to communicate with/abort a dom
request.
...And 4 more matches
BasicCardResponse.billingAddress - Web APIs
example let's look at a sample payment
request: var
request = new payment
request(supportedinstruments, details, options); // call show() to trigger the browser's payment flow.
...
request.show().then(function(instrumentresponse) { // do something with the response from the ui.
... console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from
request.show().
...And 4 more matches
BasicCardResponse.cardNumber - Web APIs
example let's look at a sample payment
request: var
request = new payment
request(supportedinstruments, details, options); // call show() to trigger the browser's payment flow.
...
request.show().then(function(instrumentresponse) { // do something with the response from the ui.
... console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from
request.show().
...And 4 more matches
BasicCardResponse.cardSecurityCode - Web APIs
example let's look at a sample payment
request: var
request = new payment
request(supportedinstruments, details, options); // call show() to trigger the browser's payment flow.
...
request.show().then(function(instrumentresponse) { // do something with the response from the ui.
... console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from
request.show().
...And 4 more matches
BasicCardResponse.cardholderName - Web APIs
example let's look at a sample payment
request: var
request = new payment
request(supportedinstruments, details, options); // call show() to trigger the browser's payment flow.
...
request.show().then(function(instrumentresponse) { // do something with the response from the ui.
... console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from
request.show().
...And 4 more matches
BasicCardResponse.expiryMonth - Web APIs
example let's look at a sample payment
request: var
request = new payment
request(supportedinstruments, details, options); // call show() to trigger the browser's payment flow.
...
request.show().then(function(instrumentresponse) { // do something with the response from the ui.
... console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from
request.show().
...And 4 more matches
BasicCardResponse.expiryYear - Web APIs
example let's look at a sample payment
request: var
request = new payment
request(supportedinstruments, details, options); // call show() to trigger the browser's payment flow.
...
request.show().then(function(instrumentresponse) { // do something with the response from the ui.
... console.log(instrumentresponse.details); }) .catch(function(err) { // do something with the error from
request.show().
...And 4 more matches
Document.cookie - Web APIs
;samesite samesite prevents the browser from sending this cookie along with cross-site
requests.
... the lax value value will send the cookie for all same-site
requests and top-level navigation get
requests.
...the cookie will be sent in all
requests—both cross-site and same-site.
...And 4 more matches
Fetch basic concepts - Web APIs
it will seem familiar to anyone who has used xmlhttp
request, but it provides a more powerful and flexible feature set.
... in a nutshell at the heart of fetch are the interface abstractions of http
requests, responses, headers, and body payloads, along with a global fetch method for initiating asynchronous resource
requests.
... fetch takes the asynchronous nature of such
requests one step further.
...And 4 more matches
IDBIndex.get() - Web APIs
the get() method of the idbindex interface returns an idb
request object, and, in a separate thread, finds either the value in the referenced object store that corresponds to the given key or the first corresponding value, if key is set to an idbkeyrange.
... if a value is found, then a structured clone of it is created and set as the result of the
request object: this returns the record the key is associated with.
... syntax var
request = myindex.get(key); parameters key optional a key or idbkeyrange that identifies the record to be retrieved.
...And 4 more matches
IDBIndex.getKey() - Web APIs
the getkey() method of the idbindex interface returns an idb
request object, and, in a separate thread, finds either the primary key that corresponds to the given key in this index or the first corresponding primary key, if key is set to an idbkeyrange.
... if a primary key is found, it is set as the result of the
request object.
... syntax var
request = myindex.getkey(key); parameters key optional a key or idbkeyrange that identifies a record to be retrieved.
...And 4 more matches
IDBObjectStore.createIndex() - Web APIs
from inside a idbopendb
request.onupgradeneeded handler.
...has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) example in the following example you can see the idbopendb
request.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded.
... for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); // two event handlers for opening the database.
...And 4 more matches
IDBTransaction.objectStore() - Web APIs
syntax idbtransaction.objectstore(name); parameters name the name of the
requested object store.
... exceptions this method may raise a domexception of one of the following types: exception description notfounderror the
requested object store is not in this transaction's scope.
... invalidstateerror the
request was made on a source object that has been deleted or removed, or if the transaction has finished.
...And 4 more matches
PaymentAddress - Web APIs
the paymentaddress interface of the payment
request api is used to store shipping or payment address information.
... examples in the following example, the payment
request() constructor is used to create a new payment
request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options.
... the first of these three (supportedinstruments in the example below) contains a data property that has to conform to the structure defined by the basiccard
request dictionary.
...And 4 more matches
Using the Resource Timing API - Web APIs
an application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource such as an xmlhttp
request, <svg>, image, script, etc.).
...pull
requests and bug reports are welcome.
...this example also calculates the time from the start of the fetch and
request start phases (fetchstart and
requeststart, respectively), until the response has ended (responseend).
...And 4 more matches
Screen Wake Lock API - Web APIs
you acquire a wakelocksentinel object by calling the navigator.wakelock.
request() promise based method that resolves if the platform allows it.
... a
request may be rejected for a number of reasons, including system settings (such as power save mode or low battery level) or if the document is not active or visible.
...get an instance of the object by calling wakelock.
request.
...And 4 more matches
Geometry and reference spaces in WebXR - Web APIs
instead, the webxr device api is designed to have developers plan their users' experiences and
request an appropriate reference space that best represents those needs.
... the reference space returned by xrsession.
requestreferencespace() is either xrreferencespace or xrboundedreferencespace.
...it is not only always available when using an immersive session mode (immersive-vr or immersive-ar), but is always included among the optional features when
requesting a new session; thus, every session created by navigator.xr.
requestsession() supports the local reference space type.
...And 4 more matches
Window.open() - Web APIs
examples var windowobjectreference; var windowfeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes"; function open
requestedpopup() { windowobjectreference = window.open("http://www.cnn.com/", "cnn_windowname", windowfeatures); } var windowobjectreference; function open
requestedpopup() { windowobjectreference = window.open( "http://www.domainname.ext/path/imagefile.png", "descriptivewindowname", "resizable,scrollbars,status" ); } if a window with the name already exists, then url is loaded into t...
... window features windowfeatures is an optional string containing a comma-separated list of
requested features of the new window.
... noreferrer if this feature is set, the
request to load the content located at the specified url will be loaded with the
request's referrer set to noreferrer; this prevents the
request from sending the url of the page that initiated the
request to the server where the
request is sent.
...And 4 more matches
Content negotiation - HTTP
when a client wants to obtain a resource, the client
requests it using its url.
...though strictly speaking user-agent is not in this list, it is sometimes also used to send a specific representation of the
requested resource, though this is not considered as a good practice.
... the user-agent header identifies the browser sending the
request.
...And 4 more matches
Cross-Origin Resource Policy (CORP) - HTTP
cross-origin resource policy is a policy set by the cross-origin-resource-policy http header that lets web sites and applications opt in to protection against certain
requests from other origins (such as those issued with elements like <script> and <img>), to mitigate speculative side-channel attacks, like spectre, as well as cross-site script inclusion attacks.
... the policy is only effective for no-cors
requests, which are issued by default for cors-safelisted methods/headers.
... as this policy is expressed via a response header, the actual
request is not prevented—rather, the browser prevents the result from being leaked by stripping the response body.
...And 4 more matches
Access-Control-Allow-Credentials - HTTP
the access-control-allow-credentials response header tells browsers whether to expose the response to frontend javascript code when the
request's credentials mode (
request.credentials) is include.
... when a
request's credentials mode (
request.credentials) is include, browsers will only expose the response to frontend javascript code if the access-control-allow-credentials value is true.
... when used as part of a response to a preflight
request, this indicates whether or not the actual
request can be made using credentials.
...And 4 more matches
Feature-Policy - HTTP
autoplay controls whether the current document is allowed to autoplay media
requested through the htmlmediaelement interface.
...when this policy is disabled, the promise returned by navigator.
requestmediakeysystemaccess() will reject with a domexception.
... fullscreen controls whether the current document is allowed to use element.
requestfullscreen().
...And 4 more matches
Forwarded - HTTP
the forwarded header contains information from the reverse proxy servers that is altered or lost when a proxy is involved in the path of the
request.
... header type
request header forbidden header name no syntax forwarded: by=<identifier>;for=<identifier>;host=<host>;proto=<http|https> directives <identifier> an identifier disclosing the information that is altered or lost when using a proxy.
... this can be either: an ip address (v4 or v6, optionally with a port, and ipv6 quoted and enclosed in square brackets), an obfuscated identifier (such as "_hidden" or "_secret"), or "unknown" when the preceding entity is not known (and you still want to indicate that forwarding of the
request was made).
...And 4 more matches
Referrer-Policy - HTTP
the referrer-policy http header controls how much referrer information (sent via the referer header) should be included with
requests.
...no referrer information is sent along with
requests.
... origin-when-cross-origin send the origin, path, and query string when performing a same-origin
request, but only send the origin of the document for other cases.
...And 4 more matches
OPTIONS - HTTP
the http options method
requests permitted communication options for a given url or server.
...
request has body no successful response has body yes safe yes idempotent yes cacheable no allowed in html forms no syntax options /index.html http/1.1 options * http/1.1 examples identifying allowed
request methods to find out which
request methods a server supports, one can use the curl command-line program to issue an options
request: curl -x options https://example.org -i the response then contains an allow header that holds the allowed methods: http/1.1 204 no content allow: options, get, head, post cache-control: max-age=604800 date: thu, 13 oct 2016 11:45:00 gmt server: eos (lax004/2813) preflighted
requests...
... in cors in cors, a preflight
request is sent with the options method so that the server can respond if it is acceptable to send the
request.
...And 4 more matches
Performance fundamentals - Web Performance
another problem that can delay startup is idle time, caused by waiting for responses to
requests (like database loads).
... to avoid this problem, applications should issue
requests as early as possible in startup (this is called "front-loading").
...network
requests should never be on the critical path to early application startup.
...And 4 more matches
platform/xpcom - Archive of obsolete content
users of xpcom can use this value to retrieve the factory from components.classes: var factory = components.classes['@me.org/
request'] var component = factory.createinstance(ci.nsi
request); this parameter is formally optional, but if you don't specify it, users won't be able to retrieve your factory using a contract id.
...users of xpcom can use this value to retrieve the factory using components.classesbyid: var factory = components.classesbyid[id]; var component = factory.createinstance(ci.nsi
request); this parameter is optional.
...for example, this subclass implements the nsi
request interface: var { class } = require('sdk/core/heritage'); var { unknown } = require('sdk/platform/xpcom'); var
request = class({ extends: unknown, interfaces: [ 'nsi
request' ], initialize: function initialize() { this.pending = false; }, ispending: function() { return this.pending; }, resume: function() { console.log('resuming...'); }, suspend: function() { console.log('suspend...
...And 3 more matches
Finding window handles - Archive of obsolete content
var basewindow = window.queryinterface(components.interfaces.nsiinterface
requestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .treeowner .queryinterface(components.interfaces.nsiinterface
requestor) .getinterface(components.interfaces.nsibasewindow); then in c++ part, a function take nsib...
...r what desktop/window manager) is in use, for explanation why see the article: standard os libraries - unix section) windows components.utils.import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new error('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterface
requestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterface
requestor) .getinterface(ci.nsibasewindow); var hwndstring = basewindow.nativehandle; components.utils.import('resource://gre/m...
...z_setforegroundwindow:', rez_setforegroundwindow, rez_setforegroundwindow.tostring()); user32.close(); mac os x objective-c components.utils.import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new error('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterface
requestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterface
requestor) .getinterface(ci.nsibasewindow); var nswindowstring = basewindow.nativehandle; components.utils.import('resource://g...
...And 3 more matches
Communication between HTML and your extension - Archive of obsolete content
i set the onblur action to a little javascript function that performed a standard ajax
request to get a result.
...the result of the ajax
request was the something that i wanted the extension to find.
...some of the events only apply to certain types of elements so i included trying to modify the result of the ajax
request to be of the appropriate element type (img, which supports "onload," rather than span, which doesn't, for example).
...And 3 more matches
jspage - Archive of obsolete content
efined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].tolowercase()},features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.queryselector)},plugins:{},engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getelementsbyclassname)?950:925)); },trident:function(){return(!window.activexobject)?false:((window.xmlhttp
request)?((document.queryselectorall)?6:5):4);},webkit:function(){return(navigator.taintenabled)?false:((browser.features.xpath)?((browser.features.query)?525:420):419); },gecko:function(){return(!document.getboxobjectfor&&window.mozinnerscreenx==null)?false:((document.getelementsbyclassname)?19:18);}}},browser||{});browser.platform[browser.platform.name]=true; browser.detect=function(){for(var b in this...
....engines){var a=this.engines[b]();if(a){this.engine={name:b,version:a};this.engine[b]=this.engine[b+a]=true; break;}}return{name:b,version:a};};browser.detect();browser.
request=function(){return $try(function(){return new xmlhttp
request();},function(){return new activexobject("msxml2.xmlhttp"); },function(){return new activexobject("microsoft.xmlhttp");});};browser.features.xhr=!!(browser.
request());browser.plugins.flash=(function(){var a=($try(function(){return navigator.plugins["shockwave flash"].description; },function(){return new activexobject("shockwaveflash.shockwaveflash").getvariable("$version");})||"0 r0").match(/\d+/g);return{version:parseint(a[0]||0+"."+a[1],10)||0,build:parseint(a[2],10)||0}; })();function $exec(b){if(!b){return b;}if(window.execscript){window.execscript(b);}else{var...
...){a=a[0]||1.618;return math.pow(b,2)*((a+1)*b-a);},bounce:function(f){var e;for(var d=0,c=1;1;d+=c,c/=2){if(f>=(7-4*d)/11){e=c*c-math.pow((11-6*d-11*f)/4,2); break;}}return e;},elastic:function(b,a){return math.pow(2,10*--b)*math.cos(20*b*math.pi*(a[0]||1)/3);}});["quad","cubic","quart","quint"].each(function(b,a){fx.transitions[b]=new fx.transition(function(c){return math.pow(c,[a+2]); });});var
request=new class({implements:[chain,events,options],options:{url:"",data:"",headers:{"x-
requested-with":"xmlhttp
request",accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",issuccess:null,emulation:true,urlencoded:true,encoding:"utf-8",evalscripts:false,evalresponse:false,nocache:false},initialize:function(a){this.xhr=new browser.reque...
...And 3 more matches
Introduction to SSL - Archive of obsolete content
the details of the protocol are available in
request for comments (rfc): 2246,the tls protocol version 1.0.
...the server also sends its own certificate and, if the client is
requesting a server resource that requires client authentication,
requests the client's certificate.
... if the server has
requested client authentication (an optional step in the handshake), the client also signs another piece of data that is unique to this handshake and known by both the client and server.
...And 3 more matches
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
e; } var j; var xincludeparent = xinclude.parentnode; try { netscape.security.privilegemanager.enableprivilege('universalxpconnect universalbrowserread'); // necessary with file:///-located files trying to reach external sites if (href !== null) { var response, responsetype; var
request = new xmlhttp
request();
request.open('get', href, false);
request.set
requestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt');
request.set
requestheader('cache-control', 'no-cache'); if (accept) {
request.set
requestheader('accept', accept); } if ...
...(acceptlanguage) {
request.set
requestheader('accept-language', acceptlanguage); } switch (parse) { case 'text': // priority should be on media type: var contenttype =
request.getresponseheader('content-type'); //text/xml; charset="utf-8" // send to get headers first?
... // let the
request be processed below } else { if (encoding === '' || encoding === null) { // encoding has no effect on xml encoding = 'utf-8'; }
request.overridemimetype('text/plain; charset='+encoding); //'x-user-defined' ...
...And 3 more matches
Introduction to web APIs - Learn web development
apis that make this possible include xmlhttp
request and the fetch api.
...such apis are often combined with apis for creating animation loops (such as window.
requestanimationframe()) and others to make constantly updating scenes like cartoons and games.
... to provide another example, instances of the xmlhttp
request object (each one represents an http
request to the server to retrieve a new resource of some kind) has a number of events available on them, for example, the load event is fired when a response has been successfully returned containing the
requested resource, and it is now available.
...And 3 more matches
Error codes returned by Mozilla APIs
ns_error_dom_hierarchy_
request_err (0x80530003) a node was inserted into a location where it cannot go.
... ns_binding_failed (0x804b0001) ns_binding_aborted (0x804b0002) the asynchronous
request failed because it was aborted by some user action.
... ns_binding_redirected (0x804b0003) the asynchronous
request has been "redirected" to a different async
request.
...And 3 more matches
Using the Browser API
the search bar also contains buttons, as well as a form to type search
requests into.
...we did this with the following functions: function canmovebwd() { var
request = browser.getcangoback();
request.onsuccess = function() { if (
request.result) { back.disabled = false; console.log("it's possible to navigate the history backward."); } else { back.disabled = true; console.log("it's not possible to navigate the history backward."); } } } function canmovefwd() { var
request = browser.getcangoforward();
request.onsucc...
...ess = function() { if (
request.result) { fwd.disabled = false; console.log("it's possible to navigate the history forward."); } else { fwd.disabled = true; console.log("it's not possible to navigate the history forward."); } } } so here we have functions to detect whether we can navigate forwards/backwards in the history at any point.
...And 3 more matches
HTML parser threading
due to legacy interface design oddities, an nshtml5parser is initialized by calling nshtml5parser::parse(nsiuri*, nsi
requestobserver*, void*, nsdtdmode).
...the nsistreamlistener methods (onstart
request, ondataavailable and onstop
request) are called on the main thread.
... onstart
request does all sorts of initialization on the main thread.
...And 3 more matches
Interfacing with the Add-on Repository
starting a
request to start a search of the repository, you can use either of the following methods: searchaddons() queries the add-on repository for add-ons matching given search criteria.
... when the user clicks a toolbar button to initiate the query, the following code gets run to start the
request: addonrepository.retrieverecommendedaddons(10, this); this asks the repository to fetch up to 10 add-ons, using the object this as the target for callbacks.
... handling failed
requests the callback object must have a searchfailed() method; this gets called when a repository search fails to execute.
...And 3 more matches
PR_ClearInterrupt
clears the interrupt
request for the calling thread.
... syntax #include <prthread.h> void pr_clearinterrupt(void); description interrupting is a cooperative process, so it's possible that the thread passed to pr_interrupt may never respond to the interrupt
request.
... for example, the target thread may reach the agreed-on control point without providing an opportunity for the runtime to notify the thread of the interrupt
request.
...And 3 more matches
Certificate functions
validitytimes mxr 3.11 and later cert_completecrldecodeentries mxr 3.6 and later cert_convertanddecodecertificate mxr 3.9.3 and later cert_copyname mxr 3.4 and later cert_copyrdn mxr 3.5 and later cert_createava mxr 3.2.1 and later cert_createcertificate mxr 3.5 and later cert_createcertificate
request mxr 3.2 and later cert_createname mxr 3.2.1 and later cert_createocspcertid mxr 3.6 and later cert_createocsp
request mxr 3.6 and later cert_createrdn mxr 3.2.1 and later cert_createsubjectcertlist mxr 3.4 and later cert_createvalidity mxr 3.5 and later cert_crlcacherefreshissuer mxr 3.7 ...
....4 and later cert_decodeusernotice mxr 3.2 and later cert_dernametoascii mxr 3.4 and later cert_destroycertarray mxr 3.2 and later cert_destroycertificate mxr 3.2 and later cert_destroycertificatelist mxr 3.2 and later cert_destroycertificatepoliciesextension mxr 3.2 and later cert_destroycertificate
request mxr 3.2 and later cert_destroycertlist mxr 3.2 and later cert_destroyname mxr 3.2 and later cert_destroyocspcertid mxr 3.6 and later cert_destroyocsp
request mxr 3.6 and later cert_destroyocspresponse mxr 3.7 and later cert_destroyoidsequence mxr 3.9 and later cert_destroyusernotice mxr 3...
... cert_encodecertpoliciesextension mxr 3.12 and later cert_encodecrldistributionpoints mxr 3.5 and later cert_encodegeneralname mxr 3.4 and later cert_encodeinfoaccessextension mxr 3.12 and later cert_encodeinhibitanyextension mxr 3.12 and later cert_encodenoticereference mxr 3.12 and later cert_encodeocsp
request mxr 3.6 and later cert_encodepolicyconstraintsextension mxr 3.12 and later cert_encodepolicymappingextension mxr 3.12 and later cert_encodesubjectkeyid mxr 3.12 and later cert_encodeusernotice mxr 3.12 and later cert_extractpublickey mxr 3.2 and later cert_findcertbyname mxr 3.2 and later cert...
...And 3 more matches
NSS functions
validitytimes mxr 3.11 and later cert_completecrldecodeentries mxr 3.6 and later cert_convertanddecodecertificate mxr 3.9.3 and later cert_copyname mxr 3.4 and later cert_copyrdn mxr 3.5 and later cert_createava mxr 3.2.1 and later cert_createcertificate mxr 3.5 and later cert_createcertificate
request mxr 3.2 and later cert_createname mxr 3.2.1 and later cert_createocspcertid mxr 3.6 and later cert_createocsp
request mxr 3.6 and later cert_createrdn mxr 3.2.1 and later cert_createsubjectcertlist mxr 3.4 and later cert_createvalidity mxr 3.5 and later cert_crlcacherefreshissuer mxr 3.7 ...
....4 and later cert_decodeusernotice mxr 3.2 and later cert_dernametoascii mxr 3.4 and later cert_destroycertarray mxr 3.2 and later cert_destroycertificate mxr 3.2 and later cert_destroycertificatelist mxr 3.2 and later cert_destroycertificatepoliciesextension mxr 3.2 and later cert_destroycertificate
request mxr 3.2 and later cert_destroycertlist mxr 3.2 and later cert_destroyname mxr 3.2 and later cert_destroyocspcertid mxr 3.6 and later cert_destroyocsp
request mxr 3.6 and later cert_destroyocspresponse mxr 3.7 and later cert_destroyoidsequence mxr 3.9 and later cert_destroyusernotice mxr 3...
... cert_encodecertpoliciesextension mxr 3.12 and later cert_encodecrldistributionpoints mxr 3.5 and later cert_encodegeneralname mxr 3.4 and later cert_encodeinfoaccessextension mxr 3.12 and later cert_encodeinhibitanyextension mxr 3.12 and later cert_encodenoticereference mxr 3.12 and later cert_encodeocsp
request mxr 3.6 and later cert_encodepolicyconstraintsextension mxr 3.12 and later cert_encodepolicymappingextension mxr 3.12 and later cert_encodesubjectkeyid mxr 3.12 and later cert_encodeusernotice mxr 3.12 and later cert_extractpublickey mxr 3.2 and later cert_findcertbyname mxr 3.2 and later cert...
...And 3 more matches
SpiderMonkey Internals: Thread Safety
the program must group jsapi calls into "
requests": js_setcontextthread(cx); js_begin
request(cx); /* ...
...*/ js_end
request(cx); js_clearcontextthread(cx); it isn't a bottleneck; multiple threads are allowed to be in
requests on the same jsruntime at once.
... see js_begin
request.
...And 3 more matches
nsIContentSniffer
method overview acstring getmimetypefromcontent(in nsi
request a
request, [const,array,size_is(alength)] in octet adata, in unsigned long alength); methods getmimetypefromcontent() given a chunk of data, determines a mime type.
... information from the given
request may be used in order to make a better decision.
... note: implementations should consider the
request read-only.
...And 3 more matches
nsIResumableChannel
available after onstart
request.
...the
request given to the nsistreamlistener will be qiable to nsiresumableinfo.
...the
request will not start until asyncopen or open is called.
...And 3 more matches
nsITextInputProcessorNotification
dom/interfaces/base/nsitextinputprocessorcallback.idlscriptable this interface of a
request or notification to ime 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) this interface tells details of a
request or notification to ime.
... attributes attribute type description type acstring the type of
request or notification to ime.
... types "
request-to-commit" this is required to be handled.
...And 3 more matches
XPCOM Interface Reference
ibleeditabletextiaccessiblehyperlinkiaccessiblehypertextiaccessibleimageiaccessiblerelationiaccessibletableiaccessibletable2iaccessibletablecelliaccessibletextiaccessiblevalueidispatchijsdebuggeramiinstallcallbackamiinstalltriggeramiwebinstallinfoamiwebinstalllisteneramiwebinstallpromptamiwebinstallerimgicacheimgicontainerimgicontainerobserverimgidecoderimgidecoderobserverimgiencoderimgiloaderimgi
requestinidomutilsjsdistackframemoziasyncfaviconsmoziasynchistorymozicoloranalyzermozijssubscriptloadermozipersonaldictionarymoziplaceinfomoziplacesautocompletemoziregistrymozirepresentativecolorcallbackmozispellcheckingenginemozistorageaggregatefunctionmozistorageasyncstatementmozistoragebindingparamsmozistoragebindingparamsarraymozistoragecompletioncallbackmozistorageconnectionmozistorageerrormozistora...
...viewernsicontrollernsicontrollersnsiconverterinputstreamnsiconverteroutputstreamnsicookiensicookie2nsicookieacceptdialognsicookieconsentnsicookiemanagernsicookiemanager2nsicookiepermissionnsicookiepromptservicensicookieservicensicookiestoragensicrashreporternsicryptohmacnsicryptohashnsicurrentcharsetlistenernsicyclecollectorlistenernsidbchangelistenernsidbfolderinfonsidnslistenernsidnsrecordnsidns
requestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsidomdesktopnotificationcenternsidomelementnsidomeventnsidomeventgroupnsidomeventlistenernsidomeventtargetnsidomfilensidomfileerrornsidomfileexceptionnsidomfilelistnsidomfilereadernsidomfontfacensidomfontfacelistnsidomgeogeolocationnsidomgeopositionnsidomgeopositionaddressnsidomgeopositioncallbac...
...sihtmleditornsihttpheaderlistenernsihapticfeedbacknsihttpactivitydistributornsihttpactivityobservernsihttpchannelnsihttpchannelinternalnsihttpheadervisitornsihttpservernsihttpupgradelistenernsiidnservicensiiframeboxobjectnsiiniparsernsiiniparserfactorynsiiniparserwriternsiioservicensiidleservicensiinprocesscontentframemessagemanagernsiinputstreamnsiinputstreamcallbacknsiinstalllocationnsiinterface
requestornsijscidnsijsidnsijsiidnsijsonnsijetpacknsijetpackservicensijumplistbuildernsijumplistitemnsilivemarkservicensiloadgroupnsilocalfilensilocalfilemacnsilocalensilocaleservicensilogininfonsiloginmanagernsiloginmanagercryptonsiloginmanageriemigrationhelpernsiloginmanagerprompternsiloginmanagerstoragensiloginmetainfonsimimeinputstreamnsimacdocksupportnsimarkupdocumentviewernsimemorynsimemorymultirepo...
...And 3 more matches
Memory - Plugins
npn_memfree
requests that the browser free a specified block of memory.
... npn_memflush
requests the browser to free up a specified amount of memory if not enough is currently available for the plug-in's requirements.
...the browser may be able to deallocate nonessential memory structures in response to a
request.
...And 3 more matches
Index - Firefox Developer Tools
46 network monitor debugging, dev tools, firefox, guide, networking, tools, l10n:priority the network monitor shows you all the network
requests firefox makes (for example, when it loads a page, or due to xmlhttp
requests), how long each
request takes, and details of each
request.
... 50 network
request details 110n:priority, debugging, dev tools, firefox, guide, networking, tools the
request details pane appears when you click on a network
request in the
request list.
... this pane provides more detailed information about the
request.
...And 3 more matches
Cache.keys() - Web APIs
the
requests are returned in the same order that they were inserted.
... note:
requests with duplicate urls but different headers can be returned if their responses have the vary header set on them.
... syntax cache.keys(
request, {options}).then(function(keys) { // do something with your array of
requests }); parameters
request optional the
request want to return, if a specific key is desired.
...And 3 more matches
CacheStorage - Web APIs
use cachestorage.match() to check if a given
request is a key in any of the cache objects that the cachestorage object tracks.
... methods cachestorage.match() checks if a given
request is a key in any of the cache objects that the cachestorage object tracks, and returns a promise that resolves to that match.
...we construct a custom response like so: check whether a match for the
request is found in the cachestorage.
...And 3 more matches
Advanced animations - Web APIs
again, window.
requestanimationframe() helps us to control the animation.
...ll = { x: 100, y: 100, vx: 5, vy: 2, radius: 25, color: 'blue', draw: function() { ctx.beginpath(); ctx.arc(this.x, this.y, this.radius, 0, math.pi * 2, true); ctx.closepath(); ctx.fillstyle = this.color; ctx.fill(); } }; function draw() { ctx.clearrect(0,0, canvas.width, canvas.height); ball.draw(); ball.x += ball.vx; ball.y += ball.vy; raf = window.
requestanimationframe(draw); } canvas.addeventlistener('mouseover', function(e) { raf = window.
requestanimationframe(draw); }); canvas.addeventlistener('mouseout', function(e) { window.cancelanimationframe(raf); }); ball.draw(); boundaries without any boundary collision testing our ball runs out of the canvas quickly.
...; ctx.fillstyle = this.color; ctx.fill(); } }; function draw() { ctx.clearrect(0,0, canvas.width, canvas.height); ball.draw(); ball.x += ball.vx; ball.y += ball.vy; if (ball.y + ball.vy > canvas.height || ball.y + ball.vy < 0) { ball.vy = -ball.vy; } if (ball.x + ball.vx > canvas.width || ball.x + ball.vx < 0) { ball.vx = -ball.vx; } raf = window.
requestanimationframe(draw); } canvas.addeventlistener('mouseover', function(e) { raf = window.
requestanimationframe(draw); }); canvas.addeventlistener('mouseout', function(e) { window.cancelanimationframe(raf); }); ball.draw(); acceleration to make the motion more real, you can play with the velocity like this, for example: ball.vy *= .99; ball.vy += .25; this slows down the vertical veloc...
...And 3 more matches
Introduction to the File and Directory Entries API - Web APIs
the file and directory entries api can use different storage types an application can
request temporary or persistent storage.
...you send
requests for operations to happen, and get notified by callbacks.
...the asynchronous api has the following global methods:
requestfilesystem() and resolvelocalfilesystemurl().
...And 3 more matches
HTMLIFrameElement.referrerPolicy - Web APIs
no referrer information is sent along with
requests.
... origin-when-cross-origin send a full url when performing a same-origin
request, but only send the origin of the document for other cases.
... same-origin a referrer will be sent for same-site origins, but cross-origin
requests will contain no referrer information.
...And 3 more matches
HTMLScriptElement.referrerPolicy - Web APIs
no referrer information is sent along with
requests.
... origin-when-cross-origin send a full url when performing a same-origin
request, but only send the origin of the document for other cases.
... same-origin a referrer will be sent for same-site origins, but cross-origin
requests will contain no referrer information.
...And 3 more matches
Ajax navigation example - Web APIs
second example</a> | <a class="ajax-nav" href="third_page.php">third example</a> | <a class="ajax-nav" href="unexisting.php">unexisting page</a> ] </p> include/header.php: <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="js/ajax_nav.js"></script> <link rel="stylesheet" href="css/style.css" /> js/ajax_nav.js: "use strict"; const ajax
request = new (function () { function closereq () { oloadingbox.parentnode && document.body.removechild(oloadingbox); bisloading = false; } function abortreq () { if (!bisloading) { return; } oreq.abort(); closereq(); } function ajaxerror () { alert("unknown error."); } function ajaxload () { var vmsg, nstatus = this.
..."&" + sviewkey + "=" + sviewmode : "").slice(1)).replace(rendqstmark, ""); } function getpage (spage) { if (bisloading) { return; } oreq = new xmlhttp
request(); bisloading = true; oreq.onload = ajaxload; oreq.onerror = ajaxerror; if (spage) { opageinfo.url = filterurl(spage, null); } oreq.open("get", filterurl(opageinfo.url, "json"), true); oreq.send(); oloadingbox.parentnode || document.body.appendchild(oloadingbox); } function
requestpage (surl) { if (history.pushstate) { ...
... bupdateurl = true; getpage(surl); } else { /* ajax navigation is not supported */ location.assign(surl); } } function processlink () { if (this.classname === sajaxclass) {
requestpage(this.href); return false; } return true; } function init () { opageinfo.title = document.title; history.replacestate(opageinfo, opageinfo.title, opageinfo.url); for (var olink, nidx = 0, nlen = document.links.length; nidx < nlen; document.links[nidx++].onclick = processlink); } const /* customizable constants */ stargetid = "ajax-content", sviewkey = "view_as", sajaxclass = "ajax-nav", /* not customizable constants */ rsearch =...
...And 3 more matches
IDBCursor.update() - Web APIs
the update() method of the idbcursor interface returns an idb
request object, and, in a separate thread, updates the value at the current position of the cursor in the object store.
... syntax var anidb
request = myidbcursor.update(value); parameters value the new value to be stored at the current position.
... return value an idb
request object on which subsequent events related to this operation are fired.
...And 3 more matches
IDBFactory - Web APIs
methods idbfactory.open the current method to
request opening a connection to a database.
... idbfactory.deletedatabase a method to
request the deletion of a database.
... example in the following code snippet, we make a
request to open a database, and include handlers for the success and error cases.
...And 3 more matches
IDBIndex.count() - Web APIs
the count() method of the idbindex interface returns an idb
request object, and in a separate thread, returns the number of records within a key range.
... syntax var
request = myindex.count(); var
request = myindex.count(key); parameters key optional the key or key range that identifies the record to be counted.
... return value a idb
request object on which subsequent events related to this operation are fired.
...And 3 more matches
IDBObjectStore.clear() - Web APIs
the clear() method of the idbobjectstore interface creates and immediately returns an idb
request object, and clears this object store in a separate thread.
... syntax var
request = objectstore.clear(); returns an idb
request object on which subsequent events related to this operation are fired.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...And 3 more matches
IDBObjectStore.getKey() - Web APIs
the getkey() method of the idbobjectstore interface returns an idb
request object, and, in a separate thread, returns the key selected by the specified query.
... if a key is successfully found, then a structured clone of it is created and set as the result of the
request object.
... syntax var
request = objectstore.getkey(key); parameters key the key or key range that identifies the record to be retrieved.
...And 3 more matches
IndexedDB API - Web APIs
this method returns an idb
request object; asynchronous operations communicate to the calling application by firing events on idb
request objects.
... idbopendb
request represents a
request to open a database.
... idb
request generic interface that handles database
requests and provides access to results.
...And 3 more matches
LockedFile - Web APIs
returns a file
request.
...returns a file
request object.
...returns a file
request object.
...And 3 more matches
MerchantValidationEvent - Web APIs
the merchantvalidationevent interface of the the payment
request api enables a merchant to verify themselves as allowed to use a particular payment handler.
... constructor merchantvalidationevent() secure context creates a new merchantvalidationevent object describing a merchantvalidation event that will be sent to the payment handler to
request that it validate the merchant.
...this may be either one of the standard payment method identifier strings or a url that both identifies and handles
requests for the payment handler, such as https://apple.com/apple-pay.
...And 3 more matches
Navigator - Web APIs
navigator.locks read only returns a lockmanager object which provides methods for
requesting a new lock object and querying for an existing lock object navigator.mediacapabilities read only returns a mediacapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities.
... navigator.credentials returns the credentialscontainer interface which exposes methods to
request credentials and notify the user agent when interesting events occur such as successful sign in or sign out.
... navigator.mediadevices returns a reference to a mediadevices object which can then be used to get information about available media devices (mediadevices.enumeratedevices()), find out what constrainable properties are supported for media on the user's computer and user agent (mediadevices.getsupportedconstraints()), and to
request access to media using mediadevices.getusermedia().
...And 3 more matches
PaymentResponse.details - Web APIs
this data is returned by the payment app that satisfies the payment
request, and must conform to the structure defined in the basiccardresponse dictionary.
... syntax var detailsobject = paymentresponse.details; example the following example extracts the details from the paymentresponse object to the promise returned from payment
request.show().
... payment.show().then(paymentresponse => { var paymentdata = { // payment method string method: paymentresponse.methodname, // payment details as you
requested details: paymentresponse.details, // shipping address information address: todict(paymentresponse.shippingaddress) }; // send information to the server }); specifications specification status comment payment
request api candidate recommendation initial definition.
...And 3 more matches
Response.type - Web APIs
cors: response was received from a valid cross-origin
request.
... opaque: response for “no-cors”
request to cross-origin resource.
... opaqueredirect: the fetch
request was made with redirect: "manual".
...And 3 more matches
Using the Storage Access API - Web APIs
the storage access api should be used by embedded cross-origin documents to verify whether they have access to their first-party storage and, if not, to
request access.
... usage notes the storage access api is designed to allow embedded content to
request access to storage that would otherwise be blocked when a user’s browser is set to block all third-party cookies.
... first of all, if the <iframe> is sandboxed, the embedding website needs to add the allow-storage-access-by-user-activation sandbox token to allow storage access
requests to be successful, along with allow-scripts and allow-same-origin to allow it to call the api, and execute in an origin that can have cookies: <iframe sandbox="allow-storage-access-by-user-activation allow-scripts allow-same-origin"> ...
...And 3 more matches
Streams API - Web APIs
for example, the response body returned by a successful fetch
request can be exposed as a readablestream, and you can then read it using a reader created with readablestream.getreader(), cancel it with readablestream.cancel(), etc.
...a fetch
request).
... extensions to other apis
request when a new
request object is constructed, you can pass it a readablestream in the body property of its
requestinit dictionary.
...And 3 more matches
WebXR application life cycle - Web APIs
when the user
requests the activation of webxr functionality by engaging with the user interface enabled above,
request an xrsession using the desired mode.
... this is done by calling navigator.xr.
requestsession(), again specifying the string indicating the mode you want to enable: inline, immersive-vr, or immersive-ar.
... if the promise returned by
requestsession() resolves, use the new xrsession to manage the webxr session for the duration of the webxr experience.
...And 3 more matches
Window - Web APIs
this object enables functionality such as storing assets for offline use, and generating custom responses to
requests.
... window.cancelanimationframe() enables you to cancel a callback previously scheduled with window.
requestanimationframe.
... window.cancelidlecallback() enables you to cancel a callback previously scheduled with window.
requestidlecallback.
...And 3 more matches
init() - Web APIs
[noscript] void init( in nsiprincipal principal, in nsiscriptcontext scriptcontext, in nsiglobalobject globalobject, in nsiuri baseuri, [optional] in nsiloadgroup loadgroup ); parameters principal the principal to use for the
request; this must not be null.
... scriptcontext the script context to use for the
request; this must not be null.
... globalobject the object to use as the global for our
request.
...And 3 more matches
XRRigidTransform.position - Web APIs
example to create a reference space which can be used to place an object at eye level (assuming eye level is 1.5 meters): function onsessionstarted(xrsession) { xrsession.addeventlistener("end", onsessionended); gl = initgraphics(xrsession); let gllayer = new xrwebgllayer(xrsession, gl); xrsession.updaterenderstate({ baselayer: gllayer }); if (immersivesession) { xrsession.
requestreferencespace("bounded-floor").then((refspace) => { refspacecreated(refspace); }).catch(() => { session.
requestreferencespace("local-floor").then(refspacecreated); }); } else { session.
requestreferencespace("viewer").then(refspacecreated); } } function refspacecreated(refspace) { if (immersivesession) { xrreferencespace = refspace; } else { xrreferencespac...
...e = refspace.getoffsetreferencespace( new xrrigidtransform({y: -1.5}); ); } xrsession.
requestanimationframe(onframe); } after setting up the graphics context for webxr use, this begins by looking to see if a variable immersivesession is true; if so, we first
request a bounded-floor reference space.
... if that fails (probably because bounded-floor isn't supported), we try
requesting a local-floor reference space.
...And 3 more matches
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
... allowfullscreen set to true if the <iframe> can activate fullscreen mode by calling the
requestfullscreen() method.
... allowpayment
request set to true if a cross-origin <iframe> should be allowed to invoke the payment
request api.
...And 3 more matches
Preloading content with rel="preload" - HTML: Hypertext Markup Language
the preload value of the <link> element's rel attribute lets you declare fetch
requests in the html's <head>, specifying resources that your page will need very soon, which you want to start loading early in the page lifecycle, before browsers' main rendering machinery kicks in.
... resources that javascript can
request, like json, imported scripts, or web workers.
... store in the cache for future
requests, reusing the resource if appropriate.
...And 3 more matches
List of default Accept values - HTTP
this is typically used for
requests initiated via the address bar of a browser, or via an html <a> element.
... edge text/html, application/xhtml+xml, image/jxr, */* opera text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 values for an image when
requesting an image, like through an html <img> element, user-agent often sets a specific list of media types to be welcomed.
... safari */* chrome image/webp,image/apng,image/*,*/*;q=0.8 source internet explorer 8 or earlier */* see ie and the accept header (ieinternals' msdn blog) internet explorer 9 image/png,image/svg+xml,image/*;q=0.8, */*;q=0.5 see fiddler is better with internet explorer 9 (ieinternals' msdn blog) values for a video when a video is
requested, via the <video> html element, most browsers use specific values.
...And 3 more matches
Expect - HTTP
the expect http
request header indicates expectations that need to be fulfilled by the server in order to properly handle the
request.
... for example, the server may reject a
request if its content-length is too large.
... header type
request header forbidden header name yes syntax no other expectations except "100-continue" are specified currently.
...And 3 more matches
If-Match - HTTP
the if-match http
request header makes the
request conditional.
... for get and head methods, the server will send back the
requested resource only if it matches one of the listed etags.
... there are two common use cases: for get and head methods, used in combination with a range header, it can guarantee that the new ranges
requested comes from the same resource than the previous one.
...And 3 more matches
If-None-Match - HTTP
the if-none-match http
request header makes the
request conditional.
... for get and head methods, the server will send back the
requested resource, with a 200 status, only if it doesn't have an etag matching the given ones.
... for other methods, the
request will be processed only if the eventually existing resource's etag doesn't match any of the values listed.
...And 3 more matches
Upgrade - HTTP
header type
request header, response header forbidden header name yes overview the upgrade header field may be used by clients to invite a server to switch to one (or more) of the listed protocols, in descending preference order.
... for example, the client might send a get
request as shown, listing the preferred protocols to switch to (in this case "example/1" and "foo/2"): get /index.html http/1.1 host: www.example.com connection: upgrade upgrade: example/1, foo/2 note: connection: upgrade must be set whenever upgrade is sent.
... the server can choose to ignore the
request, for any reason, in which case it should just respond as though the upgrade header had not been sent (for example, with a 200 ok).
...And 3 more matches
Intl - JavaScript
locale identification and negotiation the internationalization constructors as well as several language sensitive methods of other constructors (listed under see also) use a common pattern for identifying locales and determining the one they will actually use: they all accept locales and options arguments, and negotiate the
requested locale(s) against the locales they support using an algorithm specified in the options.localematcher property.
... locales argument the locales argument
requests that a particular locale (or a locale from a list of them) be considered for use in a given operation.
...javascript internationalization functions use the "u" (unicode) extension, which can be used to
request additional customization of collator, numberformat, or datetimeformat objects.
...And 3 more matches
Structural overview of progressive web apps - Progressive web apps (PWAs)
that way, the next time someone visits the app from the device, the ui loads from the cache immediately and any new content is
requested from the server (if it isn’t available in the cache already).
... we can control what is
requested from the server and what is retrieved from the cache with a service worker, which will be explained in detail in the next article — for now let's focus on the structure itself.
...you can <a href="https://github.com/mdn/pwa-examples/blob/master/js13kpwa"> fork js13kpwa on github</a> to check its source code.</p> <button id="notifications">
request dummy notifications</button> <section id="content"> // content inserted in here </section> </main> <footer> <p>© js13kgames 2012-2018, created and maintained by <a href="http://end3r.com"> andrzej mazur</a> from <a href="http://enclavegames.com">enclave games</a>.</p> </footer> </body> </html> the <head> section contains basic information about the app, including its title, descrip...
...And 3 more matches
indexed-db - Archive of obsolete content
for example: window.indexeddb = window.indexeddb || window.webkitindexeddb || window.mozindexeddb || window.msindexeddb; var
request = window.indexeddb.open("mydatabase");
request.onerror = function(event) { console.log("failure"); };
request.onsuccess = function(event) { console.log("success"); }; because your main add-on code can't access the dom, you can't do this.
... so you can use the indexed-db module to access the same api: var { indexeddb } = require('sdk/indexed-db'); var
request = indexeddb.open('mydatabase');
request.onerror = function(event) { console.log("failure"); };
request.onsuccess = function(event) { console.log("success"); }; most of the objects that implement the indexeddb api, such as idbtransaction, idbopendb
request, and idbobjectstore, are accessible through the indexeddb object itself.
... var { indexeddb, idbkeyrange } = require('sdk/indexed-db'); var database = {}; database.onerror = function(e) { console.error(e.value) } function open(version) { var
request = indexeddb.open("stuff", version);
request.onupgradeneeded = function(e) { var db = e.target.result; e.target.transaction.onerror = database.onerror; if(db.objectstorenames.contains("items")) { db.deleteobjectstore("items"); } var store = db.createobjectstore("items", {keypath: "time"}); };
request.onsuccess = function(e) { database.db = e.target.res...
...And 2 more matches
Progress Listeners - Archive of obsolete content
example create an object which implements nsiwebprogresslistener: const state_start = ci.nsiwebprogresslistener.state_start; const state_stop = ci.nsiwebprogresslistener.state_stop; var mylistener = { queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), onstatechange: function(awebprogress, a
request, aflag, astatus) { // if you use mylistener for more than one tab/window, use // awebprogress.domwindow to obtain the tab/window which triggers the state change if (aflag & state_start) { // this fires when the load event is initiated } if (aflag & state_stop) { // this fires when the load finishes } }, onlocationcha...
...nge: function(aprogress, a
request, auri) { // this fires when the location bar changes; that is load event is confirmed // or when the user switches tabs.
... }, // for definitions of the remaining functions see related documentation onprogresschange: function(awebprogress, a
request, curself, maxself, curtot, maxtot) {}, onstatuschange: function(awebprogress, a
request, astatus, amessage) {}, onsecuritychange: function(awebprogress, a
request, astate) {} } attach the progress listener to a <browser> or a <tabbrowser> element using addprogresslistener, for example for firefox put the following code in a load listener of a main window: gbrowser.addprogresslistener(mylistener); when used with a browser, the second argument is a mask which determines the type of events that will be received.
...And 2 more matches
Enhanced Extension Installation - Archive of obsolete content
the composite datasource handles all read-only information
requests, and when data must be written the extension manager determines the appropriate datasource to write and flush to.
... the model looks something like this: nsextensionsdatasource.prototype = { _composite // the composite that manages the two // datasources at the install locations for // read-only information
requests _profileextensions // the rdf/xml datasource for the items at the // profile install location _globalextensions // the rdf/xml datasource for the items at the // global install location.
...on the next restart, the xredirprovider now supplies a list of directories to
requesting systems listing the new item's components, defaults and chrome manifests.
...And 2 more matches
Interaction between privileged and non-privileged pages - Archive of obsolete content
var mainwindow = window.queryinterface(components.interfaces.nsiinterface
requestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterface
requestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.document.addeventlistener("myextensionevent", function(e...
... chromium-like messaging: json
request with json callback web page: <html> <head> <script> var something = { send_
request: function(data, callback) { // analogue of chrome.extension.send
request var
request = document.createtextnode(json.stringify(data));
request.addeventlistener("something-response", function(event) {
request.parentnode.removechild(
request); if (callb...
...ack) { var response = json.parse(
request.nodevalue); callback(response); } }, false); document.head.appendchild(
request); var event = document.createevent("htmlevents"); event.initevent("something-query", true, false);
request.dispatchevent(event); }, callback: function(response) { return alert("response: " + (response ?
...And 2 more matches
Supporting search suggestions in search plugins - Archive of obsolete content
if the user continues to type, a new set of suggestions is
requested from the search engine, and the displayed list is refreshed.
... when the browser wants to fetch possible matches for a search term, it then sends an http get
request to the url specified by the <url> element.
...this enhancement
request - the handling of a selected suggestion, namely calling of a full specified url as proposed in the opensearch standard - is tracked in bug 386591.
...And 2 more matches
Index of archived content - Archive of obsolete content
high-level apis addon-page base64 clipboard context-menu hotkeys indexed-db l10n notifications page-mod page-worker panel passwords private-browsing querystring
request selection self simple-prefs simple-storage system tabs timers ui url widget windows low-level apis /loader chrome console/plain-text ...
...ting a help content pack helper apps (and a bit of save as) hidden prefs how to write and land nanojit patches io guide/directory keys introducing the audio api extension isp data java in firefox extensions javascript os.shared javascript crypto crmf
request object generatecrmf
request() importusercertificates popchallengeresponse jetpack basics content page modifications extenders jetpack snippets libraries ...
... tamarin build system documentation tamarin releases tamarin-central rev 703:2cee46be9ce0 tamarin roadmap tamarin build documentation tamarin mercurial commit hook the download manager schema the life of an html http
request the new nsstring class implementation (1999) tracevis transforming xml with xslt:mozilla xslt transforming xml with xslt:the netscape xslt treehydra treehydra build instructions treehydra manual tuning pageload urischeme uris and urls uri...
...And 2 more matches
MMgc - Archive of obsolete content
this is an unfortunate artifact of the existing code base, the avm+ is relatively clean and its reachability graph consists of basically 2 gc roots (the avmcore and urlstreams) but the avm- has a bunch (currently includes securitycallbackdata, moviecliploader, camerainstance, fappacket, microphoneinstance, csoundchannel, url
request, responceobject, urlstream and urlstreamsecurity).
...furthermore we can run this check even more frequently than every mark increment, for instance every time our gc memory allocators
request a new block from our primary allocator (the way our extremely helpful greedy collection mode works).
...so the frequency of the incremental marking will be based on two factors: the rate at which we can trace memory and the rate at which the mutator is
requesting more memory.
...And 2 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
autoconfig directives here we want to set users central mail preferences: create one account from their login name, get their email address from an ldap
request and set the enterprise imap and smtp servers.
... build install mercurial tools [root@b008-02 ~]# yum install mercurial installed: mercurial.i586 0:1.2.1-1.fc11 check merge tools in [root@b008-02 ~]# vim /etc/mercurial/hgrc.d/mergetools.rc get the source comm-central [root@b008-02 moz]# time hg clone http://hg.mozilla.org/comm-central/ commsrc
requesting all changes adding changesets adding manifests adding file changes added 2975 changesets with 16793 changes to 7117 files (+3 heads) updating working directory 5644 files updated, 0 files merged, 0 files removed, 0 files unresolved real 0m40.771s user 0m9.284s sys 0m1.304s [root@b008-02 commsrc]# python client.py checkout executing command: ['hg', 'pull', '-r', './.', '-r', 'tip'...
...executing command: ['hg', 'clone', 'http://hg.mozilla.org/releases/mozilla-1.9.1/', './mozilla']
requesting all changes adding changesets ...
...And 2 more matches
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
var gxmlhttp
request; function loadtinderboxstatus() { gxmlhttp
request = new xmlhttp
request(); gxmlhttp
request.onload = updatetinderboxstatus; gxmlhttp
request.open("get", "http://tinderbox.mozilla.org/seamonkey/panel.html"); gxmlhttp
request.send(null); } xmlhttp
request is an interface in mozilla for retrieving documents via http.
... xmlhttp
request is easy to use in the simple case we have here.
... we use new to create a new instance of it, set the instance's onload property to updatetinderboxstatus(), the function we want to execute when the document finishes loading, call its open method with the type of http
request we want to make and the url of the document to retrieve, and then call its send method to send the
request.
...And 2 more matches
XUL Events - Archive of obsolete content
the event handler should be placed on an observer.checkboxstatechangethe checkboxstatechange event is executed when the state of a <checkbox> element has changed.closethe close event is executed when a
request has been made to close the window when the user presses the close button.commandthe command event is executed when an element is activated.commandupdatethe commandupdate event is executed when a command update occurs on a <commandset>.
... attribute: onbroadcast close this event is sent when a
request has been made to close the window when the user presses the close button.
... attribute: oncommandupdate contextmenu this event is sent to an element when the user
requests to open the context menu for the element.
...And 2 more matches
NPByteRange - Archive of obsolete content
syntax typedef struct _npbyterange { int32 offset; /* negative offset = from the end */ uint32 length; struct _npbyterange* next; } npbyterange; fields the data structure has the following fields: offset offset in bytes to the start of the
requested range.
... next points to the next npbyterange
request in the list of
requests, or null if this is the last
request.
...the only plug-in api call that uses the npbyterange type is npn_
requestread(), which lets the plug-in read specified parts of a file without downloading it.
...And 2 more matches
Table Reflow Internals - Archive of obsolete content
absolutely positioned elements) reflows reflowee and passes a reflow state (in) and a reflow metrics (in/out) review of reflow the reflow state: is a node in a tree structurally equivalent to the frame tree of reflow participants contains: reflow type, avail size, various computed values, resolved style structs possible
request for preferred size and more.
... review of reflow the reflow metrics contains: max element size (if
requested) - the minimum size it can be preferred size (if
requested) - the size it would like to be given no size constraints.
...tablecaption frame ↙ ↘ ↓ nstablecol groupframe nstablerow groupframe nsblockframe ↓ ↓ nstablecol frame nstablerow frame ↓ nstablecell frame ↓ nsblock frame table reflow outer table reflows table and caption (if present) table reflows row groups in multiple passes pass 1 - unconstrained width, height and
requests max elem width.
...And 2 more matches
MDN Web Docs Glossary: Definitions of Web-related terms
r cipher suite ciphertext class client hints closure cms code splitting codec compile compile time computer programming conditional constant constructor continuous media control flow cookie copyleft cors cors-safelisted
request header cors-safelisted response header crawler crlf cross axis cross-site scripting crud cryptanalysis cryptographic hash function cryptography csp csrf css css object model (cssom) css pixel css preprocessor d data structure decr...
... ecma ecmascript effective connection type element empty element encapsulation encryption endianness engine entity entity header event exception expando f fallback alignment falsy favicon fetch directive fetch metadata
request header firefox os firewall first contentful paint first cpu idle first input delay first interactive first meaningful paint first paint first-class function flex flex container flex item flexbox forbidden header name forbidden response header name fork ...
... packet page load time page prediction parameter parent object parse parser pdf perceived performance percent-encoding php pixel placeholder names plaintext png polyfill polymorphism pop3 port prefetch preflight
request prerender presto primitive privileged privileged code progressive enhancement progressive web apps promise property property (css) property (javascript) protocol prototype prototype-based programming proxy server pseudo-class pseudo-element ...
...And 2 more matches
What is web performance? - Learn web development
a general strategy is to make your files as small as possible, reduce the number of http
requests made as much as possible, and employ clever loading techniques (such as preload) to make files available sooner.
... to summarize, many features impact performance including latency, application size, the number of dom nodes, the number of resource
requests made, javascript performance, cpu load, and more.
...when you
request a url and hit enter / return, the browser finds out where the server is that holds that website's files, establishes a connection to it, and
requests the files.
...And 2 more matches
Performance
do some work on the window } function dosomething(message) { result = helper(content, message.data) sendasyncmessage("my-addon:response-from-child", {something: result}) } addmessagelistener("my-addon:
request-from-parent", dosomething) why is this bad?
...do some work on the window } function dosomething(message) { frameglobal = message.target result = helper(frameglobal.content, message.data) frameglobal.sendasyncmessage("my-addon:response-from-child", {something: result}) } function addframe(frameglobal) { frameglobal.addmessagelistener("my-addon:
request-from-parent", dosomething) } javascript modules are per-process singletons and thus all their objects are only initialized once, which makes them suitable for stateless callbacks.
...: // addon.js services.mm.loadframescript("framescript.js", /*delayed:*/ true) // stuff communicating with the framescript // framescript.js function onlyonceinabluemoon() { // we only need this during a total solar eclipse while goat blood rains from the sky sendasyncmessage('my-addon:paragraph-count', {num: content.document.queryselectorall('p').length}) } addmessagelistener("my-addon:
request-from-parent", onlyonceinabluemoon) better: // addon.js function ontoolbarbutton(event) { let tabmm = gbrowser.mcurrentbrowser.frameloader.messagemanager; let button = event.target; let callback = (message) => { tabmm.removemessagelistener("my-addon:paragraph-count", callback) decoratebutton(button, message.data.num) } tabmm.addmessagelistener("my-addon:paragraph-count", callb...
...And 2 more matches
NSS_3.12_release_notes.html
bug 414985: crash in pkix_pl_ocsp
request_destroy bug 421870: strsclnt crashed in pkix tests.
... all the generalnames in a crldp extension bug 398019: correct confusing and erroneous comments in der_asciitotime bug 422866: vfychain -pp command crashes in nss_shutdown bug 345779: useless assignment statements in ec_gf2m_pt_mul_mont bug 349011: please stop exporting these crmf_ symbols bug 397178: crash when entering chrome://pippki/content/resetpassword.xul in url bar bug 403822: pkix_pl_ocsp
request_create can leave some members uninitialized bug 403910: cert_findusercertbyusage() returns wrong certificate if multiple certs with same subject available bug 404919: memory leak in sftkdb_readsecmoddb() (sftkmod.c) bug 406120: allow application to specify ocsp timeout bug 361025: support for camellia cipher suites to tls rfc4132 bug 376417: pk11_generatekeypair needs to get the key usage from t...
...ts bug 426245: assertion failure went undetected by tinderbox bug 158242: pk11_putcrl is very memory inefficient bug 287563: please make cert_comparenamewithconstraints a non-static function bug 301496: nss_shutdown failure in p7sign bug 324878: crlutil -l outputs false crl names bug 337010: oom crash [[@ nsc_digestkey] dereferencing possibly null att bug 343231: certutil issues certs for invalid
requests bug 353371: klocwork 91117 - null pointer dereference in cert_certchainfromcert bug 353374: klocwork 76494 - null ptr derefs in cert_formatname bug 353375: klocwork 76513 - null ptr deref in nsscertificatelist_docallback bug 353413: klocwork 76541 free uninitialized pointer in cert_findcerturlextension bug 353416: klocwork 76593 null ptr deref in nsscryptokiprivatekey_setcertificate bug 353423: ...
...And 2 more matches
NSS 3.15 release notes
nss 3.15 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_rtm/src/ new in nss 3.15 new functionality support for ocsp stapling (rfc 6066, certificate status
request) has been added for both client and server sockets.
... new functions in ssl.h ssl_peerstapledocspresponse - returns the server's stapled ocsp response, when used with a tls client socket that negotiated the status_
request extension.
... ssl_setstapledocspresponses - set's a stapled ocsp response for a tls server socket to return when clients send the status_
request extension.
...And 2 more matches
NSS 3.35 release notes
applications using nss may explicitly
request to use a specific database format, by adding a type prefix to the database directory, provided at nss initialization time.
... if the server sends a helloretry
request, it is possible to discard the server socket, and make a new socket to handle any subsequent clienthello.
... tls servers can screen new tls 1.3 connections, as they are made using the experimental ssl_helloretry
requestcallback function.
...And 2 more matches
JS_ClearContextThread
there must not be any active or suspended
requests using this context.
... each
request runs from start to finish on a single thread.
...this is the first thing thread b does with the context, before beginning a
request.
...And 2 more matches
JS_SetOperationCallback
these methods/types are renamed to js_setinterruptcallback, js_getinterruptcallback, js_
requestinterruptcallback and jsinterruptcallback in spidermonkey 30.
... provides
request.
... in js_threadsafe builds, the javascript engine calls this callback only from within an active
request on cx.
...And 2 more matches
XPCOM Stream Guide
from the nsistreamlistener interface, the .ondataavailable(
request, context, inputstream, offset, count) method gives you the input stream and the number of bytes available.
...from the nsi
requestobserver interface, the .onstart
request(
request, context) method tells you when the
request begins, while the .onstop
request(
request, context) method tells you when the
request ends.
... a
request will have one .onstart
request(
request, context) call, followed by at least one .ondataavailable(...) call, followed by one .onstop
request(
request, context) call.
...And 2 more matches
nsICacheSession
inherits from: nsisupports last changed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11) method overview void asyncopencacheentry(in acstring key, in nscacheaccessmode access
requested, in nsicachelistener listener, [optional] in boolean nowait); void evictentries(); prbool isstorageenabled(); nsicacheentrydescriptor opencacheentry(in acstring key, in nscacheaccessmode access
requested, in boolean blockingmode); void doomentry(in acstring key, in nsicachelistener listener); attributes attribute type description doomentriesifexpired prbool expired entries will ...
...void asyncopencacheentry( in acstring key, in nscacheaccessmode access
requested, in nsicachelistener listener, [optional] in boolean nowait ); parameters key the key for cache entry.
... access
requested the
requested access.
...And 2 more matches
nsICharsetResolver
inherits from: nsisupports last changed in gecko 1.7 method overview void notifyresolvedcharset(in acstring charset, in nsisupports closure); acstring
requestcharset(in nsiwebnavigation awebnavigation, in nsichannel achannel, out boolean awantcharset, out nsisupports aclosure); methods notifyresolvedcharset() some implementations may
request that they be notified when the charset is actually detected.
...closure the closure returned by
requestcharset().
...
requestcharset() called to resolve the charset that should be used for parsing the document being loaded from achannel.
...And 2 more matches
Component; nsIPrefBranch
return value the value of the
requested boolean preference.
... return value returns string - the value of the
requested string preference.
... return value returns utf8tring - the value of the
requested string preference.
...And 2 more matches
nsIWebNavigation
this will give priority to loading the
requested uri in the object implementing this interface.
... postdata if the uri corresponds to a http
request, then this stream is appended directly to the http
request headers.
...this stream must contain a \r\n sequence separating any http headers from the http
request body.
...And 2 more matches
nsIWindowMediator
var {cc: classes, ci: interfaces} = components; var windowlistener = { onopenwindow: function (awindow) { // wait for the window to finish loading let domwindow = awindow.queryinterface(ci.nsiinterface
requestor).getinterface(ci.nsidomwindowinternal || ci.nsidomwindow); domwindow.addeventlistener("load", function () { domwindow.removeeventlistener("load", arguments.callee, false); //this removes this load function from the window //window has now loaded now do stuff to it //as example this will add a function to listen to tab select and will fire alert in tha...
... inposition
requested position one of the zlevel constants.
... windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); if (!windowmediator.getouterwindowwithid) { windowmediator.getouterwindowwithid = function (aouterwindowid) { let win = this.getmostrecentwindow(); let winutil = win.queryinterface(components.interfaces.nsiinterface
requestor) .getinterface(components.interfaces.nsidomwindowutils); return winutil.getouterwindowwithid(aouterwindowid); } } getxulwindowenumerator() identical to getenumerator() except it returns nsixulwindow instead of nsidomwindow.
...And 2 more matches
nsIWindowsRegKey
astring getchildname( in unsigned long index ); parameters index the index of the
requested child key.
...astring getvaluename( in unsigned long index ); parameters index the index of the
requested value.
...boolean haschild( in astring name ); parameters name the name of the
requested child key.
...And 2 more matches
Mozilla
bugzilla bugzilla.mozilla.org (often abbreviated b.m.o) is mozilla.org's bug-tracking system, a database for recording bugs and enhancement
requests for firefox, thunderbird, seamonkey, camino, and other mozilla.org projects.
...these are memory allocation routines that never return null; that is, they always successfully return the
requested block of memory.
... this is in contrast to a traditional, fallible memory allocator that can return null indicating that the
request failed.
...And 2 more matches
Browser Side Plug-in API - Plugins
npn_geturlnotify
requests creation of a new stream with the contents of the specified url; gets notification of the result.
... npn_memflush
requests that the browser free a specified amount of memory.
... npn_newstream
requests the creation of a new data stream produced by the plug-in and consumed by the browser.
...And 2 more matches
Gecko Plugin API Reference - Plugins
npn_geturlnotify
requests creation of a new stream with the contents of the specified url; gets notification of the result.
... npn_memflush
requests that the browser free a specified amount of memory.
... npn_newstream
requests the creation of a new data stream produced by the plug-in and consumed by the browser.
...And 2 more matches
Network monitor toolbar - Firefox Developer Tools
(prior to firefox 77, this toolbar was arranged somewhat differently.) it provides: an icon to clear the network
request list.
... a box enabling you to filter
requests by url and by properties.
... a set of tool icons: pause (or resume) recording network log search the log
request blocking an array of buttons to filter the network
request list by type: by the content type of the response xhr
requests websocket upgrades and messages (labeled ws) other
requests a checkbox that allows you to disable caching.
...And 2 more matches
AbortController.abort() - Web APIs
the abort() method of the abortcontroller interface aborts a dom
request (e.g.
... a fetch
request) before it has completed.
... this is able to abort fetch
requests, consumption of any response body, and streams.
...And 2 more matches
AbortSignal - Web APIs
the abortsignal interface represents a signal object that allows you to communicate with a dom
request (such as a fetch) and abort it if required via an abortcontroller object.
... abortsignal.aborted read only a boolean that indicates whether the
request(s) the signal is communicating with is/are aborted (true) or not (false).
... abort invoked when the dom
request(s) the signal is communicating with is/are aborted.
...And 2 more matches
BaseAudioContext.decodeAudioData() - Web APIs
in this case the arraybuffer is loaded from xmlhttp
request and filereader.
... syntax older callback syntax: baseaudiocontext.decodeaudiodata(arraybuffer, successcallback, errorcallback); newer promise-based syntax: promise<decodeddata> baseaudiocontext.decodeaudiodata(arraybuffer); parameters arraybuffer an arraybuffer containing the audio data to be decoded, usually grabbed from xmlhttp
request, windoworworkerglobalscope.fetch() or filereader.
... older callback syntax in this example, the getdata() function uses xhr to load an audio track, setting the responsetype of the
request to arraybuffer so that it returns an array buffer as its response that we then store in the audiodata variable .
...And 2 more matches
Using the Beacon API - Web APIs
the beacon interface schedules an asynchronous and non-blocking
request to a web server.
... beacon
requests use http post and do not require a response.
... beacon
requests are guaranteed to be initiated before the page unloads.
...And 2 more matches
Cache.addAll() - Web APIs
the
request objects created during retrieval become keys to the stored response operations.
... note: addall() will overwrite any key/value pairs previously stored in the cache that match the
request, but will fail if a resulting put() operation would overwrite a previous cache entry stored by the same addall() method.
... syntax cache.addall(
requests[]).then(function() { //
requests have been added to the cache }); parameters
requests an array of string urls that you want to be fetched and added to the cache.
...And 2 more matches
FileHandle API - Web APIs
api overview this api is based on the following interfaces: idbdatabase.mozcreatefilehandle (was called idbdatabase.mozcreatefilehandle.) idbmutablefile (was previously filehandle.) lockedfile file
request it also has connections with the file api, especially the file and blob interfaces.
...for example, there are many apis that expect blob or file objects such as filereader (which can be easier to use to read the whole file) or xmlhttp
request.
... var mysnapshot = null; var
request = myfilehandle.getfile();
request.onsuccess = function () { mysnapshot = this.result; } managing progress all the methods from the lockedfile interface return a file
request object.
...And 2 more matches
IDBCursor.delete() - Web APIs
the delete() method of the idbcursor interface returns an idb
request object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position.
... syntax myidbcursor.delete(); returns an idb
request object on which subsequent events related to this operation are fired.
...if the albumtitle of the current cursor is "grace under pressure", we delete that entire record using var
request = cursor.delete();.
...And 2 more matches
IDBDatabase: error event - Web APIs
the error event is fired on idbdatabase when a
request returns an error and the event bubbles up to the connection object.
... bubbles yes cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: f...
...alse }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = (event) => { const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const db = dbopen
request.result; db.addeventlistener('error', () => { console.log(`error adding new item: ${newitem.tasktitle}`); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const objectstore
request = objectstore.add(newitem); }; the same example, using the onerror property instead of addeventlis...
...And 2 more matches
IDBDatabase.onerror - Web APIs
the onerror event handler of the idbdatabase interface handles the error event, fired when a
request returns an error and bubbles up to the connection object.
... note: consider using idbopendb
request.onsuccess instead (see idb
request.onsuccess, where it is inherited from).
...} example this example shows an idbopendb
request.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases.
...And 2 more matches
IDBDatabase - Web APIs
error fired when a
request returns an error and the event bubbles up to the connection object.
... versionchange fired when a database structure change was
requested.
...for a complete working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); // these two event handlers act on the idbdatabase object, // when the database is opened successfully, or not dbopen
request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variab...
...And 2 more matches
IDBObjectStore.count() - Web APIs
the count() method of the idbobjectstore interface returns an idb
request object, and, in a separate thread, returns the total number of records that match the provided key or idbkeyrange.
... syntax var
request = objectstore.count(); var
request = objectstore.count(query); parameters query optional a key or idbkeyrange object that specifies a range of records you want to count.
... return value an idb
request object on which subsequent events related to this operation are fired.
...And 2 more matches
IDBObjectStore.openCursor() - Web APIs
the opencursor() method of the idbobjectstore interface returns an idb
request object, and, in a separate thread, returns a new idbcursorwithvalue object.
... syntax var
request = objectstore.opencursor(); var
request = objectstore.opencursor(query); var
request = objectstore.opencursor(query, direction); parameters query optional a key or idbkeyrange to be queried.
... return value an idb
request object on which subsequent events related to this operation are fired.
...And 2 more matches
IDBTransaction.abort() - Web APIs
all pending idb
request objects created during this transaction have their idb
request.error attribute set to aborterror.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... this is used a lot below db = dbopen
request.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error.
...And 2 more matches
IDBTransaction.error - Web APIs
it can be a reference to the same error as the
request object that raised it, or a transaction failure (for example quotaexceedederror or unknownerror).
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopen
request.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error +...
...And 2 more matches
IDBTransaction: error event - Web APIs
the error event is fired on idbtransaction when a
request returns an error and the event bubbles up to the transaction object.
... bubbles yes cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: f...
...alse }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = (event) => { const db = dbopen
request.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); transaction.addeventlistener('error', () => { console.log(`error adding new item: ${newitem.tasktitle}`); }); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstore
request = objectstore.add(newitem); }; the same example, using the onerror property instead of ...
...And 2 more matches
IDBTransaction.onerror - Web APIs
the onerror event handler of the idbtransaction interface handles the error event, fired when a
request returns an error and bubbles up to the transaction object.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopen
request.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error +...
...And 2 more matches
Lock - Web APIs
the lock interface of the the web locks api provides the name and mode of a previously
requested lock, which is received in the callback to lockmanager.
request().
... properties lock.mode read only returns the access mode passed to lockmanager.
request() when the lock was
requested.
... lock.name read only returns the name passed to lockmanager.
request() when the lock was
requested.
...And 2 more matches
Navigator.sendBeacon() - Web APIs
ensuring that data has been sent during the unloading of a document has traditionally been difficult, because user agents typically ignore asynchronous xmlhttp
requests made in an unload handler.
... historically, this was addressed with some of the following workarounds to delay the page unload long enough to send data to some url: submitting the data with a blocking synchronous xmlhttp
request call in unload or beforeunload event handlers.
... the following example shows theoretical analytics code that attempts to submit data to a server with a synchronous xmlhttp
request in an unload handler.
...And 2 more matches
PaymentResponse.onpayerdetailchange - Web APIs
the paymentresponse object's onpayerdetailchange property is an event handler which is called to handle the payerdetailchange event, which is sent to the paymentresponse when the user makes changes to their personal information while filling out a payment
request form.
... syntax paymentresponse.onpayerdetailchange = eventhandlerfunction; value an event handler function which is called to handle the payerdetailchange event when the user makes changes to their personal information while editing a payment
request form.
... examples in the example below, onpayerdetailchange is used to set up a listener for the payerdetailchange event in order to validate the information entered by the user,
requesting that any mistakes be corrected // options for payment
request(), indicating that shipping address, // payer email address, name, and phone number all be collected.
...And 2 more matches
PaymentResponse.payerEmail - Web APIs
this option is only present when the
requestpayeremail option is set to true in the paymentoptions object passed to the payment
request constructor.
... syntax var payeremail = paymentresponse.payeremail; specifications specification status comment payment
request api candidate recommendation initial definition.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
...And 2 more matches
PerformanceTiming - Web APIs
performancetiming.fetchstart read only when the browser is ready to fetch the document using an http
request.
... performancetiming.connectstart read only when the
request to open a connection is sent to the network.
...if no such connection is
requested, it returns 0.
...And 2 more matches
Permissions - Web APIs
permissions.
request()
requests permission to use a given api.
... permissions.
requestall()
requests permission to use a given set of apis.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
...And 2 more matches
Resource Timing API - Web APIs
an application can use the timing metrics to determine, for example, the length of time it takes to load a specific resource, such as an xmlhttp
request, <svg>, image, or script.
... the interface's properties create a resource loading timeline with high-resolution timestamps for network events such as redirect start and end times, dns lookup start and end times,
request start, response start and end times, etc.
...the last three timestamps are, in order:
requeststart - the timestamp before the browser starts
requesting the resource from the server; responsestart - the timestamp after the browser receives the first byte of the response from the server; and responseend - the timestamp after the browser receives the last byte of the resource.
...And 2 more matches
Using the Screen Capture API - Web APIs
to
request that the screen be shared with included audio, the options passed into getdisplaymedia() might look like this: const gdmoptions = { video: true, audio: true } this allows the user total freedom to select whatever they want, within the limits of what the user agent supports.
... capturing audio is always optional, and even when web content
requests a stream with both audio and video, the returned mediastream may still have only one video track, with no audio.
... authorizing capture of display contents before streaming of captured screen contents can begin, the user agent will ask the user to confirm the sharing
request, and to select the content to share.
...And 2 more matches
ServiceWorkerGlobalScope - Web APIs
additionally, synchronous
requests are not allowed from within a service worker — only asynchronous
requests, like those initiated via the fetch() method, can be used.
...this returns a promise that resolves to the response object representing the response to your
request.
...when fired, the code returns a promise that resolves to the first matching
request in the cache object.
...And 2 more matches
StorageManager.persist() - Web APIs
the persist() method of the storagemanager interface
requests permission to use persistent storage, and returns a promise that resolves to true if permission is granted and box mode is persistent, and false otherwise.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpersistchrome full support 52 full support 52 no support 48 — 52alternate name alternate name uses the non-standard name:
requestpersistentedge full support ≤79firefox full support 55ie ?
...And 2 more matches
WebGL best practices - Web APIs
use webgl.flush() when not using
requestanimationframe when not using raf, (such as when using rpaf; see below) use webgl.flush() to encourage eager execution of enqueued commands.
...even basic
requests can take as long as 1ms, but they can take even longer if they need to wait for all graphics work to be completed (with an effect similar to glfinish() in native opengl).
... use
requestpostanimationframe not
requestanimationframe while it's well-known that apps should use
requestanimationframe ("raf") instead of settimeout (et al) to redraw on-demand, what's less well-known is that non-trivial webgl apps should often not render within a raf callback.
...And 2 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
this means that most frequently, you'll be using poses within your frame rendering code, which is executed as a callback from the xrframe method
requestanimationframe().
... the only way to obtain a pose that adapts positional information from one space to another is through the xrframe object received by your frame rendering callback function specified when you called the xrsession method
requestanimationframe().
... for example, given an xrsession whose reference space is worldrefspace, the following line of code would
request the first frame of animation to be scheduled: animationframe
requestid = xrsession.
requestanimationframe(mydrawframe); then, the mydrawframe() function—the callback executed when it's time to draw the frame—might be something like this: function mydrawframe(currentframetime, frame) { let session = frame.session; let viewerpose = frame.getviewerpose(viewerrefspace); animationframe
requestid = session.
requestanimationframe(mydrawframe); if (viewerpose) { /* ...
...And 2 more matches
Using Web Workers - Web APIs
in addition, they can perform i/o using xmlhttp
request (although the responsexml and channel attributes are always null).
...in addition, workers may use xmlhttp
request for network i/o, with the exception that the responsexml and channel attributes on xmlhttp
request always return null.
... 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.
...And 2 more matches
window.cancelIdleCallback() - Web APIs
summary the window.cancelidlecallback() method cancels a callback previously scheduled with window.
requestidlecallback().
... syntax window.cancelidlecallback(handle); parameters handle the id value returned by window.
requestidlecallback() when the callback was established.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
...And 2 more matches
XRPermissionDescriptor - Web APIs
the xrpermissiondescriptor's name must be set to xr in order to direct the permissions api to correctly handle the
request as applying to webxr.
... mode an xrsessionmode value indicating the xr mode (inline, immersive-vr, or immersive-ar) for which the permissions are
requested.
... optionalfeatures an array of strings, each specifying the name of a webxr feature which is
requested but not required for the app to function.
...And 2 more matches
XRSession.cancelAnimationFrame() - Web APIs
the cancelanimationframe() method of the xrsession interface cancels an animation frame which was previously
requested by calling
requestanimationframe.
... syntax xrsession.cancelanimationframe(handle); parameters handle the unique value returned by the call to
requestanimationframe() that previously scheduled the animation callback.
...once started, the session schedules its first frame to be rendered by calling
requestanimationframe().
...And 2 more matches
Creating a cross-browser video player - Developer guides
to detect if a browser actually supports the fullscreen api and that it is enabled, the following may be called: var fullscreenenabled = !!(document.fullscreenenabled || document.mozfullscreenenabled || document.msfullscreenenabled || document.webkitsupportsfullscreen || document.webkitfullscreenenabled || document.createelement('video').webkit
requestfullscreen); this simply tests all the different prefixed (and of course the non-prefixed!) booleans to see if fullscreen is possible.
... the final tested value, document.createelement('video').webkit
requestfullscreen is required for the last presto version of opera (12.14).
...ction() { if (isfullscreen()) { if (document.exitfullscreen) document.exitfullscreen(); else if (document.mozcancelfullscreen) document.mozcancelfullscreen(); else if (document.webkitcancelfullscreen) document.webkitcancelfullscreen(); else if (document.msexitfullscreen) document.msexitfullscreen(); setfullscreendata(false); } else { if (videocontainer.
requestfullscreen) videocontainer.
requestfullscreen(); else if (videocontainer.moz
requestfullscreen) videocontainer.moz
requestfullscreen(); else if (videocontainer.webkit
requestfullscreen) videocontainer.webkit
requestfullscreen(); else if (videocontainer.ms
requestfullscreen) videocontainer.ms
requestfullscreen(); setfullscreendata(true); } } first of all the function checks if...
...And 2 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...the allowed values are: anonymous sends a cross-origin
request without a credential.
... use-credentials sends a cross-origin
request with a credential.
...And 2 more matches
HTTP authentication - HTTP
the general http authentication framework rfc 7235 defines the http authentication framework, which can be used by a server to challenge a client
request, and by a client to provide authentication information.
... a client that wants to authenticate itself with the server can then do so by including an authorization
request header with the credentials.
... usually a client will present a password prompt to the user and will then issue the
request including the correct authorization header.
...And 2 more matches
Access-Control-Allow-Origin - HTTP
the access-control-allow-origin response header indicates whether the response can be shared with
requesting code from the given origin.
... header type response header forbidden header name no syntax access-control-allow-origin: * access-control-allow-origin: <origin> access-control-allow-origin: null directives * for
requests without credentials, the literal value "*" can be specified, as a wildcard; the value tells browsers to allow
requesting code from any origin to access the resource.
...if the server supports clients from multiple origins, it must return the origin for the specific client making the
request.
...And 2 more matches
Cache-Control - HTTP
the cache-control http header holds directives (instructions) for caching in both
requests and responses.
... a given directive in a
request does not mean the same directive should be in the response.
...(see spec for definitions) cache
request directives standard cache-control directives that can be used by the client in an http
request.
...And 2 more matches
Content-Security-Policy - HTTP
sandbox enables a sandbox for the
requested resource similar to the <iframe> sandbox attribute.
...these violation reports consist of json documents sent via an http post
request to the specified uri.
... upgrade-insecure-
requests instructs user agents to treat all of a site's insecure urls (those served over http) as though they have been replaced with secure urls (those served over https).
...And 2 more matches
Content-Type - HTTP
in
requests, (such as post or put), the client tells the server what type of data is actually sent.
... header type entity header forbidden header name no cors-safelisted response header yes cors-safelisted
request header yes, with the additional restriction that values can't contain a cors-unsafe
request header byte: 0x00-0x1f (except 0x08 (tab)), "():<>?@[\]{}, and 0x7f (delete).
... examples content-type in html forms in a post
request, resulting from an html form submission, the content-type of the
request is specified by the enctype attribute on the <form> element.
...And 2 more matches
Host - HTTP
the host
request header specifies the host and port number of the server to which the
request is being sent.
... if no port is included, the default port for the service
requested (e.g., 443 for an https url, and 80 for an http url) is implied.
... a host header field must be sent in all http/1.1
request messages.
...And 2 more matches
Origin - HTTP
the origin
request header indicates where a fetch originates from.
...it is sent with cors
requests, as well as with post
requests.
... note: the origin header is not set on fetch
requests with a method of head or get (this behavior was corrected in firefox 65 — see bug 1508661).
...And 2 more matches
Sec-Fetch-User - HTTP
the sec-fetch-user fetch metadata header indicates whether or not a navigation
request was triggered by a user activation.
... header type fetch metadata
request header forbidden header name yes, since it has prefix sec- cors-safelisted
request header syntax sec-fetch-user: ?0 sec-fetch-user: ?1 values the value is a boolean structured header.
... ?0 the navigation
request was triggered by a user activation.
...And 2 more matches
SameSite cookies - HTTP
values the samesite attribute accepts three values: lax cookies are allowed to be sent with top-level navigations and will be sent along with get
request initiated by third party website.
... strict cookies will only be sent in a first-party context and not be sent along with
requests initiated by third party websites.
... none used to be the default value, but recent browser versions made lax the default value to have reasonably robust defense against some classes of cross-site
request forgery (csrf) attacks.
...And 2 more matches
HEAD - HTTP
the http head method
requests the headers that would be returned if the head
request's url was instead
requested with the http get method.
... for example, if a url might produce a large download, a head
request could read its content-length header to check the filesize without actually downloading the file.
...if it has one anyway, that body must be ignored: any entity headers that might describe the erroneous body are instead assumed to describe the response which a similar get
request would have received.
...And 2 more matches
Progressive web app structure - Progressive web apps (PWAs)
that way, the next time someone visits the app from the device, the ui loads from the cache immediately and any new content is
requested from the server (if it isn’t available in the cache already).
... we can control what is
requested from the server and what is retrieved from the cache with a service worker, which will be explained in detail in the next article — for now let's focus on the structure itself.
...you can <a href="https://github.com/mdn/pwa-examples/blob/master/js13kpwa">fork js13kpwa on github</a> to check its source code.</p> <button id="notifications">
request dummy notifications</button> <section id="content"> // content inserted in here </section> </main> <footer> <p>© js13kgames 2012-2018, created and maintained by <a href="http://end3r.com">andrzej mazur</a> from <a href="http://enclavegames.com">enclave games</a>.</p> </footer> </body> </html> the <head> section contains some basic info like title, description and links to css, web manifest...
...And 2 more matches
Mixed content - Web security
if the attacker observes http
requests to certain images, they could determine which webpage the user is visiting.
... passive content list this section lists all types of http
requests which are considered passive content: <img> (src attribute) <audio> (src attribute) <video> (src attribute) <object> subresources (when an <object> performs http
requests) mixed active content mixed active content is content that has access to all or parts of the document object model of the https page.
... in the mixed active content case, a man-in-the-middle attacker can intercept the
request for the http content.
...And 2 more matches
Web security
the browser may store it and send it back with later
requests to the same server.
... typically, it's used to tell if two
requests came from the same browser — keeping a user logged-in, for example.
... 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.
...And 2 more matches
Cross-domain Content Scripts - Archive of obsolete content
in particular, they can't: access content hosted in an iframe, if that content is served from a different domain make cross-domain xmlhttp
requests however, you can enable these features for specific domains by adding them to your add-on's package.json under the "cross-domain-content" key, which itself lives under the "permissions" key: "permissions": { "cross-domain-content": ["http://example.org/", "http://example.com/"] } the domains listed must include the scheme and fully qualified domain name, and these must exactly match the domains serving the content - so in the example above, the content script will not be allowed to access content served from https://example.com/.
... cross-domain xmlhttp
request the following add-on creates a panel whose content is the summary weather forecast for shetland.
...sdk/ui/button/action").actionbutton({ id: "get-forecast", label: "get the forecast", icon: "./icon-16.png", onclick: function() { forecast_panel.show(); } }); the "panel.html" just includes a <div> block for the forecast: <!doctype html> <!-- panel.html --> <html> <head></head> <body> <div id="forecast_summary"></div> </body> </html> the "panel-script.js" uses xmlhttp
request to fetch the latest forecast: // panel-script.js var url = "http://datapoint.metoffice.gov.uk/public/data/txt/wxfcs/regionalforecast/json/500?key=your-api-key"; self.port.on("show", function () { var
request = new xmlhttp
request();
request.open("get", url, true);
request.onload = function () { var jsonresponse = json.parse(
request.responsetext); var summary = getsummary(jsonrespo...
...nse); var element = document.getelementbyid("forecast_summary"); element.textcontent = summary; };
request.send(); }); function getsummary(forecast) { return forecast.regionalfcst.fcstperiods.period[0].paragraph[0].$; } finally, we need to add the "cross-domain-content" key to "package.json": "permissions": { "cross-domain-content": ["http://datapoint.metoffice.gov.uk"] } content permissions and unsafewindow if you use "cross-domain-content", then javascript values in content scripts will not be available from pages.
passwords - Archive of obsolete content
so: if a web server at http://www.example.com
requested authentication with a response code like this: http/1.0 401 authorization required server: apache/1.3.27 www-authenticate: basic realm="exampleco login" the corresponding values for the credential (excluding username and password) should be: url: "http://www.example.com" realm: "exampleco login" oncomplete and onerror this api is explicitly asynchronous, so all its functions take two c...
... realm string for http authentication credentials, the realm for which the credential was
requested.
... realm string for http authentication credentials, the realm for which the credential was
requested.
... realm string for http authentication credentials, the realm for which the credential was
requested.
places/bookmarks - Archive of obsolete content
bookmark({ title: "mozilla", url: "http://mozilla.com", group: group }), bookmark({ title: "w3", url: "http://w3.org", group: group }) ]; save(bookmarks).on("data", function (item) { // this function will be called three times: // once for each bookmark saved // once for the new group specified implicitly // as the parent of the two items }); the data event is also called for search
requests, with each result being passed individually into its own data event.
...the initial instance of the item that was used for the save
request.
...the initial instance of the item that was used for the save
request.
... arguments array : the array is an ordered list of the input bookmark items, replaced with their updated, latest snapshot instances (the first argument in the data handler), or in the case of an error, the initial instance of the item that was used for the save
request (the second argument in the data or error handler).
HTML to DOM - Archive of obsolete content
although you can now natively parse html using domparser and xmlhttp
request, this is a new feature that is not yet supported by all browsers in use in the wild.
... safely parsing simple html to dom when using xmlhttp
request to get the html of a remote webpage, it is often advantageous to turn that html string into dom for easier manipulation.
... parsing complete html to dom loading an html document seems much simpler if it's loaded using the xmlhttp
request object.
... for that matter, we're going to load our html document first: var
request = xmlhttp
request();
request.open("get", "http://example.org/file.html", false);
request.send(null); our next step is to create the document object that will represent the dom into which we'll insert our newly-retrieved html: var doc = document.implementation.createhtmldocument("example"); doc.documentelement.innerhtml =
request.responsetext; after this any manipulation that we might want to do will be something as simple as the following: doc.body.textcontent = "this is inside the body!"; using a hidden iframe element to parse html to a window's dom sample code may need more work.
Miscellaneous - Archive of obsolete content
simulating mouse and key events https://developer.mozilla.org/samples/domref/dispatchevent.html also, new in firefox 3 / gecko 1.9: var utils = window.queryinterface(components.interfaces.nsiinterface
requestor) .getinterface(components.interfaces.nsidomwindowutils); utils.sendmouseevent("mousedown", 10, 10, 0, 1, 0); utils.sendmouseevent("mouseup", 10, 10, 0, 1, 0); getting the currently selected text from browser.xul overlay context: var selectedtext = document.commanddispatcher.focusedwindow.getselection().tostring(); or: content.getselection(); // |window| object is implie...
...am;1"].createinstance(ci.nsibinaryinputstream); stream.setinputstream(postdata); var postbytes = stream.readbytearray(stream.available()); var poststr = string.fromcharcode.apply(null, postbytes); //do anything to your poststr alert(poststr); getting a string from the input stream is made somewhat simpler in firefox 4, by the addition of netutil.readinputstreamtostring() getting postdata of a
request before the
request is sent the above code will get the postdata for a page that has already loaded.
... to see what the postdata looks like before the
request is even sent, use the 'http-on-modify-
request' observer topic: observerservice.addobserver(observer, 'http-on-modify-
request', false); where "observer" is an object that has a method "observe": function observe(subject, topic, data) { subject.queryinterface(components.interfaces.nsiuploadchannel); postdata = subject.uploadstream; } here again, postdata is not a string, but an nsiinputstream, so you can use the last code snippet of the previous section to get the data as a string.
... however, if you are not going to cancel the
request, you need to "rewind" it by calling: postdata.queryinterface(ci.nsiseekablestream).seek(ci.nsiseekablestream.ns_seek_set, 0); adding custom certificates to a xulrunner application you need to ship a xulrunner application with your own ssl certificates?
Signing an XPI - Archive of obsolete content
certificate common name: xpi test organization: tjworld organization unit: software state or province: nottingham country (must be exactly 2 characters): gb username: tj email address: certificates@lan.tjworld.net generated public/private key pair certificate
request generated certificate has been signed certificate "mytestcert" added to database exported certificate to x509.raw and x509.cacert.
...bug 321156 has been filed to
request a way to obviate the installation of intermediate code signing ca certs into firefox.
... your browser will generate a new private key and code signing
request (csr) in the background without you necessarily realising it.
...after completing the application process where i entered my details into the online application, i received an automated email
requesting documentary evidence of my id in the form of a photo-id or similar.
JXON - Archive of obsolete content
if you have already have a dom tree from using xmlhttp
request, skip to the next paragraph.
... note: if you are using an instance of xmlhttp
request in order to retrieve your xml file, please use the your
request.responsexml property to get a parsed xml document.
... don't use your
request.responsetext!
... alert((new xmlserializer()).serializetostring(newdoc)); }; var oreq = new xmlhttp
request(); oreq.onload = reqlistener; oreq.open("get", "example.xml", true); oreq.send(); jxon.build syntax jxon.build(document[, verbosity[, freeze[, nesteattributes]]]) jxon.build description returns a javascript object based on the given xml document.
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
we start with the
request to load a particular link in a particular window, and proceed up to the point at which the data stream is dispatched to the proper handler.
...alt="(10) getcategoryentry()" coords="575,418,821,418,821,455,629,455,629,484,575,484" href="#categorymanager" shape="poly"> <area alt="(12)" coords="539,133,583,163" href="#stream-converter"> <area alt="(11)" coords="485,133,537,163" href="#contenthandler"> <area alt="(9)" coords="445,132,484,165" href="#nsdocumentopeninfo::dispatchcontent"> <area alt="(8)" coords="405,133,439,162" href="#onstart
request-innards"> <area alt="(7) onstart
request()" coords="639,129,703,129,703,165,833,165,833,204,639,204" href="#onstart
request" shape="poly"> <area alt="(6) asyncopen()" coords="637,121,709,121,709,96,783,96,783,58,637,58" href="#asyncopen" shape="poly"> <area alt="(5) open()" coords="311,306,432,371" href="#open"> <area alt="(4)" coords="90,384,127,417" href="#openuri-innards"> <area alt="(0) registe...
... onstart
request notification comes back from necko nsdocumentopeninfo::onstart
request checks the response status code on the channel for http channels and drops the load on the floor if warranted (e.g.
...if it does so, we abort the entire dispatch process right here and cancel the necko
request; we will not be getting a stream listener to stream data into, since the content handler has taken over completely.
Helper Apps (and a bit of Save As) - Archive of obsolete content
four primary tasks: sets up temporary file and instantiate the nsihelperapplauncherdialog in onstart
request.
... nsexternalapphandler::onstart
request creates a temporary file with a salted name to hold the data.
... nsexternalapphandler::onstop
request set a flag that we're done, then do whatever the user wants if the user has decided (save to disk and open in helper are the current options the user has).
...checks happen in onstart
request, in the helper app dialog, and as a last ditch in the launching code.
Twitter - Archive of obsolete content
in fact it's hardly more than syntactic sugar for doing xmlhttp
requests.
...success is a function that's called when the
request successfully completes, and error is a function called when it fails to complete.
... error(xmlhttp
request, textstatus, errorthrown) xmlhttp
request is the xhr used in the
request.
...with this style you can use any of the various jquery.ajax() options in your
request: data, success, complete, etc.
Tamarin build documentation - Archive of obsolete content
request a build via the form at http://tamarin-builds.mozilla.org/build_trigger/
requestbuild.cfm user email: your email address.
... description: self explanatory check the status of the build @ http://tamarin-builds.mozilla.org/tamarin-redux/ , you can also see your build
request in the queue at http://tamarin-builds.mozilla.org/build_trigger/
requestbuild.cfm.
... if you no longer want you sandbox to build and it has not started yet, you can delete the build
request from the queue from the
request page.
... this is a shared resource, each
request takes approximately 2+ hours to run so please use wisely.
Uploading and Downloading Files - Archive of obsolete content
this operation can also be performed via a script using the xmlhttp
request object.
... a formdata object will automatically generate
request data with mime type multipart/form-data that existing servers can process.
...the formdata object can then simply be passed to xmlhttp
request: function upload(posturl, fieldname, filepath) { var formdata = new formdata(); formdata.append(fieldname, new file(filepath)); var req = new xmlhttp
request(); req.open("post", posturl); req.onload = function(event) { alert(event.target.responsetext); }; req.send(formdata); } http put you can also upload a file using an http put operation.
... function uploadput(posturl, filepath) { var req = new xmlhttp
request(); req.open("put", posturl); req.set
requestheader("content-type", "text/plain"); req.onload = function(event) { alert(event.target.responsetext); } req.send(new file(filepath)); } in this example, a new input stream is created for a file, and is passed to the xmlhttp
request's send method.
panel - Archive of obsolete content
a sliding panel will have the start (or end) position extended such that the panel can be the
requested size, meaning the arrow will no longer be at the start (or end) of the panel - i.e., the arrow will appear to have been slid along the panel to ensure the arrow is still pointing at the anchor.
...this handler is usually used to dynamically set the contents when the user
requests to display it.
...the panel may not appear on the side of the anchor that you
requested in which case the arrow will automatically adjust.
... showing: a
request has been made to open the popup, but it has not yet been shown.
Extentsions FAQ - Archive of obsolete content
these two links should give you a starting point: http://www..xulplanet.com/tutorials/...u/advmenu.html http://www.xulplanet.com/tutorials/x...dommodify.html
request for a thunderbird extension that can automatically detect the default domain when composing e-mails via autodetect.
...x 24px 24px 0px);} to implement a third i would simply change add an attribute and the corresponding css see http://www.w3.org/tr/rec-css2/cascade.html#cascade friday, october 13 - 20, 2006 (↑ top) how to get a refenece to the sidebar window assuming you have chrome privileges, this should work: var ci = components.interfaces; var toplevelwindow = window.queryinterface(ci.nsiinterface
requestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .roottreeitem .queryinterface(ci.nsiinterface
requestor) .getinterface(ci.nsidomwindow) .queryinterface(ci.nsidomchromewindow); var sidebar = toplevelwindow.document.getelementbyid("sidebar"); alert(sidebar.contentdocument); is there anyone successfully using dojo in a firefox...
... what language does it require to write xpcom/xpconnect component that able to intercept,process and redirect http
request?
...can "partial" data be read from the cache while the
request is still in progress?how difficult is to write a firefox extensions that does intercetp, process and redirect http
request?
NPN_PostURLNotify - Archive of obsolete content
url url of the post
request, specified by the plug-in.
... notifydata plug-in-private value for associating the
request with the subsequent npp_urlnotify call, which returns this value (see description below).
... npn_posturlnotify calls npp_urlnotify upon successful or unsuccessful completion of the
request.
... npn_posturlnotify is typically asynchronous: it returns immediately and only later handles the
request and calls npp_urlnotify.
NPP_Write - Archive of obsolete content
can be used to check stream progress or by range
requests from npn_
requestread.
...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.
...in a seekable stream with byte range
requests, you can use this parameter to track npn_
requestread
requests.see also npp_destroystream, npp_newstream, npp_writeready, npstream, npp ...
Building up a basic demo with Three.js - Game development
our render() function will do this job, with a little help from
requestanimationframe(), which causes the scene to be re-rendered constantly on every frame: function render() {
requestanimationframe(render); renderer.render(scene, camera); } render(); on every new frame the render function is invoked, and the renderer renders the scene and the camera.
...add this line of code, right after the
requestanimationframe() invocation inside the render function: cube.rotation.y += 0.01; this rotates the cube on every frame, by a tiny bit, so the animation looks smooth.
...add the following lines, just below the
requestanimationframe() invocation: t += 0.01; torus.scale.y = math.abs(math.sin(t)); we use math.sin, ending up with quite an interesting result.
...add the following, again just below our
requestanimationframe() invocation: dodecahedron.position.y = -7*math.sin(t*2); this will move the dodecahedron up and down, by applying the sin() value to the y axis on each frame, and a little adjustment to make it look cooler.
Audio for Web games - Game development
many browsers will simply ignore any
requests made by your game to automatically play audio; instead playback for audio needs to be started by a user-initiated event, such as a click or tap.
...as long as byte-range
requests are accepted (which is the default behavior), we should be able to jump to a specific point in the audio without having to download the preceding content.
...you'll also reduce the number of server
requests and save bandwidth.
... loading your tracks with the web audio api you can load separate tracks and loops individually using xmlhttp
request or the fetch api, which means you can load them synchronously or in parallel.
Plug-in Development Overview - Gecko Plugin API Reference
npp_print:
request a platform-specific print operation for the instance.
... streams produced by the browser can be automatically sent to the plug-in instance or
requested by the plug-in.
... random-access mode: the browser allows the plug-in to
request specific ranges of bytes from anywhere in the stream.
... use npn_geturl to
request the browser to load a url into a particular browser window or frame for display, or to deliver the data of that url to the plug-in instance in a new stream.
Forbidden header name - MDN Web Docs Glossary: Definitions of Web-related terms
a forbidden header name is the name of any http header that cannot be modified programmatically; specifically, an http
request header name (in contrast with a forbidden response header name).
...names starting with `sec-` are reserved for creating new headers safe from apis using fetch that grant developers control over headers, such as xmlhttp
request.
... forbidden header names start with proxy- or sec-, or are one of the following names: accept-charset accept-encoding access-control-
request-headers access-control-
request-method connection content-length cookie cookie2 date dnt expect feature-policy host keep-alive origin proxy- sec- referer te trailer transfer-encoding upgrade via note: the user-agent header is no longer forbidden, as per spec — see forbidden header name list (this was implemented in firefox 43) — it can now be set in a fetch headers object, or via xhr set
requestheader().
... however, chrome will silently drop the header from fetch
requests (see chromium bug 571722).
HTTP header - MDN Web Docs Glossary: Definitions of Web-related terms
an http header is a field of an http
request or response that passes additional information, altering or precising the semantics of the message or of the body.
... traditionally, headers are classed in categories, though this classification is no more part of any specification: general header: headers applying to both
requests and responses but with no relation to the data eventually transmitted in the body.
...
request header: headers containing more information about the resource to be fetched or about the client itself.
... a basic
request with one header: get /example.http http/1.1 host: example.com redirects have mandatory headers (location): 302 found location: /newpage.html a typical set of headers: 304 not modified access-control-allow-origin: * age: 2318192 cache-control: public, max-age=315360000 connection: keep-alive date: mon, 18 jul 2016 16:06:00 gmt server: apache vary: accept-encoding via: 1.1 3dc30c7222755f86e824b93feb8b5b8c.cloudfront.net (cloudfront) x-amz-cf-id: tol0fem6ui4fgldrkjx0vao5hpkkgzulyn2twd2gawltr7vlnjtvzw== x-backend-s...
WAI-ARIA basics - Learn web development
via xmlhttp
request, or dom apis.
...content that updates without the entire page reloading via a mechanism like xmlhttp
request, fetch, or dom apis.
...in this example we have a simple random quote box: <section> <h1>random quote</h1> <blockquote> <p></p> </blockquote> </section> our javascript loads a json file via xmlhttp
request containing a series of random quotes and their authors.
... note: most browsers will throw a security exception if you try to do an xmlhttp
request call from a file:// url, e.g.
Tips for authoring fast-loading HTML pages - Learn web development
minimize the number of files reducing the number of files referenced in a web page lowers the number of http connections required to download a page, thereby reducing the time for these
requests to be sent, and for their responses to be received.
... depending on a browser's cache settings, it may send a
request with the if-modified-since header for each referenced file, asking whether the file has been modified since the last time it was downloaded.
...however, the fewer http
requests and single image caching can help reduce page-load time.
...it can be somewhat involved, but it will save a lot in page
requests on pages which would normally not be cacheable.
Introduction to automated testing - Learn web development
give it the following contents: const
request = require("
request"); let bsuser = "browserstack_username"; let bskey = "browserstack_access_key"; let baseurl = "https://" + bsuser + ":" + bskey + "@www.browserstack.com/automate/"; function getplandetails(){
request({uri: baseurl + "plan.json"}, function(err, res, body){ console.log(json.parse(body)); }); /* response: { automate_plan: <string>, paralle...
... function getbuilds(){
request({uri: baseurl + "builds.json"}, function(err, res, body){ console.log(json.parse(body)); }); /* response: [ { automation_build: { name: <string>, duration: <int>, status: <string>, hashed_id: <string> } }, { automation_build: { name: <string>, duration: <int>, status: <string>, hashed_id: <string> } }, ...
... ] */ }; function getsessionsinbuild(build){ let buildid = build.automation_build.hashed_id;
request({uri: baseurl + "builds/" + buildid + "/sessions.json"}, function(err, res, body){ console.log(json.parse(body)); }); /* response: [ { automation_session: { name: <string>, duration: <int>, os: <string>, os_version: <string>, browser_version: <string>, browser: <string>, device: <string>, status: <string>, hashed_id: <string>, reason: <string>, build_name: <string>, project_name: <string>, logs: <string>, browser_url: <string>, public_url: <string>, video_url: <string>, browser_console_logs_url: <string>, har_logs_url: <string> } }, { automation_session: { name: <string>, duration: <int>, o...
... ] */ } function getsessiondetails(session){ let sessionid = session.automation_session.hashed_id;
request({uri: baseurl + "sessions/" + sessionid + ".json"}, function(err, res, body){ console.log(json.parse(body)); }); /* response: { automation_session: { name: <string>, duration: <int>, os: <string>, os_version: <string>, browser_version: <string>, browser: <string>, device: <string>, status: <string>, hashed_id: <string>, reason: <string>, build_name: <string...
Mozilla accessibility architecture
the first
request for an accessible is usually the accessible for document in one of the open windows, and the code in widget/src/gtk2 or widget/src/windows must return this doc accessible.
...no matter how the assistive technology client
requests the data, the accessible for a given node is only created once.
... performance: by caching the accessible node for each dom node in a hash table, we can hand back accessibles extremely quickly, and avoid recalculating and creating new accessibles every time one is
requested for a certain dom node.
... we also avoid calculating the children of an accessible twice, once for getaccchildcount() and again when the specific children are
requested.
Mozilla’s UAAG evaluation report
(p2) c preferences, advanced, scripts & windows - allow scripts to "open un
requested windows" 5.2 keep viewport on top.
...(p2) vg preferences, advanced, scripts & windows - allow scripts to "open un
requested windows" we do not have a strategy to "alert the user and allow the user to open it on demand" we do not have exposed prefs for all of our popup control options.
...(p1) g provides sequential access to links and input form controls cannot navigate to non-links and non-input form controls with event handlers cannot configure mozilla to only allow focus changes on explicit user
request 9.4 restore history.
...however, any such use should be carefully considered, given the potential impact on network traffic of automatically making such
requests for every link/object in the page.
Adding phishing protection data providers
to find an id number to use, you can build a loop that
requests the value of browser.safebrowsing.provider.0.name, then browser.safebrowsing.provider.1.name, and so forth until no value is returned.
... browser.safebrowsing.provider.idnum.keyurl an url that returns a private key to be used for encrypting of other
requests.
...this
request must be encrypted using the private key returned by the keyurl
request.
... browser.safebrowsing.provider.idnum.updateurl an url used to
request an updated list of phishing sites.
HTMLIFrameElement.executeScript()
syntax var mydom
request = instanceofhtmliframeelement.executescript(script, options); return value a dom
request object that returns an onsuccess handler if the script is successfully executed against the loaded content, or an onerror handler if not.
... examples var
request1 = browser.executescript( var a = 3; a + 3 , {url: 'http://example.com/index.html'});
request1.onsuccess = function() { console.log(
request1.result); // 6 } var
request2 = browser.executescript( new promise((resolve, reject) => { settimeout(function() { resolve(6); }, 1000}) ) , {origin: 'http://example.com'});
request2.onsuccess = function() { console.log(
request2.re...
...sult); // 6 } if the script value is a not a promise, it is simply returned as the
request value.
... if the script value is a promise, the result of the
request will be the promise-resolved value.
HTMLIFrameElement.getContentDimensions()
syntax var instanceofdom
request = instanceofhtmliframeelement.getcontentdimensions(); returns a dom
request for handling the dimensions
request.
... its
request.onsuccess handler handles the success case, and its
request.onerror handler handles the failure case.
... the x and y dimensions are available in the
request.result.x and
request.result.y properties, respectively.
... examples var browser = document.queryselector('iframe'); var
request = browser.getcontentdimensions();
request.onsuccess = function() { console.log("page size:",
request.result.width + "x" +
request.result.height); }
request.onerror = function() { console.log("download error"); } specification not part of any specification.
HTMLIFrameElement.getMuted()
syntax there are two versions of this method, a callback version: var
request = instanceofhtmliframeelement.getmuted(); and a promise version: instanceofhtmliframeelement.getmuted().then(function(muted) { ...
... }); returns callback version: a dom
request that represents the get muted
request.
...the muted value is available in the
request.result property, and is a boolean value — true means muted, and false means unmuted.
... example callback version: var browser = document.queryselector('iframe'); var
request = browser.getmuted();
request.onsuccess = function() { if(
request.result) { console.log('the browser is muted.'); } else { console.log('the browser is unmuted.'); } } promise version: var browser = document.queryselector('iframe'); browser.getmuted().then(function(muted) { if(muted) { console.log('the browser is muted.'); } else { console.log('the browser is unmuted.'); } }); specification not part of any specification.
HTMLIFrameElement.getScreenshot()
the getscreenshot() method of the htmliframeelement lets you
request a screenshot of a content <iframe>, scaled to fit within a specified maximum width and height.
... syntax var instanceofdom
request = instanceofhtmliframeelement.getscreenshot(maxwidth, maxheight, mimetype); returns a dom
request for handling the screenshot
request.
... its
request.onsuccess handler handles the success case (the screenshot is contained in
request.result as a blob object), and its
request.onerror handler handles the failure case.
... examples var browser = document.queryselector('iframe'); var
request = browser.getscreenshot(100, 100);
request.onsuccess = function() { var blob =
request.result; var url = url.createobjecturl(blob); } specification not part of any specification.
HTMLIFrameElement.getVisible()
the getvisible() method of the htmliframeelement is used to
request the current visible state of the browser <iframe>.
... syntax instanceofdom
request = instanceofhtmliframeelement.getvisible(); returns a dom
request object to handle the getvisible()
request's success and error cases.
... if the
request is successful, the
request's result is a boolean indicating the visible state of the browser <iframe>.
... example var browser = document.queryselector('iframe'); var
request = browser.getvisible();
request.onsuccess = function() { console.log('the visible state is: ' + this.result ?
HTMLIFrameElement.getVolume()
syntax there are two versions of this method, a callback version: var
request = instanceofhtmliframeelement.getvolume(); and a promise version: instanceofhtmliframeelement.getvolume().then(function(volume) { ...
... }); returns callback version: a dom
request that represents the get volume
request.
...the volume value is available in the
request.result property, and is a floating point number between 0 and 1.
... example callback version: var browser = document.queryselector('iframe'); var
request = browser.getvolume();
request.onsuccess = function() { console.log('the current browser volume is ' +
request.result); } promise version: var browser = document.queryselector('iframe'); browser.getvolume().then(function(volume) { console.log('the current browser volume is ' + volume); }); specification not part of any specification.
MozBeforePaint
whenever you're ready to refresh your animation, you call the window.
requestanimationframe() method.
... the timestamp property of this event will be set to the time when the animation frame is sampled; this is relevant when trying to synchronize moz
requestanimationframe animations with smil animations or css transitions.
... <!doctype html> <html> <body> <div id="d" style="width:100px; height:100px; background:lime; position:relative;"></div> <script> var d = document.getelementbyid("d"); var start = window.mozanimationstarttime; function step(event) { var progress = event.timestamp - start; d.style.left = math.min(progress/10, 200) + "px"; if (progress < 2000) { window.moz
requestanimationframe(); } else { window.removeeventlistener("mozbeforepaint", step, false); } } window.addeventlistener("mozbeforepaint", step, false); window.moz
requestanimationframe(); </script> </body> </html> as you can see, each time the mozbeforepaint event fires, our step() method is called.
... this computes the current position for the animating box and updates the box's position on screen, and, if the animation sequence is not yet complete, calls window.
requestanimationframe() to schedule the next animation frame to be drawn.
Infallible memory allocation
these are memory allocation routines that never return null; that is, they always successfully return the
requested block of memory.
... this is in contrast to a traditional, fallible memory allocator that can return null indicating that the
request failed.
... the term "infallible" means that your memory allocation
request is guaranteed to succeed: your code can never see a failed
request, and so doesn't need to check for failure.
...you should do this for large memory allocations because in extremely low memory conditions, as described in how can memory allocation be infallible?, the application may terminate if an infallible allocator can't find the memory you
requested.
AddonManager
callbacks installcallback() a callback that is passed a single addoninstall void installcallback( in addoninstall install ) parameters install the addoninstall passed back from the asynchronous
request installlistcallback() a callback that is passed an array of addoninstalls void installlistcallback( in addoninstall installs[] ) parameters installs the array of addoninstalls passed back from the asynchronous
request addoncallback() a callback that is passed a single addon void addoncallback( in addon addon ) parameters addon the addon passed back from the asynchronous requ...
... addonlistcallback() a callback that is passed an array of addons void addonlistcallback( in addon addons[] ) parameters addons the array of addons passed back from the asynchronous
request constants addoninstall states constant description state_available an install that is waiting to be started.
... update check reasons constant description update_when_user_
requested an update check performed at the explicit
request of the user.
...k to pass the addoninstall to mimetype the mimetype of the add-on hash an optional hash of the add-on name an optional placeholder name while the add-on is being downloaded iconurl an optional placeholder icon url while the add-on is being downloaded version an optional placeholder version while the add-on is being downloaded loadgroup an optional nsiloadgroup to associate any network
requests with getinstallforfile() asynchronously gets an addoninstall for an nsifile.
DeferredTask.jsm
method overview bool ispending();obsolete since gecko 28 void start();obsolete since gecko 28 void flush();obsolete since gecko 28 void cancel();obsolete since gecko 28 void arm(); void disarm(); promise finalize(); attributes isarmed boolean indicates whether the task is currently
requested to start again later, regardless of whether it is currently running.
... void cancel(); arm
request the execution of the task after the delay specified on construction.
... void arm(); disarm cancel any
request for a delayed execution of the task, though the task itself cannot be canceled in case it is already running.
...}, 2000); // the task is ready, but will not be executed until
requested.
Download
this property becomes true as soon as the cancel() method is called, though the stopped property might remain false until the cancellation
request has been processed.
... the cancellation
request is asynchronous.
... in case the download completes successfully before the cancellation
request could be processed, this method has no effect, and it returns a resolved promise.
...this behavior is designed for the case where the call to cancel happens asynchronously, and is consistent with the case where the cancellation
request could not be processed in time.
Initial setup
add a
request about creating your locale's repository to the new locales newsgroup.
...add a
request about creating your locale's repository to the new locales newsgroup.
...add a
request about creating your ldap account to the new locales newsgroup.
...add a
request about creating your locale's bugzilla component to the new locales newsgroup.
DMD
unreported { 150 blocks in heap block record 283 of 5,495 21,600 bytes (20,400
requested / 1,200 slop) individual block sizes: 144 x 150 0.00% of the heap (16.85% cumulative) 0.02% of unreported (94.68% cumulative) allocated at { #01: replace_malloc (/home/njn/moz/mi5/go64dmd/memory/replace/dmd/../../../../memory/replace/dmd/dmd.cpp:1286) #02: malloc (/home/njn/moz/mi5/go64dmd/memory/build/../../../memory/build/replace_malloc.c:153) #03: moz_xmalloc (/home/njn/m...
...nt, unsigned int, bool) (/home/njn/moz/mi5/dom/xml/nsxmlcontentsink.cpp:1007) } } it tells you that there were 150 heap blocks that were allocated from the program point indicated by the "allocated at" stack trace, that these blocks took up 21,600 bytes, that all 150 blocks had a size of 144 bytes, and that 1,200 of those bytes were "slop" (wasted space caused by the heap allocator rounding up
request sizes).
...for example: unreported { 420,010 blocks in heap block record 2 of 5,495 29,203,408 bytes (27,777,288
requested / 1,426,120 slop) individual block sizes: 2,048 x 3; 1,024 x 103; 512 x 147; 496 x 7; 480 x 31; 464 x 6; 448 x 50; 432 x 41; 416 x 28; 400 x 53; 384 x 43; 368 x 216; 352 x 141; 336 x 58; 320 x 104; 304 x 5,130; 288 x 150; 272 x 591; 256 x 6,017; 240 x 1,372; 224 x 93; 208 x 488; 192 x 1,919; 176 x 18,903; 160 x 1,754; 144 x 5,041; 128 x 36,709; 112 x 5,571; 96 x 6,280; 80 x 40,738; 64 x 37,92...
...rted (57.53% cumulative) allocated at { #01: (no stack trace recorded due to --stacks=partial) } } in contrast, stack traces are always recorded when a block is reported, which means you can end up with records like this where the allocation point is unknown but the reporting point is known: once-reported { 104,491 blocks in heap block record 13 of 4,689 10,392,000 bytes (10,392,000
requested / 0 slop) individual block sizes: 512 x 124; 256 x 242; 192 x 813; 128 x 54,664; 64 x 48,648 1.35% of the heap (48.65% cumulative) 1.64% of once-reported (59.18% cumulative) allocated at { #01: (no stack trace recorded due to --stacks=partial) } reported at { #01: mozilla::dmd::dmdfuncs::report(void const*) (/home/njn/moz/mi5/go64dmd/memory/replace/dmd/../../../../memory/rep...
PR_Interrupt
sets the interrupt
request for a target thread.
... syntax #include <prthread.h> prstatus pr_interrupt(prthread *thread); parameter pr_interrupt has the following parameter: thread the thread whose interrupt
request you want to set.
... description the purpose of pr_interrupt is to
request that a thread performing some task stop what it is doing and return to some control point.
... the interrupt
request remains in the thread's state until it is delivered exactly once or explicitly canceled.
PR_NewTCPSocket
a tcp connection is established by a passive socket (the server) accepting a connection setup
request from an active socket (the client).
... typically, the server binds its socket to a well-known port with pr_bind, calls pr_listen to start listening for connection setup
requests, and calls pr_accept to accept a connection.
... the client makes a connection
request using pr_connect.
...pr_acceptread is suitable for use by the server to accept a new client connection and read the client's first
request in one function call.
PR_OpenTCPSocket
a tcp connection is established by a passive socket (the server) accepting a connection setup
request from an active socket (the client).
... typically, the server binds its socket to a well-known port with pr_bind, calls pr_listen to start listening for connection setup
requests, and calls pr_accept to accept a connection.
... the client makes a connection
request using pr_connect.
...pr_acceptread is suitable for use by the server to accept a new client connection and read the client's first
request in one function call.
Threads
a thread is created by an explicit client
request and remains a valid, independent execution entity until it returns from its root function or the process abnormally terminates.
... 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.
Python binding for NSS
ntext nss.nss_shutdown_context release 0.15.0 release date 2014-09-09 scm tag pynss_release_0_15_0 source download https://ftp.mozilla.org/pub/mozilla.org/security/python-nss/releases/pynss_release_0_15_0/src/ change log the primary enhancements in this version was fixing access to extensions in a certificate
request and giving access to certificate
request attributes.
...see test/test_cert_
request.py for examples.
... the following classes were added: certattribute the following class methods were added: certattribute.format_lines certattribute.format nss.secitem.get_integer the following class properties were added: certificate
request.attributes certattribute.type_oid certattribute.type_tag certattribute.type_str certattribute.values the following module functions were added: base64_to_binary the following files were added: test_cert_
request release 0.14.1 release date 2013-10-28 scm ta...
...n-nss now compatible with standard library rewrite httplib_example.py to use standard library and illustrate ssl, non-ssl, connection class, http class usage the following classes were added: authkeyid basicconstraints crldistributionpoint crldistributionpts certificateextension generalname signedcrl dn rdn ava certificate
request the following module functions were added: nss.nss.nss_is_initialized() nss.nss.cert_crl_reason_from_name() nss.nss.cert_crl_reason_name() nss.nss.cert_general_name_type_from_name() nss.nss.cert_general_name_type_name() nss.nss.cert_usage_flags() nss.nss.decode_der_crl() nss.nss.der_universal_secitem_fmt_lines() nss.nss.import_crl() ...
gtstd.html
>certutil -a -d server_db -n "myco's root ca" -t "tc,," -a -i ca_db/rootca.crt create the server certificate
request, specifying the subject name for the server certificate.
... >certutil -r -d server_db -s "cn=myco.mcom.org,o=myco,st=california,c=us" -a -o server_db/server.req enter password or pin for "communicator certificate db": this step simulates the ca signing and issuing a new server certificate based on the server's certificate
request.
... >certutil -a -d client_db -n "myco's root ca" -t "tc,," -a -i ca_db/rootca.crt create the client certificate
request, specifying the subject name for the certificate.
... >certutil -r -d client_db -s "cn=joe client,o=myco,st=california,c=us" -a -o client_db/client.req enter password or pin for "communicator certificate db": this step simulates the ca signing and issuing a new client certificate based on the client's certificate
request.
Necko Interfaces Overview
scheme, host, path, ...) per protocol implementation necko provides uri impl's for common uri formats (see nsstandardurl, nssimpleuri) nsichannel : nsi
request represents a logical connection to the resource identified by a nsiuri per protocol implementation single use (ie.
... channel is used to download the resource once) download initiated via nsichannel::asyncopen method can be canceled via nsi
request::cancel method at anytime after invocation of asyncopen method nsiprotocolhandler a service that manages a protocol, identified by it's uri scheme (eg.
... http) maps uri string to nsiuri instance via newuri method creates nsichannel instance from nsiuri instance via newchannel method nsistreamlistener : nsi
requestobserver implemented by the consumer of a nsichannel instance passed to nsichannel::asyncopen method nsi
requestobserver::onstart
request - notifies start of async download nsistreamlistener::ondataavailable - notifies presence of downloaded data nsi
requestobserver::onstop
request - notifies completion of async download, possibly w/ error nsiloadgroup : nsi
request attribute of a nsi
request channel impl adds itself to its load group during invocation of asyncopen channel impl removes itself from its load group when download completes load groups in gecko own all channels used to load a particular page (until the channels comp...
...lete) all channels owned by a load group can be canceled at once via the load group's nsi
request::cancel method nsitransport represents a physical connection, such as a file descriptor or a socket used directly by protocol handler implementations (as well as by mailnews and chatzilla) synchronous i/o methods: openinputstream, openoutputstream asynchronous i/o methods: asyncread, asyncwrite nsitransport::asyncread takes a nsistreamlistener parameter original document information author(s): darin fisher last updated date: december 10, 2001 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details.
Index
191 js_begin
request jsapi reference, spidermonkey indicates to the js engine that the calling thread is entering a region of code that may call into the jsapi but does not block.
... 463 js_setinterruptcallback jsapi_reference, reference, spidermonkey these functions allow setting an interrupt callback that will be called from the js thread some time after any thread triggered the callback using js_
requestinterruptcallback.
...js_stringtoversion may return any of the following values: 487 js_suspend
request jsapi reference, spidermonkey suspends the calling thread's current
request, if any, to allow the thread to block or perform time-consuming calculations.
...js_versiontostring may return any of the following values: 504 js_yield
request jsapi_reference, spidermonkey momentarily suspend the current jsapi
request, allowing garbage collection to run if another thread has
requested it.
JS_LookupProperty
requires
request.
... in a js_threadsafe build, the caller must be in a
request on this jscontext.
... flags unsigned (only in js_lookuppropertywithflags) a combination of bits
requesting special search behavior.
...flags js_lookuppropertywithflags and js_lookuppropertywithflagsbyid allow the caller to specify flags
requesting special lookup behavior.
A Web PKI x509 certificate primer
generate csr using this command: openssl req -new -key key.pem -days 1096 -extensions v3_ca -batch -out example.csr -utf8 -subj '/cn=www.example.com' this creates a new certificate signing
request (csr) that will be valid for 3 years.
... generate csr "openssl req -new -key rootkey.pem -days 5480 -extensions v3_ca -batch -out root.csr -utf8 -subj '/c=us/o=orgname/ou=someinternalname' make a new certificate signing
request (csr) that will be valid for 15 years.
... generate csr "openssl req -new -key intkey.pem -days 2922 -extensions v3_ca -batch -out int.csr - utf8 -subj '/c=us/o=orgname/ou=someinternalname2' make a new certificate signing
request (csr) that will be valid for 8 years.
... generate csr "openssl req -new -key key.pem -days 1096 -extensions v3_ca -batch -out example.csr - utf8 -subj '/cn=www.example.com' make a new certificate signing
request (csr) that will be valid for 3 years.
An Overview of XPCOM
if the object supports the
requested interface, it adds a reference to itself and passes back a pointer to that interface.
...but casting can become more involved where you must first cast void then to the
requested type, because you must return the interface pointer in the vtable corresponding to the
requested interface.
...instead, a contract id only specifies a given set of interfaces that it wants implemented, and any number of different cids may step in and fill that
request.
... ns_error_factory_not_registered returned when a
requested class is not registered.
Finishing the Component
after that, * they can
request specific services by calling getservice.
... the web locking policy that we are going to put into place is quite simple: for every load
request that comes through, we will ensure that the uri is in the list of "good" urls on the white list.
...the networking library, necko, deals only with these interfaces when handling
requests.
...nsiioservice is the part of the networking library ("necko") that's responsible for kicking off network
requests, managing protocols such as http, ftp, or file, and creating nsiuris.
amIWebInstallListener
/ thunderbird 8.0 / seamonkey 2.5) method overview boolean onwebinstallblocked(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); void onwebinstalldisabled(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); boolean onwebinstall
requested(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal.
... onwebinstall
requested() called when a website wants to ask the user to install add-ons.
... boolean onwebinstall
requested( in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, in pruint32 acount optional ); parameters awindow the window that triggered the installs.
... ainstalls the addoninstalls that were
requested.
nsIAsyncInputStream
if the stream implements nsiasyncinputstream, then the caller can use this interface to
request an asynchronous notification when the stream becomes readable or closed (via the asyncwait() method).
...method overview void asyncwait(in nsiinputstreamcallback acallback, in unsigned long aflags, in unsigned long a
requestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult astatus); constants constant value description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the oninputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in the underl...
...void asyncwait( in nsiinputstreamcallback acallback, in unsigned long aflags, in unsigned long a
requestedcount, in nsieventtarget aeventtarget ); parameters acallback this object is notified when the stream becomes ready.
...a
requestedcount wait until at least this many bytes can be read.
nsIAsyncOutputStream
if the stream implements nsiasyncoutputstream, then the caller can use this interface to
request an asynchronous notification when the stream becomes writable or closed (via the asyncwait() method).
...method overview void asyncwait(in nsioutputstreamcallback acallback, in unsigned long aflags, in unsigned long a
requestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult reason); constants constant value description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default behavior, causing the onoutputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in the un...
...void asyncwait( in nsioutputstreamcallback acallback, in unsigned long aflags, in unsigned long a
requestedcount, in nsieventtarget aeventtarget ); parameters acallback this object is notified when the stream becomes ready.
...a
requestedcount wait until at least this many bytes can be written.
nsIAuthPromptProvider
netwerk/base/public/nsiauthpromptprovider.idlscriptable this interface
requests a prompt interface for the given prompt reason.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getauthprompt(in pruint32 apromptreason, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result); constants constant value description prompt_normal 0 normal (non-proxy) prompt
request.
... prompt_proxy 1 proxy authentication
request.
... methods getauthprompt() this method
requests a prompt interface for the given prompt reason.
nsIChannelEventSink
these methods are called before onstart
request.
...new
requests for this resource should continue to use the uri of the old channel.
...new
requests for this resource should use the uri of the new channel (this might be an http 301 reponse).
... exceptions thrown this method can throw any exception; if an exception occurs, the load will be canceled, and no network
requests will occur for the new channel.
nsIComponentManager
(see also nsifactory.createinstance.) void createinstance( in nscidref aclass, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters aclass the classid of the object instance that is being
requested.
... void createinstancebycontractid( in string acontractid, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters acontractid the contractid of the object instance that is being
requested.
... void getclassobject( in nscidref aclass, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters aclass the classid of the factory that is being
requested.
... void getclassobjectbycontractid( in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters acontractid the contractid of the factory that is being
requested.
nsIDNSService
resolve_speculate (1 << 4) indicates
request is speculative.
... speculative
requests return errors if prefetching is disabled by configuration.
...any pending asynchronous
requests will be canceled, and the local cache of dns records will be cleared.
...example let dnsservice = components.classes["@mozilla.org/network/dns-service;1"] .createinstance(components.interfaces.nsidnsservice); let thread = components.classes["@mozilla.org/thread-manager;1"] .getservice(components.interfaces.nsithreadmanager).currentthread; let host = "www.mozilla.org"; let listener = { onlookupcomplete: function(
request, record, status) { if (!components.issuccesscode(status)) { // handle error here return; } let address = record.getnextaddrasstring(); console.log(host + " = " + address); } }; dnsservice.asyncresolve(host, 0, listener, thread); ...
nsIEffectiveTLDService
return value an acstring containing the base domain (public suffix plus the
requested number of additional parts).
... ns_error_insufficient_domain_levels this exception is thrown if there were insufficient subdomain levels in the hostname to satisfy the
requested aadditionalparts value.
... return value an acstring containing the base domain (public suffix plus the
requested number of additional parts).
... ns_error_insufficient_domain_levels this exception is thrown if there were insufficient subdomain levels in the hostname to satisfy the
requested aadditionalparts value.
nsIExternalHelperAppService
vice, use: var externalhelperappservice = components.classes["@mozilla.org/uriloader/external-helper-app-service;1"] .getservice(components.interfaces.nsiexternalhelperappservice); method overview boolean applydecodingforextension(in autf8string aextension, in acstring aencodingtype); nsistreamlistener docontent(in acstring amimecontenttype, in nsi
request a
request, in nsiinterface
requestor awindowcontext, in boolean aforcesave); methods applydecodingforextension() determines whether or not data whose filename has the specified extension should be decoded from the specified encoding type before being saved or delivered to helper applications.
...when the onstop
request is issued, the stream listener implementation will launch the helper app with this data.
... nsistreamlistener docontent( in acstring amimecontenttype, in nsi
request a
request, in nsiinterface
requestor awindowcontext, in boolean aforcesave ); parameters amimecontenttype the content type of the incoming data.
... a
request the
request corresponding to the incoming data.
nsIHttpHeaderVisitor
netwerk/protocol/http/nsihttpheadervisitor.idlscriptable this interface is used to view http
request and response headers.
... inherits from: nsisupports last changed in gecko 1.7 method overview void visitheader(in acstring aheader, in acstring avalue); methods visitheader() called by the nsihttpchannel implementation when visiting
request and response headers.
... this._isflash = false; }; mynsihttpheadervisitor.prototype.visitheader = function ( aheader, avalue ) { if ( aheader.indexof( "content-type" ) !== -1 ) { if ( avalue.indexof( "application/x-shockwave-flash" ) !== -1 ) { this._isflash = true; } } }; mynsihttpheadervisitor.prototype.isflash = function ( ) { return this._isflash; }; myhttp
requestobserver = function ( ) { this.register( ); this.aborted = components.results.ns_binding_aborted; this.nsihttpchannel = components.interfaces.nsihttpchannel; this.nsichannel = components.interfaces.nsichannel; this.nsi
request = components.interfaces.nsi
request; }; myhttp
requestobserver.prototype.observe = function ( subject, topic, data ) { var uri...
...visitor; if ( subject instanceof this.nsihttpchannel ) { avisitor = new mynsihttpheadervisitor( ); subject.visitresponseheaders( avisitor ); if ( avisitor.isflash( ) ) { uri = subject.uri; subject.cancel( this.aborted ); alert( "found flash!" ); //handle flash file here } } }; myhttp
requestobserver.prototype.register = function ( ) { var observerservice = components.classes[ "@mozilla.org/observer-service;1" ].getservice( components.interfaces.nsiobserverservice ); observerservice.addobserver(this, "http-on-examine-response", false); observerservice.addobserver(this, "http-on-examine-cached-response", false); }; myhttp
requestobserver.prototype.unregister = f...
nsIModule
aclass the classid of object instance
requested.
... aiid the iid of interface
requested.
... exceptions thrown ns_error_factory_not_registered indicates that the
requested class is not available.
... ns_error_no_interface indicates that the
requested interface is not supported.
nsIPrefService
is used, the branch will be able to easily access the preferences browser.startup.page, browser.startup.homepage, and browser.startup.homepage_override by simply
requesting page, homepage, or homepage_override.
... return value nsiprefbranch - the object representing the
requested branch.
...is used, the branch will be able to easily access the preferences browser.startup.page, browser.startup.homepage, and browser.startup.homepage_override by simply
requesting page, homepage, or homepage_override.
... return value nsiprefbranch - the object representing the
requested default branch.
nsIRadioInterfaceLayer
to create an instance, use: var radiointerfacelayer = components.classes["@mozilla.org/telephony/system-worker-manager;1"] .getservice(components.interfaces.nsiinterface
requestor) .createinstance(components.interfaces.nsiradiointerfacelayer); method overview void answercall(in unsigned long callindex); void deactivatedatacall(in domstring cid, in domstring reason); void dial(in domstring number); void enumeratecalls(in nsiriltelephonycallback callback); void getdatacalllist(); unsigned short getnumberofmessagesfortext(in domstring...
... text); void hangup(in unsigned long callindex); void registercallback(in nsiriltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejectcall(in unsigned long callindex); void sendsms(in domstring number, in domstring message, in long
requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype); void starttone(in domstring dtmfchar); void stoptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsirildatacallback callback); attributes attribute type description currentstate jsval read only.
...void sendsms( in domstring number, in domstring message, in long
requestid, in unsigned long long processid ); parameters number a domstring with a telephone number to send to.
...
requestid missing description processid missing description setupdatacall() pdp apis.
nsITextInputProcessorCallback
dom/interfaces/base/nsitextinputprocessor.idlscriptable a callback interface for nsitextinputprocessor user 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) nsitextinputprocessorcallback is defined for receiving
requests and notifications to ime from gecko.
... example of simple js-ime: var simpleime = { _hasfocus: false, _hasrightstocompose: false, _tip: null, _callback: function simpleime_callback(atip, anotification) { try { switch (anotification.type) { case "
request-to-commit": atip.commitcomposition(); break; case "
request-to-cancel": atip.cancelcomposition(); break; case "notify-focus": this._hasfocus = true; break; case "notify-blur": this._hasfocus = false; break; case "notify-detached": this._hasfocus = false; this._hasrightstocompose = false; break; } return true; ...
... }, } method overview boolean onnotify(in nsitextinputprocessor atextinputprocessor, in nsitextinputprocessornotification anotification); methods onnotify() this is called when gecko
requests or notifies something to ime.
... anotification a notification or
request.
nsIUpdateCheckListener
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void oncheckcomplete(in nsixmlhttp
request request, [array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); void onerror(in nsixmlhttp
request request, in nsiupdate update); void onprogress(in nsixmlhttp
request request, in unsigned long position, in unsigned long totalsize); methods oncheckcomplete() called when the update check is completed.
... void oncheckcomplete( in nsixmlhttp
request request, [array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount ); parameters
request the nsixmlhttp
request object handling the update check.
...void onerror( in nsixmlhttp
request request, in nsiupdate update ); parameters
request the nsixmlhttp
request object handling the update check.
...void onprogress( in nsixmlhttp
request request, in unsigned long position, in unsigned long totalsize ); parameters
request the nsixmlhttp
request object handling the update check.
XPCOM Interface Reference by grouping
nloadprogresslistener element internal nsiworker nsiworkerglobalscope nsiworkermessageevent nsiworkermessageport nsiworkerscope tree nsitreeboxobject nsitreecolumn nsitreecolumns nsitreecontentview nsitreeselection nsitreeview xform nsixformsmodelelement nsixformsnsinstanceelement nsixformsnsmodelelement xmlhttp
request nsixmlhttp
requesteventtarget favicon nsifavicondatacallback nsifaviconservice frame nsichromeframemessagemanager nsiframeloader nsiframeloaderowner nsiframemessagelistener nsiframemessagemanager interface nsijsxmlhttp
request jetpack nsijetpack nsijetpackservice offlinestorage nsiapplicationcache nsiappl...
... nsisupportsprint64 nsisupportspriority nsisupportsprtime nsisupportspruint16 nsisupportspruint32 nsisupportspruint64 nsisupportspruint8 nsisupportsstring nsisupportsvoid nsisupportsweakreference nsivariant do not use nsienumerator nsiinprocesscontentframemessagemanager nsiscriptableio nsixpcscriptable future nsixmlhttp
requestupload obsolete nsixmlrpcclient nsixmlrpcfault security auth nsiauthmodule nsiauthprompt nsiauthpromptprovider nsiauthpromptwrapper nsiasyncverifyredirectcallback content nsicontentpolicy credentials nsilogininfo nsiloginmanager using nsiloginman...
...ead nsithread nsithreadeventfilter nsithreadinternal nsithreadmanager nsithreadobserver nsithreadpool nsithreadpoollistener nsitoolkit util nsiversioncomparator nsiweakreference nsifactory nsiinterface
requestor nsijscid nsijsid nsijsiid nsimodule nsiobserver nsiobserverservice nsiproperties nsiproperty nsipropertybag nsipropertybag2 nsipropertyelement nsiserversocket nsiserversocketlistener nsiservicemanager nsisocketprovider nsisocketproviderservice nsisockettranspor...
... file nsifilepicker nsifileprotocolhandler nsifilespec nsifilestreams nsifileutilities nsifileview memory nsimemory network channel nsichannel nsichanneleventsink nsi
request nsi
requestobserver nsiresumablechannel nsidnsservice nsiftpchannel nsiftpeventsink nsihttpchannel nsihttpchannelinternal nsihttpheadervisitor nsiidnservice nsiprotocolhandler nsiprotocolproxycallback nsiprotocolproxyfilter nsiprotocolproxyservice nsiproxyinfo...
Plug-in Development Overview - Plugins
npp_print:
request a platform-specific print operation for the instance.
... streams produced by the browser can be automatically sent to the plug-in instance or
requested by the plug-in.
... random-access mode: the browser allows the plug-in to
request specific ranges of bytes from anywhere in the stream.
... use npn_geturl to
request the browser to load a url into a particular browser window or frame for display, or to deliver the data of that url to the plug-in instance in a new stream.
Network Monitor - Firefox Developer Tools
the network monitor shows you all the network
requests firefox makes (for example, when it loads a page, or due to xmlhttp
requests), how long each
request takes, and details of each
request.
...when it first opens, the network monitor does not show
request information.
...once the tool is monitoring network
requests, the display looks like this: when it is actively monitoring activity, the network monitor records network
requests any time the toolbox is open, even if the network monitor itself is not selected.
... ui overview the ui is divided into four main pieces: the main screen contains the toolbar, the network
request list, and the network
request details pane: the performance analysis view is a separate screen: working with the network monitor the following articles cover different aspects of using the network monitor: toolbar network
request list network
request details network traffic recording performance analysis throttling ...
Tips - Firefox Developer Tools
network monitor click the
request summary to compare performance of cache vs.
... when a
request is selected click "edit and resend" to modify its headers and send it again.
... check "enable persistent logs" in the settings to keep
requests from before even after navigation.
... hover the "js" icon within the "cause" column to see the javascript stack trace, which caused the
request.
Cache.add() - Web APIs
note: add() will overwrite any key/value pair previously stored in the cache that matches the
request.
... syntax cache.add(
request).then(function() { //
request has been added to the cache }); parameters
request the
request you want to add to the cache.
... this can be a
request object or a url.
... the response status is not in the 200 range (i.e., not a successful response.) this occurs if the
request does not return successfully, but also if the
request is a cross-origin no-cors
request (in which case the reported status is always 0.) examples this code block waits for an installevent to fire, then calls waituntil() to handle the install process for the app.
Cache.delete() - Web APIs
the delete() method of the cache interface finds the cache entry whose key is the
request, and if found, deletes the cache entry and returns a promise that resolves to true.
... syntax cache.delete(
request, {options}).then(function(found) { // your cache entry has been deleted if found }); parameters
request the
request you are looking to delete.
... this can be a
request object or a url.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the
request http method (normally only get and head are allowed.) it defaults to false.
DOMException - Web APIs
(legacy code value: 1 and legacy constant name: index_size_err) hierarchy
requesterror the node tree hierarchy is not correct.
... (legacy code value: 3 and legacy constant name: hierarchy_
request_err) wrongdocumenterror the object is in the wrong document.
... transactioninactiveerror a
request was placed against a transaction that is currently not active or is finished (no legacy code value and constant name).
... notallowederror the
request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (no legacy code value and constant name).
Document.onfullscreenerror - Web APIs
the document.onfullscreenerror property is an event handler for the fullscreenerror event that is sent to the document when it fails to transition into full-screen mode after a prior call to element.
requestfullscreen().
... example this example attempts to call
requestfullscreen() outside of an event handler.
... since
requestfullscreen() can only be called in response to user action, for security reasons, this will fail, causing the fullscreenerror to be sent to the document.
... document.documentelement.
requestfullscreen(); specifications specification status comment fullscreen apithe definition of 'onfullscreenerror' in that specification.
Element - Web APIs
element.
requestfullscreen() asynchronously asks the browser to make the element full-screen.
... element.
requestpointerlock() allows to asynchronously ask for the pointer to be locked on the given element.
... candidate recommendation added the
requestpointerlock() method.
... living standard added the
requestfullscreen() method.
Using the Geolocation API - Web APIs
this initiates an asynchronous
request to detect the user's position, and queries the positioning hardware to get up-to-date information.
...a third, optional, parameter is an options object where you can set the maximum age of the position returned, the time to wait for a
request, and if you want high accuracy for the position.
... const watchid = navigator.geolocation.watchposition((position) => { dosomething(position.coords.latitude, position.coords.longitude); }); the watchposition() method returns an id number that can be used to uniquely identify the
requested position watcher; you use this value in tandem with the clearwatch() method to stop watching the user's location.
... this object allows you to specify whether to enable high accuracy, a maximum age for the returned position value (up until this age it will be cached and reused if the same position is
requested again; after this the browser will
request fresh position data), and a timeout value that dictates how long the browser should attempt to get the position data for, before it times out.
HTMLFormElement - Web APIs
requestsubmit()
requests that the form be submitted using the specified submit button and its corresponding configuration.
... deprecated methods htmlformelement.
requestautocomplete() triggers a native browser interface to assist the user in completing the fields which have an autofill field name value that is not off or on.
..." value="dog"> dog</label></p> </fieldset> <fieldset> <legend>owned vehicles</legend> <p><label><input type="checkbox" name="vehicle" value="bike">i have a bike</label></p> <p><label><input type="checkbox" name="vehicle" value="car">i have a car</label></p> </fieldset> <p><button>submit</button></p> </form> </body> </html> submitting forms and uploading files using xmlhttp
request if you want to know how to serialize and submit a form using the xmlhttp
request api, please read this paragraph.
... living standard the following method has been added:
requestautocomplete().
Headers - Web APIs
the headers interface of the fetch api allows you to perform various actions on http
request and response headers.
... these actions include retrieving, setting, adding to, and removing headers from the list of the
request's headers.
... a headers object also has an associated guard, which takes a value of immutable,
request,
request-no-cors, response, or none.
... you can retrieve a headers object via the
request.headers and response.headers properties, and create a new headers object using the headers.headers() constructor.
IDBCursor - Web APIs
idbcursor.
request read only returns the idb
request that was used to obtain the cursor.
... idbcursor.delete() returns an idb
request object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position.
... idbcursor.update() returns an idb
request object, and, in a separate thread, updates the value at the current position of the cursor in the object store.
... recommendation added continueprimarykey() and support for binary keys, and the idbcursor.
request property.
IDBDatabase.close() - Web APIs
syntax idbdatabase.close(); example // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); // opening a database.
... // create event handlers for both success and failure of dbopen
request.onerror = function(event) { note.innerhtml += "<li>error loading database.</li>"; }; dbopen
request.onsuccess = function(event) { note.innerhtml += "<li>database initialised.</li>"; // store the result of opening the database in the db variable.
... db = dbopen
request.result; // now let"s close the database again!
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBDatabase.createObjectStore() - Web APIs
transactioninactiveerror occurs if a
request is made on a source database that doesn't exist (e.g.
... example // let us open our database var
request = window.indexeddb.open("todolist", 4); // this handler is called when a new version of the database // is created, either when one has not been created before // or when a new version number is submitted by calling // window.indexeddb.open().
...
request.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += "<li>error loading database.</li>"; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); n...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBDatabase.onversionchange - Web APIs
the onversionchange event handler of the idbdatabase interface handles the versionchange event, fired when a database structure change (idbopendb
request.onupgradeneeded event or idbfactory.deletedatabase) was
requested elsewhere (most probably in another window/tab on the same computer).
...} example this example shows an idbopendb
request.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases, and an onversionchange function to notify when a database structure change has occurred.
...
request.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function(event) { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("n...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBDatabase: versionchange event - Web APIs
the versionchange event is fired when a database structure change (idbopendb
request.onupgradeneeded event or idbfactory.deletedatabase) was
requested.
... bubbles no cancelable no interface event event handler property onversionchange examples this example opens a database and, on success, adds a listener to versionchange: // open the database const dbopen
request = window.indexeddb.open('nonexistent', 4); dbopen
request.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'mon...
...th', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.addeventlistener('success', event => { const db = event.target.result; db.addeventlistener('versionchange', event => { console.log('the version of this database has changed'); }); }); the same example, using the onversionchange event handler property: // open the database const dbopen
request = window.indexeddb.open('nonexistent', 4); dbopen
request.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex(...
...'minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = event => { const db = event.target.result; db.onversionchange = event => { console.log('the version of this database has changed'); }; }; ...
IDBIndex.getAllKeys() - Web APIs
the getallkeys() method of the idbindex interface instantly retrieves the primary keys of all objects inside the index, setting them as the result of the
request object.
... syntax var allkeys
request = idbindex.getallkeys(); var allkeys
request = idbindex.getallkeys(query); var allkeys
request = idbindex.getallkeys(query, count); parameters query optional a key or an idbkeyrange identifying the keys to retrieve.
... return value an idb
request object on which subsequent events related to this operation are fired.
... example var myindex = objectstore.index('index'); var getallkeys
request = myindex.getallkeys(); getallkeys
request.onsuccess = function() { console.log(getallkeys
request.result); } specification specification status comment indexed database api draftthe definition of 'getall()' in that specification.
IDBIndex.openCursor() - Web APIs
the opencursor() method of the idbindex interface returns an idb
request object, and, in a separate thread, creates a cursor over the specified key range.
... syntax var
request = myindex.opencursor(); var
request = myindex.opencursor(range); var
request = myindex.opencursor(range, direction); parameters range optional a key or idbkeyrange to use as the cursor's range.
... return value an idb
request object on which subsequent events related to this operation are fired.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBIndex.openKeyCursor() - Web APIs
the openkeycursor() method of the idbindex interface returns an idb
request object, and, in a separate thread, creates a cursor over the specified key range, as arranged by this index.
... syntax var
request = myindex.openkeycursor(); var
request = myindex.openkeycursor(range); var
request = myindex.openkeycursor(range, direction); parameters range optional a key or idbkeyrange to use as the cursor's range.
... return value an idb
request object on which subsequent events related to this operation are fired.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBObjectStore.autoIncrement - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopen
request.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error.
... duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.autoincrement); // make a
request to add our newitem object to the object store var objectstore
request = objectstore.add(newitem[0]); objectstore
request.onsuccess = function(event) { // report the success of our
request note.innerhtml += '<li>
request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'autoincrement' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBObjectStore.deleteIndex() - Web APIs
example in the following example you can see the idbopendb
request.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded.
... for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopen
request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // run the displaydata() function to populate the task list with all the to-do list data already in the idb displaydata(); }; // this event handles the event whereby a new version of the database needs to be created // either one has not been created before, or a new version number has been submitted via the // window.indexeddb.open line above //it is only implemented in recent browsers dbopen
request.onupgradeneeded = function(event) { var db = this.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique:...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBObjectStore.getAll() - Web APIs
the getall() method of the idbobjectstore interface returns an idb
request object containing all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.
... if a value is successfully found, then a structured clone of it is created and set as the result of the
request object.
... syntax var
request = objectstore.getall(); var
request = objectstore.getall(query); var
request = objectstore.getall(query, count); parameters query optional a key or idbkeyrange to be queried.
... return value an idb
request object on which subsequent events related to this operation are fired.
IDBObjectStore.getAllKeys() - Web APIs
the getallkeys() method of the idbobjectstore interface returns an idb
request object retrieves record keys for all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.
... if a value is successfully found, then a structured clone of it is created and set as the result of the
request object.
... syntax var
request = objectstore.getallkeys(); var
request = objectstore.getallkeys(query); var
request = objectstore.getallkeys(query, count); parameters query optional a value that is or resolves to an idbkeyrange.
... return value an idb
request object on which subsequent events related to this operation are fired.
IDBObjectStore.keyPath - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopen
request.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error.
... duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.keypath); // make a
request to add our newitem object to the object store var objectstore
request = objectstore.add(newitem[0]); objectstore
request.onsuccess = function(event) { // report the success of our
request note.innerhtml += '<li>
request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'keypath' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBObjectStore.name - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopen
request.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error.
... duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.name); // make a
request to add our newitem object to the object store var objectstore
request = objectstore.add(newitem[0]); objectstore
request.onsuccess = function(event) { // report the success of our
request note.innerhtml += '<li>
request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'name' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBObjectStore.openKeyCursor() - Web APIs
the openkeycursor() method of the idbobjectstore interface returns an idb
request object whose result will be set to an idbcursor that can be used to iterate through matching results.
... syntax var
request = objectstore.openkeycursor(); var
request = objectstore.openkeycursor(query); var
request = objectstore.openkeycursor(query, direction); parameters query optional the key range to be queried.
... return value an idb
request object on which subsequent events related to this operation are fired.
... example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store: var transaction = db.transaction("name", "readonly"); var objectstore = transaction.objectstore("name"); var
request = objectstore.openkeycursor();
request.onsuccess = function(event) { var cursor = event.target.result; if(cursor) { // cursor.key contains the key of the current record being iterated through // note that there is no cursor.value, unlike for opencursor // this is where you'd do something with the result cursor.continue(); } else { // no more results } }; specification...
IDBObjectStore.transaction - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopen
request.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error.
... duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.transaction); // make a
request to add our newitem object to the object store var objectstore
request = objectstore.add(newitem[0]); objectstore
request.onsuccess = function(event) { // report the success of our
request note.innerhtml += '<li>
request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'transaction' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBTransaction: abort event - Web APIs
bubbles yes cancelable no interface event event handler property onabort this can happen for any of the following reasons: bad
requests, (for example, trying to add the same key twice, or put the same index key when the key has a uniqueness constraint), an explicit abort() call an uncaught exception in the
request's success/error handler, an i/o error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded.
... // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }...
...); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = event => { const db = dbopen
request.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `abort` transaction.addeventlistener('abort', () => { console.log('transaction was aborted'); }); // abort the transaction transaction.abort(); }; the same example, but assigning the event handler to the onabort property: // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error cr...
...asktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = event => { const db = dbopen
request.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `abort` transaction.onabort = (event) => { console.log('transaction was aborted'); }; // abort the transaction transaction.abort(); }; ...
IDBTransaction.commit() - Web APIs
note that commit() doesn't normally have to be called — a transaction will automatically commit when all outstanding
requests have been satisfied and no new
requests have been made.
... commit() can be used to start the commit process without waiting for events from outstanding
requests to be dispatched.
...duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("myobjstore"); // add our newitem object to the object store var objectstore
request = objectstore.add(newitem[0]); objectstore
request.onsuccess = function(event) { // report the success of the
request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>
request successful.</li>'; }; // force the changes to be committed to the database asap transaction.commit(); specification s...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBTransaction: complete event - Web APIs
bubbles no cancelable no interface event event handler property oncomplete examples using addeventlistener(): // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.
...createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = event => { const db = dbopen
request.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `complete` transaction.addeventlistener('complete', event => { console.log('transaction was competed'); }); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2019 }; const objectstore
request = objectstore.add(newitem); }; using the oncomplete property: // open the database const ...
...dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = event => { const db = dbopen
request.result; // open a read/write ...
...eady for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // add a listener for `complete` transaction.oncomplete = event => { console.log('transaction was competed'); }; const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2019 }; const objectstore
request = objectstore.add(newitem); }; ...
IDBTransaction.db - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopen
request.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error.
... duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var objectstore
request = objectstore.add(newitem[0]); objectstore
request.onsuccess = function(event) { // report the success of the
request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>
request successful.</li>'; }; // return the database (idbdatabase) connection with which this transaction is associated transaction.db; }; specification specification status comment indexed database api 2.0the definition of 'db' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBTransaction.mode - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopen
request.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error.
... duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var objectstore
request = objectstore.add(newitem[0]); objectstore
request.onsuccess = function(event) { // report the success of the
request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>
request successful.</li>'; }; // return the mode this transaction has been opened in (should be "readwrite" in this case) transaction.mode; }; specification specification status comment indexed database api 2.0the definition of 'mode' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBTransaction.onabort - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopen
request.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + ...
...'</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var objectstore
request = objectstore.add(newitem[0]); objectstore
request.onsuccess = function(event) { // report the success of the
request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>
request successful.</li>'; }; transaction.onabort = function() { // report when the transaction was successfully aborted console.log("transaction aborted!"); }; // abort the transaction we just did transaction.abort(); }; specification specification status comment indexed database api 2.0the defini...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBTransaction.oncomplete - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopen
request.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + ...
...'</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var objectstore
request = objectstore.add(newitem[0]); objectstore
request.onsuccess = function(event) { // report the success of the
request (this does not mean the item // has been stored successfully in the db - for that you need transaction.oncomplete) note.innerhtml += '<li>
request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'oncomplete' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBVersionChangeEvent.newVersion - Web APIs
example in the following code snippet, we make a
request to open a database, and include handlers for the success and error cases.
... // moreover, you may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, // so we don't need window.mozidb*) // let us open version 4 of our database var dbopen
request = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened dbopen
request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... db = dbopen
request.result; }; specifications specification status comment indexed database api 2.0the definition of 'newversion' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBVersionChangeEvent - Web APIs
the idbversionchangeevent interface of the indexeddb api indicates that the version of the database has changed, as the result of an idbopendb
request.onupgradeneeded event handler function.
... example in the following code snippet, we make a
request to open a database, and include handlers for the success and error cases.
...// moreover, you may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, so we don't need window.mozidb*) // let us open version 4 of our database var dbopen
request = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopen
request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... db = dbopen
request.result; }; specifications specification status comment indexed database api 2.0the definition of 'idbversionchangeevent' in that specification.
Checking when a deadline is due - Web APIs
duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); // add our newitem object to the object store var
request = objectstore.add(newitem[0]); in this section we create an object called newitem that stores the data in the format required to insert it into the database.
...
request.onsuccess = function(event) { note.innerhtml += '<li>new item added to database.</li>'; title.value = ''; hours.value = null; minutes.value = null; day.value = 01; month.value = 'january'; year.value = 2020; }; } this next section creates a log message to say the new item addition is successful, and resets the form so it's ready for the next task...
...read using indexeddb for an explanation): // now we need to update the value of notified to "yes" in this particular data object, so the // notification won't be set off on it again // first open up a tranaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var
request = objectstore.get(title);
request.onsuccess = function() { // grab the data object returned as the result var data =
request.result; // update the notified value in the object to "yes" data.notified = "yes"; // create another
request that inserts the item back into the database var
requestupdate = objectstore.put(data); // when this new
request su...
...cceeds, run the displaydata() function again to update the display
requestupdate.onsuccess = function() { displaydata(); } if the checks all match, we then run the createnotification() function to provide a notification to the user.
Locks.name - Web APIs
the name read-only property of the lock interface returns the name passed to lockmanager.
request selected when the lock was
requested.
... the name of a lock is passed by script when the lock is
requested.
... example the following examples show how the name property passed in the call to lockmanager.
request().
... navigator.locks.
request("net_db_sync", show_lock_properties); function show_lock_properties(lock) { console.log(`the lock name is: ${lock.name}`); console.log(`the lock mode is: ${lock.mode}`); } specifications specification status comment web locks apithe definition of 'name' in that specification.
MediaStreamConstraints - Web APIs
track constraints audio either a boolean (which indicates whether or not an audio track is
requested) or a mediatrackconstraints object providing the constraints which must be met by the audio track included in the returned mediastream.
... if constraints are specified, an audio track is inherently
requested.
... video either a boolean (which indicates whether or not a video track is
requested) or a mediatrackconstraints object providing the constraints which must be met by the video track included in the returned mediastream.
... if constraints are specified, a video track is inherently
requested.
msPlayToSource - Web APIs
msplaytosource is used in the source
requested handler -- get the playtosource object from an audio, video, or img element using the msplaytosource property and pass it to e.setsource, then set the playtosource.next property to the msplaytosource of another element for continual playing.
... var ptm = windows.media.playto.playtomanager.getforcurrentview(); // step 2: register for the source
requested event (user swipes devices charm).
... ptm.addeventlistener("source
requested", function(e) { // step 3: specify the media to be streamed (to filter devices).
... e.source
request.setsource(document.getelementbyid("videoplayer").msplaytosource); // the media will then be streamed to the device chosen by the user in the ui.
Notification - Web APIs
notification.
requestpermission()
requests permission from the user to display notifications.
... examples assume this basic html: <button onclick="notifyme()">notify me!</button> it's possible to send a notification as follows — here we present a fairly verbose and complete set of code you could use if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notifications, then
request permission if required, before then sending a notification.
... not support desktop notification"); } // let's check whether notification permissions have already been granted else if (notification.permission === "granted") { // if it's okay let's create a notification var notification = new notification("hi there!"); } // otherwise, we need to ask the user for permission else if (notification.permission !== "denied") { notification.
requestpermission().then(function (permission) { // if the user accepts, let's create a notification if (permission === "granted") { var notification = new notification("hi there!"); } }); } // at last, if the user has denied notifications, and you // want to be respectful there is no need to bother them any more.
... } we no longer show a live sample on this page, as chrome and firefox no longer allow notification permissions to be
requested from cross-origin <iframe>s, with other browsers to follow.
PaymentDetailsBase - Web APIs
properties displayitemsoptional an array of paymentitem objects, each describing one line item for the payment
request.
... paymentdetailsinit provides payment information when calling the payment
request() constructor.
...this can be delivered to the payment interface using either paymentdetailsupdateevent.updatewith() or by returning it from the optional detailsupdate promise provided to the payment
request.show() call that begins the user interaction.
... specifications specification status comment payment
request apithe definition of 'paymentdetailsbase' in that specification.
PaymentMethodChangeEvent - Web APIs
the paymentmethodchangeevent interface of the payment
request api describes the paymentmethodchange event which is fired by some payment handlers when the user switches payment instruments (e.g., a user selects a "store" card to make a purchase while using apple pay).
... properties in addition to the properties below, this interface includes properties inherited from payment
requestupdateevent.
... methods this interface includes methods inherited from payment
requestupdateevent.
... specifications specification status comment payment
request apithe definition of 'paymentmethodchangeevent' in that specification.
PaymentResponse: payerdetailchange event - Web APIs
payerdetailchange events are delivered by the payment
request api to a paymentresponse object when the user makes changes to their personal information while filling out a payment
request form.
... bubbles no cancelable no interface payment
requestupdateevent event handler property onpayerdetailchange examples in the example below, onpayerdetailchange is used to set up a listener for the payerdetailchange event in order to validate the information entered by the user,
requesting that any mistakes be corrected // options for payment
request(), indicating that shipping address, // payer email address, name, and phone number all b...
... const options = {
requestshipping: true,
requestpayeremail: true,
requestpayername: true,
requestpayerphone: true, }; const
request = new payment
request(methods, details, options); const response =
request.show(); // get the data from the response let { payername: oldpayername, payeremail: oldpayeremail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to //
request corrections as needed.
...} specifications specification status comment payment
request apithe definition of 'payerdetailchange event' in that specification.
Using the Permissions API - Web APIs
historically, different apis handle their own permissions inconsistently — for example the notifications api allows for explicit checking of permission status and
requesting permission, whereas the geolocation api doesn't (which causes problems if the user denied the initial permission
request, as we'll see below).
...for example, it can query whether permission to use a particular api is granted or denied, and specifically
request permission to use an api.
...this object will eventually include methods for querying,
requesting, and revoking permissions, although currently it only contains permissions.query(); see below.
... however, future additions to browser functionality should provide the
request() method, which will allow us to programatically
request permissions, any time we like.
RTCPeerConnection.createOffer() - Web APIs
the sdp offer includes information about any mediastreamtracks already attached to the webrtc session, codec, and options supported by the browser, and any candidates already gathered by the ice agent, for the purpose of being sent over the signaling channel to a potential peer to
request a connection or to update the configuration of an existing connection.
... syntax apromise = mypeerconnection.createoffer([options]); mypeerconnection.createoffer(successcallback, failurecallback, [options]) parameters options optional an rtcofferoptions dictionary providing options
requested for the offer.
... errorcallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the
request to create an offer failed.
... options optional an optional rtcofferoptions dictionary providing options
requested for the offer.
RTCPeerConnection - Web APIs
d it.removetrack()the rtcpeerconnection.removetrack() method tells the local end of the connection to stop sending media from the specified track, without actually removing the corresponding rtcrtpsender from the list of senders as reported by rtcpeerconnection.getsenders().restartice()the webrtc api's rtcpeerconnection interface offers the restartice() method to allow a web application to easily
request that ice candidate gathering be redone on both ends of the connection.setconfiguration() the rtcpeerconnection.setconfiguration() method sets the current configuration of the rtcpeerconnection based on the values included in the specified rtcconfiguration object.
... icecandidate sent to the peer connection to
request that the specified candidate be transmitted to the remote peer.
... constants rtcbundlepolicy enum the rtcbundlepolicy enum defines string constants which are used to
request a specific policy for gathering ice candidates if the remote peer isn't "bundle-aware" (compatible with the sdp bundle standard for bundling multiple media streams on a single transport link).
... "closed" the ice agent for this rtcpeerconnection has shut down and is no longer handling
requests.
Sensor APIs - Web APIs
the only time anything is shown to the user is when permissions need to be
requested and when the sensor type isn't supported by the device.
... if (event.error.name === 'notallowederror') { // branch to code for
requesting permission.
...a brief example, shown below,
requests permission before attempting to use the sensor.
...the actual reading frequency depends device hardware and consequently may be less than
requested.
USBDevice.controlTransferIn() - Web APIs
the controltransferin() method of the usbdevice interface returns a promise that resolves with a usbintransferresult when the result of a command or status
request has been received from the usb device.
...the available options are:
requesttype: must be one of three values specifying whether the tranfer is "standard" (common to all usb devices) "class" (common to an industry-standard class of devices) or "vendor".
...
request: a vendor-specific command.
... value: vender-specific
request parameters.
USBDevice.controlTransferOut() - Web APIs
the available options are:
requesttype: must be one of three values specifying whether the tranfer is "standard" (common to all usb devices) "class" (common to an industry-standard class of devices) or "vendor".
...
request: a vendor-specific command.
... value: vender-specific
request parameters.
...check with your device to see what the specific
request requires.
WakeLock - Web APIs
methods
request requests a wakelocksentinel object, which returns a promise that resolves with a wakelocksentinel object.
... examples the following asynchronous function
requests a wakelocksentinel object.
... the wakelock.
request method is wrapped in a try...catch statement to account for if the browser refuses the
request for any reason.
... const
requestwakelock = async () => { try { const wakelock = await navigator.wakelock.
request('screen'); } catch (err) { // the wake lock
request fails - usually system related, such low as battery console.log(`${err.name}, ${err.message}`); } }
requestwakelock(); specifications specification status comment screen wake lock apithe definition of 'wakelock' in that specification.
Writing a WebSocket server in C# - Web APIs
ent = server.accepttcpclient(); console.writeline("a client connected."); networkstream stream = client.getstream(); //enter to an infinite cycle to be able to handle every change in stream while (true) { while (!stream.dataavailable); byte[] bytes = new byte[client.available]; stream.read(bytes, 0, bytes.length); } handshaking when a client connects to a server, it sends a get
request to upgrade the connection to a websocket from a simple http
request.
... using system.text; using system.text.regularexpressions; while(client.available < 3) { // wait for enough bytes to be available } byte[] bytes = new byte[client.available]; stream.read(bytes, 0, bytes.length); //translate bytes of
request to string string data = encoding.utf8.getstring(bytes); if (regex.ismatch(data, "^get")) { } else { } the response is easy to build, but might be a little bit difficult to understand.
... you must: obtain the value of the "sec-websocket-key"
request header without any leading or trailing whitespace concatenate it with "258eafa5-e914-47da-95ca-c5ab0dc85b11" (a special guid specified by rfc 6455) compute sha-1 and base64 hash of the new value write the hash back as the value of "sec-websocket-accept" response header in an http response if (new system.text.regularexpressions.regex("^get").ismatch(data)) { const string eol = "\r\n"; // http/1.1 defines the sequence cr lf as the end-of-line marker byte[] response = encoding.utf8.getbytes("http/1.1 101 switching protocols" + eol + "connection: upgrade" + eol + "up...
...obtain the value of the "sec-websocket-key"
request header without any leading or trailing whitespace // 2.
Functions and classes available to Web Workers - Web APIs
48 (48) (yes) (yes) (yes) dom
request and domcursor respectively, these objects represents an ongoing operation (with listeners for reacting to the operation completely successfully, or failing, for example), and an ongoing operation over a list of results.
... 8 (8) no support no support no support formdata formdata objects provide a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the xmlhttp
request send() method.
... basic implementation (yes) appcodename, product, taintenabled(): 28 (28) online: 29 (29) navigatorlanguage: (yes) appname, appversion, online, platform, useragent: 10.0 other: no support (yes) (yes) xmlhttp
request creates and returns a new xmlhttp
request object; this mimics the behavior of the standard xmlhttp
request() constructor.
... note that the responsexml and channel attributes on xmlhttp
request always return null.
window.cancelAnimationFrame() - Web APIs
the window.cancelanimationframe() method cancels an animation frame
request previously scheduled through a call to window.
requestanimationframe().
... syntax window.cancelanimationframe(
requestid); parameters
requestid the id value returned by the call to window.
requestanimationframe() that
requested the callback.
... examples var
requestanimationframe = window.
requestanimationframe || window.moz
requestanimationframe || window.webkit
requestanimationframe || window.ms
requestanimationframe; var cancelanimationframe = window.cancelanimationframe || window.mozcancelanimationframe; var start = window.mozanimationstarttime; // only supported in ff.
... var myreq; function step(timestamp) { var progress = timestamp - start; d.style.left = math.min(progress / 10, 200) + 'px'; if (progress < 2000) { // it's important to update the
requestid each time you're calling
requestanimationframe myreq =
requestanimationframe(step); } } myreq =
requestanimationframe(step); // the cancelation uses the last
requestid cancelanimationframe(myreq); specifications specification status comment html living standardthe definition of 'cancelanimationframe()' in that specification.
Window.onmozbeforepaint - Web APIs
this is used in concert with the window.moz
requestanimationframe() method to perform smooth, synchronized animations from javascript code.
... example see window.moz
requestanimationframe() for an example.
... notes this event fires immediately before the browser window is repainted, if the event has been
requested by one or more scripts calling window.moz
requestanimationframe().
...this time is the same for all animations being run in the same browser window, including those using the window.moz
requestanimationframe() method, css transitions, and smil animations.
XRReferenceSpace - Web APIs
it expands upon the base class, xrspace, by adding support for several different tracking behaviors as well as to
request a new reference space which describes the offset transform between the tracked object and another location in the world.
... reference space types the reference space returned by xrsession.
requestreferencespace() is either xrreferencespace or xrboundedreferencespace.
...to do that, call the xrsession method
requestreferencespace(), specifying the reference space type you wish to obtain.
... xrsession.
requestreferencespace("local").then((refspace) => { xrreferencespace = refspace; /* ...
XRSystem - Web APIs
requestsession() returns a promise that resolves to a new xrsession with the specified xrsessionmode.
... examples the following example shows how to use both issessionsupported() and
requestsession().
... if (navigator.xr) { immersivebutton.addeventlistener("click", onbuttonclicked); navigator.xr.issessionsupported('immersive-vr') .then((issupported) => { if (issupported) { immersivebutton.disabled = false; } else { immersivebutton.disabled = true; }); } function onbuttonclicked() { if (!xrsession) { navigator.xr.
requestsession('immersive-vr') .then(() => { // onsessionstarted() not shown for reasons of brevity and clarity.
...if there isn't, we use
requestsession() to start one and, once the returned promise resolves, we call a function onsessionstarted() to set up our session for rendering and so forth.
msCachingEnabled - Web APIs
the mscachingenabled method gets the current caching state for an xmlhttp
request.
... syntax var cachestate = xmlhttp
request.mscachingenabled(); parameters cachestate[out, retval] type = boolean.
... if true, xmlhttp
request is cached to disk.
...if true, xmlhttp
request is cached to disk.
Media buffering, seeking, and time ranges - Developer guides
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.
...in practice this is good enough as the browser either enables range
requests or it doesn't.
...if range
requests are enabled this value usually becomes the duration of the media almost instantly.
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...the allowed values are: anonymous sends a cross-origin
request without a credential.
... use-credentials sends a cross-origin
request with a credential.
... when not present, the resource is fetched without a cors
request (i.e.
<input type="email"> - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
... using email inputs e-mail addresses are among the most frequently-inputted textual data forms on the web; they're used when logging into web sites, when
requesting information, to allow order confirmation, for webmail, and so forth.
...} <form> <div class="emailbox"> <label for="emailaddress">your e-mail address</label><br> <input id="emailaddress" type="email" size="64" maxlength="64" required placeholder="username@beststartupever.com" pattern=".+@beststartupever.com" title="please provide only a best startup ever corporate e-mail address"> </div> <div class="messagebox"> <label for="message">
request</label><br> <textarea id="message" cols="80" rows="8" required placeholder="my shoes are too tight, and i have forgotten how to dance."></textarea> </div> <input type="submit" value="send
request"> </form> our <form> contains one <input> of type email for the user's e-mail address, a <textarea> to enter their message for it into, and an <input> of type "submit", which creat...
...this simple regular expression
requests a string that consists of at least one character of any kind, then an "@" followed by the domain name "beststartupever.com".
<input type="month"> - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
... html the form that
requests the month and year looks like this: <form> <div class="nativedatepicker"> <label for="month-visit">what month would you like to visit us?</label> <input type="month" id="month-visit" name="month-visit"> <span class="validity"></span> </div> <p class="fallbacklabel">what month would you like to visit us?</p> <div class="fallbackdatepicker"> <div> <span> <lab...
...n> <option>september</option> <option>october</option> <option>november</option> <option>december</option> </select> </span> <span> <label for="year">year:</label> <select id="year" name="year"> </select> </span> </div> </div> </form> the <div> with the id nativedatepicker uses the month input type to
request the month and year, while the <div> with the id fallbackdatepicker instead uses a pair of <select> elements.
... the first
requests the month, and the second the year.
<input type="submit"> - HTML: Hypertext Markup Language
<input type="submit" value="send
request"> value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <input type="submit"> element's value attribute contains a domstring which is displayed as the button's label.
... <input type="submit" value="send
request"> if you don't specify a value, the button will have a default label, chosen by the user agent.
...this url is then sent to the server using an http get
request.
... post the form's data is included in the body of the
request that is sent to the url given by the formaction or action attribute using an http post method.
Choosing between www and non-www URLs - HTTP
or, one server can be handled by several machines, cooperating to produce the answer or balancing the load of the
requests between them.
... using http 301 redirects in this case, you need to configure the server receiving the http
requests (which is most likely the same for www and non-www urls) to respond with an adequate http 301 response to any
request to the non-canonical domain.
... example: a server receives a
request for http://www.example.org/whaddup (when the canonical domain is example.org) the server answers with a code 301 with the header location: http://example.org/whaddup.
... the client issues a
request to the canonical domain: http://example.org/whatddup the html5 boilerplate project has an example on how to configure an apache server to redirect one domain to the other.
Identifying resources on the Web - HTTP
the target of an http
request is called a "resource", whose nature isn't defined further; it can be a document, a photo, or anything else.
...there are sometimes reasons identity and location are not given by the same uri: http uses a specific http header, alt-svc when the resource
requested wants the client to access it at another location.
...it indicates which web server is being
requested.
...it is worth noting that the part after the #, also known as fragment identifier, is never sent to the server with the
request.
Reason: expected ‘true’ in CORS header ‘Access-Control-Allow-Credentials’ - HTTP
the cors
request requires that the server permit the use of credentials, but the server's access-control-allow-credentials header's value isn't set to true to enable their use.
... to fix this problem on the client side, revise the code to not
request the use of credentials.
... if the
request is being issued using xmlhttp
request, make sure you're not setting withcredentials to true.
... if using the fetch api, make sure
request.credentials is "omit".
Reason: CORS header 'Access-Control-Allow-Origin' missing - HTTP
the response to the cors
request is missing the required access-control-allow-origin header, which is used to determine whether or not the resource can be accessed by content operating within the current origin.
... if the server is under your control, add the origin of the
requesting site to the set of domains permitted access by adding it to the access-control-allow-origin header's value.
...in addition, the wildcard only works for
requests made with the crossorigin attribute set to anonymous, and it prevents sending credentials like cookies in
requests.
... to allow any site to make cors
requests without using the * wildcard (for example, to enable credentials), your server must read the value of the
request's origin header and use that value to set access-control-allow-origin, and must also set a vary: origin header to indicate that some headers are being set dynamically depending on the origin.
Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’ - HTTP
the cors
request was attempted with the credentials flag set, but the server is configured using the wildcard ("*") as the value of access-control-allow-origin, which doesn't allow the use of credentials.
... to correct this problem on the client side, simply ensure that the credentials flag's value is false when issuing your cors
request.
... if the
request is being issued using xmlhttp
request, make sure you're not setting withcredentials to true.
... if using the fetch api, make sure
request.credentials is "omit".
Accept - HTTP
the accept
request http header advertises which content types, expressed as mime types, the client is able to understand.
...browsers set adequate values for this header depending on the context where the
request is done: when fetching a css stylesheet a different value is set for the
request than when fetching an image, video or a script.
... header type
request header forbidden header name no cors-safelisted
request header yes, with the additional restriction that values can't contain a cors-unsafe
request header byte: 0x00-0x1f (except 0x09 (ht)), "():<>?@[\]{}, and 0x7f (del).
... examples accept: text/html accept: image/* // general default accept: */* // default for navigation
requests accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8 specifications specification title rfc 7231, section 5.3.2: accept hypertext transfer protocol (http/1.1): semantics and context ...
Access-Control-Allow-Methods - HTTP
the access-control-allow-methods response header specifies the method or methods allowed when accessing the resource in response to a preflight
request.
...access-control-allow-methods: * directives <method> comma-delimited list of the allowed http
request methods.
... * (wildcard) the value "*" only counts as a special wildcard value for
requests without credentials (
requests without http cookies or http authentication information).
... in
requests with credentials, it is treated as the literal method name "*" without special semantics.
Access-Control-Expose-Headers - HTTP
access-control-expose-headers: * directives <header-name> a list of exposed headers consisting of zero or more header names other than the cors-safelisted
request headers that the resource might use and can be exposed.
... * (wildcard) the value "*" only counts as a special wildcard value for
requests without credentials (
requests without http cookies or http authentication information).
... in
requests with credentials, it is treated as the literal header name "*" without special semantics.
... examples to expose a non-cors-safelisted
request header, you can specify: access-control-expose-headers: content-length to additionally expose a custom header, like x-kuma-revision, you can specify multiple headers separated by a comma: access-control-expose-headers: content-length, x-kuma-revision in
requests without credentials, you can also use a wildcard value: access-control-expose-headers: * however, this won't wildcard the authorization header, so if you need to expose that, you will need to list it explicitly: access-control-expose-headers: *, authorization specifications specification status comment fetchthe definition of 'access-control-expose-header...
Content-Location - HTTP
header type entity header forbidden header name no syntax content-location: <url> directives <url> a relative (to the
request url) or absolute url.
... examples
requesting data from a server in different formats let's say a site's api can return data in json, xml, or csv formats.
... if the url for a particular document is at https://example.com/documents/foo, the site could return different urls for content-location depending on the
request's accept header:
request header response header accept: application/json, text/json content-location: /documents/foo.json accept: application/xml, text/xml content-location: /documents/foo.xml accept: text/plain, text/* content-location: /documents/foo.txt these urls are examples — the site could serve the different filetypes with any url patterns it wishes, such as a query string parameter: /documents/foo?format=json, /documents/foo?format=xml, and so on.
... then the client could remember that the json version is available at that particular url, skipping content negotation the next time it
requests that document.
ETag - HTTP
this means weak etags prevent caching when byte range
requests are used, but strong etags mean range
requests can still be cached.
... "<etag_value>" entity tag uniquely representing the
requested resource.
... for example, when editing mdn, the current wiki content is hashed and put into an etag in the response: etag: "33a64df551425fcc55e4d42a148795d9f25f89d4" when saving changes to a wiki page (posting data), the post
request will contain the if-match header containing the etag values to check freshness against.
... specifications specification title rfc 7232, section 2.3: etag hypertext transfer protocol (http/1.1): conditional
requests ...
If-Modified-Since - HTTP
the if-modified-since
request http header makes the
request conditional: the server will send back the
requested resource, with a 200 status, only if it has been last modified after the given date.
... if the
request has not been modified since, the response will be a 304 without any body; the last-modified response header of a previous
request will contain the date of last modification.
... header type
request header forbidden header name no syntax if-modified-since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt directives <day-name> one of "mon", "tue", "wed", "thu", "fri", "sat", or "sun" (case-sensitive).
... examples if-modified-since: wed, 21 oct 2015 07:28:00 gmt specifications specification title rfc 7232, section 3.3: if-modified-since hypertext transfer protocol (http/1.1): conditional
requests ...
If-Unmodified-Since - HTTP
the if-unmodified-since
request http header makes the
request conditional: the server will send back the
requested resource, or accept it in the case of a post or another non-safe method, only if it has not been last modified after the given date.
... in conjunction with a range
request with a if-range header, it can be used to ensure that the new fragment
requested comes from an unmodified document.
... header type
request header forbidden header name no syntax if-unmodified-since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt directives <day-name> one of "mon", "tue", "wed", "thu", "fri", "sat", or "sun" (case-sensitive).
... examples if-unmodified-since: wed, 21 oct 2015 07:28:00 gmt specifications specification title rfc 7232, section 3.4: if-unmodified-since hypertext transfer protocol (http/1.1): conditional
requests ...
Sec-Fetch-Site - HTTP
the sec-fetch-site fetch metadata header indicates the relationship between a
request initiator's origin and the origin of the resource.
... header type fetch metadata
request header forbidden header name yes, since it has prefix sec- cors-safelisted response header cors-safelisted
request header syntax sec-fetch-site: cross-site sec-fetch-site: same-origin sec-fetch-site: same-site sec-fetch-site: none values cross-site same-origin same-site none this
request does not relate to any context like site, origin, or frame.
... this can happen when user had initiated this
request by, e.g.
... examples todo specifications specification title fetch metadata
request headers the sec-fetch-site http
request header ...
Want-Digest - HTTP
the want-digest http header is primarily used in a http
request, to ask the responder to provide a digest of the
requested resource using the digest response header.
... if want-digest does not include any digest algorithms that the server supports, the server may respond with: a digest calculated using a different digest algorithm, or a 400 bad
request error, and include another want-digest header with that response, listing the algorithms that it does support.
... examples want-digest: sha-256 want-digest: sha-512;q=0.3, sha-256;q=1, md5;q=0 basic operation the sender provides a list of digests which it is prepared to accept, and the server uses one of them:
request: get /item want-digest: sha-256;q=0.3, sha;q=1 response: http/1.1 200 ok digest: sha-256=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9dbpe= unsupported digests the server does not support any of the
requested digest algorithms, so uses a different algorithm:
request: get /item want-digest: sha;q=1 response: http/1.1 200 ok digest: sha-256=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9...
...dbpe= the server does not support any of the
requested digest algorithms, so responds with a 400 error and includes another want-digest header, listing the algorithms that it does support:
request: get /item want-digest: sha;q=1 response: http/1.1 400 bad
request want-digest: sha-256, sha-512 specifications specification title draft-ietf-httpbis-digest-headers-latest resource digests for http this header was originally defined in rfc 3230, but the definition of "selected representation" in rfc 7231 made the original definition inconsistent with current http specifications.
PATCH - HTTP
the http patch
request method applies partial modifications to a resource.
... a patch
request is considered a set of instructions on how to modify a resource.
...the word "idempotent" means that any number of repeated, identical
requests will leave the resource in the same state.
...
request has body yes successful response has body yes safe no idempotent no cacheable no allowed in html forms no syntax patch /file.txt http/1.1 example
request patch /file.txt http/1.1 host: www.example.com content-type: application/example if-match: "e0023aa4e" content-length: 100 [description of changes] response a successf...
POST - HTTP
the type of the body of the
request is indicated by the content-type header.
... a post
request is typically sent via an html form and results in a change on the server.
... text/plain when the post
request is sent via a method other than an html form — like via an xmlhttp
request — the body can take any type.
...
request has body yes successful response has body yes safe no idempotent no cacheable only if freshness information is included allowed in html forms yes syntax post /test example a simple form using the default application/x-www-form-urlencoded content type: post /test http/1.1 host: foo.example content-type: application/x-www-fo...
PUT - HTTP
the http put
request method creates a new resource or replaces a representation of the target resource with the
request payload.
... the difference between put and post is that put is idempotent: calling it once or several times successively has the same effect (that is no side effect), whereas successive identical post
requests may have additional effects, akin to placing an order several times.
...
request has body yes successful response has body no safe no idempotent yes cacheable no allowed in html forms no syntax put /new.html http/1.1 example
request put /new.html http/1.1 host: example.com content-type: text/html content-length: 16 <p>new file</p> responses if the target resource does not have a current representation and the put
request successfully creates one, then the origin server must inform the user agent by sending a 201 (created) response.
... http/1.1 201 created content-location: /new.html if the target resource does have a current representation and that representation is successfully modified in accordance with the state of the enclosed representation, then the origin server must send either a 200 (ok) or a 204 (no content) response to indicate successful completion of the
request.
202 Accepted - HTTP
the hypertext transfer protocol (http) 202 accepted response status code indicates that the
request has been accepted for processing, but the processing has not been completed; in fact, processing may not have started yet.
... the
request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.
... 202 is non-committal, meaning that there is no way for the http to later send an asynchronous response indicating the outcome of processing the
request.
... it is intended for cases where another process or server handles the
request, or for batch processing.
304 Not Modified - HTTP
the http 304 not modified client redirection response code indicates that there is no need to retransmit the
requested resources.
...this happens when the
request method is safe, like a get or a head
request, or when the
request is conditional and uses a if-none-match or a if-modified-since header.
... many developer tools' network panels of browsers create extraneous
requests leading to 304 responses, so that access to the local cache is visible to developers.
... status 304 not modified specifications specification title rfc 7232, section 4.1: 304 not modified hypertext transfer protocol (http/1.1): conditional
requests ...
307 Temporary Redirect - HTTP
http 307 temporary redirect redirect status response code indicates that the resource
requested has been temporarily moved to the url given by the location headers.
... the method and the body of the original
request are reused to perform the redirected
request.
... the only difference between 307 and 302 is that 307 guarantees that the method and the body will not be changed when the redirected
request is made.
...for get
requests, their behavior is identical.
412 Precondition Failed - HTTP
this happens with conditional
requests on methods other than get or head when the condition defined by the if-unmodified-since or if-none-match headers is not fulfilled.
... in that case, the
request, usually an upload or a modification of a resource, cannot be made and this error response is sent back.
... for example, when editing mdn, the current wiki content is hashed and put into an etag in the response: etag: "33a64df551425fcc55e4d42a148795d9f25f89d4" when saving changes to a wiki page (posting data), the post
request will contain the if-match header containing the etag values to check freshness against.
... specifications specification title rfc 7232, section 4.2: 412 precondition failed hypertext transfer protocol (http/1.1): conditional
requests ...
Intl.Collator.prototype.resolvedOptions() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if any unicode extension values were
requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were
requested and are supported for this locale are included in locale.
... collation the value
requested using the unicode extension key "co", if it is supported for locale, or "default".
... numeric casefirst the values
requested for these properties in the options argument or using the unicode extension keys "kn" and "kf" or filled in as defaults.
Using dns-prefetch - Web Performance
dns-prefetch is an attempt to resolve domain names before resources get
requested.
... when a browser
requests a resource from a (third party) server, that cross-origin’s domain name must be resolved to an ip address before the browser can issue the
request.
...while dns caching can help to reduce this latency, dns resolution can add significant latency to
requests.
...combining the two provides an opportunity to further reduce the perceived latency of cross-origin
requests.
Subresource Integrity - Web security
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.
... cross-origin resource sharing and subresource integrity 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.
... therefore, the resource must be served with an access-control-allow-origin header that allows the resource to be shared with the
requesting origin; for example: access-control-allow-origin: * examples in the following examples, assume that oqvuafxrkap7fdgccy5uykm6+r9gqq8k/uxy9rx7hnqlgyl1kpzqho1wx4jwy8wc is already known to be the expected sha-384 hash (digest) of a particular script example-framework.js, and there’s a copy of the script hosted at https://example.com/example-framework.js.
... 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.
Loading and running WebAssembly code - WebAssembly
using xmlhttp
request xmlhttp
request is somewhat older than fetch, but can still be happily used to get a typed array.
... again, assuming our module is called simple.wasm: create a new xmlhttp
request() instance, and use its open() method to open a
request, setting the
request method to get, and declaring the path to the file we want to fetch.
... next, send the
request using xmlhttp
request.send().
... the final code looks like this:
request = new xmlhttp
request();
request.open('get', 'simple.wasm');
request.responsetype = 'arraybuffer';
request.send();
request.onload = function() { var bytes =
request.response; webassembly.instantiate(bytes, importobject).then(results => { results.instance.exports.exported_func(); }); }; note: you can see an example of this in action in xhr-wasm.html.
JavaScript timers - Archive of obsolete content
but there are some javascript native functions (timers) which allow us to delay the execution of arbitrary instructions: settimeout() setinterval() setimmediate()
requestanimationframe() the settimeout() function is commonly used if you wish to have your function called once after the specified delay.
...the
requestanimationframe() function tells the browser that you wish to perform an animation and
requests that the browser schedule a repaint of the window for the next animation frame.
...
requestanimationframe()
requestanimationframe() tells the browser that you wish to perform an animation and
requests that the browser schedule a repaint of the window for the next animation frame.
Install Manifests - Archive of obsolete content
if an extension includes the following then it must
request unpacking: binary xpcom components plugins search plugins dlls loaded with ctypes dictionaries window icons examples <description about="urn:mozilla:install-manifest"> <em:id>extension@mysite.com</em:id> <em:unpack>true</em:unpack> ...
... the add-on manager will substitute the following values into this url in case you wish to generate the response rdf dynamically, such as using php or cgi: %req_version% the version of the
request.
...by default, mozilla applications using the add-on manager (such as firefox and thunderbird) will send update
requests to addons.mozilla.org using the default web service.
Appendix A: Add-on Performance - Archive of obsolete content
jsm provide the cleanest way to separate js into modules that can be loaded on
request, unlike chrome scripts which are generally loaded with the overlay at startup.
...this is what you should do first to make sure that you filter out all cases that don't interest you so that your add-on doesn't slow down other
requests.
... never use xmlhttp
request in synchronous mode.
Appendix F: Monitoring DOM changes - Archive of obsolete content
network listeners ajax-based page changes are almost universally tied to xmlhttp
requests.
... these
requests can be tracked from chrome code using a variety of methods, including web progress listeners, http observers, and content policies.
... while these are not exceptionally efficient (they run for every http
request, and considerably more often for some methods), they work very well for certain applications pure css pure css can be more powerful than most people suspect.
Adding preferences to an extension - Archive of obsolete content
watchstock() while we're at it, let's add a method that sets which stock we want to be watching, changing the preference and immediately
requesting a refresh of the display.
... a callback, we can't rely on // "this" referring to the right object, so we need to reference // it by its full name var symbol = stockwatcher.tickersymbol; var fullurl = "http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=" + symbol; function inforeceived() { var samplepanel = document.getelementbyid('stockwatcher2'); var output = http
request.responsetext; if (output.length) { // remove any whitespace from the end of the string output = output.replace(/\w*$/, ""); // build the tooltip string var fieldarray = output.split(","); samplepanel.label = symbol + ": " + fieldarray[1]; samplepanel.tooltiptext = "chg: " + fieldarray[4] + " | " + "open: " + fieldarray[5]...
... + " | " + "low: " + fieldarray[6] + " | " + "high: " + fieldarray[7] + " | " + "vol: " + fieldarray[8]; } } var http
request = new xmlhttp
request(); http
request.open("get", fullurl, true); http
request.onload = inforeceived; http
request.send(null); } } note that we use stockwatcher.tickersymbol here instead of this.tickersymbol to get the stock symbol to watch.
Creating a Web based tone generator - Archive of obsolete content
the function
requestsounddata() produces the samples to be played.
... var currentposition = audio.mozcurrentsampleoffset(); var available = currentposition + prebuffersize - currentwriteposition; if(available > 0) { //
request some sound data from the callback function.
... var frequency = 0, currentsoundsample; var samplerate = 44100; function
requestsounddata(sounddata) { if (!frequency) { return; // no sound selected } var k = 2* math.pi * frequency / samplerate; for (var i=0, size=sounddata.length; i<size; i++) { sounddata[i] = math.sin(k * currentsoundsample++); } } var audiodestination = new audiodatadestination(samplerate,
requestsounddata); function start()...
Autodial for Windows NT - Archive of obsolete content
in an attempt to help users who want to use the autodial feature of the os, i added the autodial helper feature
requested in bug 93002.
...these two behave the same for mozilla, and trigger autodial when you fail to reach a
requested address.
...a parallel feature has been
requested in bug 130774: if we trigger the autodial connection, we should ask the user if he wants to hang up the connection when we close mozilla.
Layout System Overview - Archive of obsolete content
a content element is passed to the style system and a
request is made to resolve the style for that element.
...the presentation shell owns and maintains a reflow queue where
requests for reflow are held until it is time to perform a reflow, and then pulled out and executed.
...the frame is able to provide a reference to its parent and to its children upon
request.
Tamarin Build System Documentation - Archive of obsolete content
checkins (hg push) to http://hg.mozilla.org/tamarin-redux and sandbox
requests will trigger a buildbot build when all build slaves are idle the next build begins before the build begins buildbot waits for 2 minutes of no checkin activity the build system prioritizes tamarin-redux checkins over sandbox builds when several tamarin-redux checkins occur the newest change is built including all checkins since the last build each sandbox build occurs in the order they were submi...
... create a user repository, instructions are https://developer.mozilla.org/en/publishing_mercurial_clones go to the
request a sandbox build page http://tamarin-builds.mozilla.org/build_trigger/
requestbuild.cfm enter the repository url, revision number, email address, and description.
... if buildbot is busy the queue is displayed http://tamarin-builds.mozilla.org/build_trigger/
requestbuild.cfm the submitter of a sandbox build may remove a build
request by clicking on the cancel button tamarin-redux builds are higher priority than sandbox builds, they cannot be removed but the most checkin including all new checkins are built how can i run buildbot scripts locally?
XUL Questions and Answers - Archive of obsolete content
as an extension author, you have at least two options: use dom methods to dynamically create or rearrange elements file an enhancement
request in bugzilla to have extra ids added.
...is: listobj = new object(); listobj.wpl = components.interfaces.nsiwebprogresslistener; listobj.queryinterface = function(aiid) { if (aiid.equals(listobj.wpl) || aiid.equals(components.interfaces.nsisupportsweakreference) || aiid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_nointerface; } listobj.onstatechange = function(aprogress, a
request, aflag, astatus) { if (aflag & listobj.wpl.state_start) { // this fires when the load event is initiated } else { if (aflag & listobj.wpl.state_stop) { if ( aflag & listobj.wpl.state_is_window ) { // this fires when all load finish } if ( aflag & listobj.wpl.state_is_network ) { // fires when all load are really over, // do something "final" h...
...ere // (my two cents) } else { // this fires when a load finishes } } } return 0; } // this fires when the location bar changes i.e load event is confirmed // or when the user switches tabs listobj.onlocationchange = function(aprogress, a
request, auri) { // do whatever you want to do return 0; } // for definitions of the remaining functions see xulplanet.com listobj.onprogresschange = function() { return 0 }; listobj.onstatuschange = function() { return 0 }; listobj.onsecuritychange = function() { return 0 }; listobj.onlinkiconavailable = function() { return 0 }; /* i use the progress listener to trap the end of a local html "template" file loading, and run xslt transormations.
Using SOAP in XULRunner 1.9 - Archive of obsolete content
//example.com/soap/'; var ns = 'http://example.com/soap/namespace'; var method = 'foo'; var params = { 'foo': 'bar', 'baz': 'bang' }; var callback = function(obj) { components.utils.reporterror(obj.tosource()); }; soapclient.proxy = url; var body = new soapobject(method); body.ns = ns; for (var k in params) { body.appendchild(new soapobject(k).val(params[k])); } var req = new soap
request(url, body); req.action = ns + '#' + method; soapclient.send
request(req, callback); diff between jqsoapclient.js and sasoapclient.js 42c42 < var jsout = $.xmltojson(xdata.responsexml); --- > var jsout = xmlobjectifier.xmltojson(xdata.responsexml); 46,60c46,62 < $.ajax({ < type: "post", < url: soapclient.proxy, < datatype: "xml", < processdata: false, < data: c...
...ontent, < complete: getresponse, < contenttype: soapclient.contenttype + "; charset=\"" + soapclient.charset + "\"", < beforesend: function(req) { < req.set
requestheader("method", "post"); < req.set
requestheader("content-length", soapclient.contentlength); < req.set
requestheader("soapserver", soapclient.soapserver); < req.set
requestheader("soapaction", soapreq.action); < } < }); --- > var xhr = new xmlhttp
request(); > xhr.mozbackground
request = true; > xhr.open('post', soapclient.proxy, true); > xhr.onreadystatechange = function() { > if (4 != xhr.readystate) { return; } > getresponse(xhr); > }; > var headers = { > 'method': 'post', > 'content-type': soapclient.contenttype + '; charset="' + > soapclient.charse...
...t + '"', > 'content-length': soapclient.contentlength, > 'soapserver': soapclient.soapserver, > 'soapaction': soapreq.action > }; > for (var h in headers) { xhr.set
requestheader(h, headers[h]); } > xhr.send(content); ...
NPN_GetURL - Archive of obsolete content
url pointer to the url of the
request.
...for http urls, the browser resolves this method as the http server method get, which
requests url objects.
... use npn_geturlnotify() instead of npn_geturl() in these cases: to
request a stream and receive notification of the result.
NPN_MemFlush - Archive of obsolete content
requests that the browser free a specified amount of memory.
...to
request that the browser free as much memory as possible, call npn_memflush() repeatedly until it returns 0.
...in general, plug-ins should use npn_memalloc() to allocate memory in the browser's memory space, since this function automatically frees cached data if necessary to fulfill the
request.
NPN_PostURL - Archive of obsolete content
url url of the
request, specified by the plug-in.
...npn_posturl is typically asynchronous: it returns immediately and only later handles the
request.
... for this reason, you may find it useful to call npn_posturlnotify instead; this function notifies your plug-in upon successful or unsuccessful completion of the
request.
Writing JavaScript for XHTML - Archive of obsolete content
we can do this on server side by evaluating the http
request header.
... every browser sends with its
request a list of mime types it understands, as part of the http content negotiation mechanism.
... for completeness here is the accept field, that firefox 2.0.0.9 sends with its
requests: accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 further reading you will find several useful articles in the developer wiki: xml in mozilla dom xml introduction xml extras dom 2 methods you will need are: dom:document.createelementns dom:document.getelementsbytagnamens see also properly using css and javascript in...
Index - Game development
2 anatomy of a video game games, javascript, main loop,
requestanimationframe i want to be clear that any of the above, or none of them, could be best for your game.
...we touch on css transitions and css animations, and javascript loops involving window.
requestanimationframe.
... 64 finishing up beginner, canvas, games, javascript, tutorial, lives,
requestanimationframe there's always room for improvements in any game we write.
Finishing up - Game development
drawlives(); improving rendering with
requestanimationframe() now let's work on something that is not connected to the game mechanics, but to the way it is being rendered.
...
requestanimationframe helps the browser render the game better than the fixed framerate we currently have implemented using setinterval().
... replace the following line: var interval = setinterval(draw, 10); with simply: draw(); and remove each instance of: clearinterval(interval); // needed for chrome to end game then, at the very bottom of the draw() function (just before the closing curly brace), add in the following line, which causes the draw() function to call itself over and over again:
requestanimationframe(draw); the draw() function is now getting executed again and again within a
requestanimationframe() loop, but instead of the fixed 10 milliseconds frame rate, we are giving control of the framerate back to the browser.
Asynchronous - MDN Web Docs Glossary: Definitions of Web-related terms
additionally, messages may be sent without waiting for acknowledgement, with the understanding that if a problem occurs, the recipient will
request corrections or otherwise handle the situation.
... when software communicates asynchronously, a program may make a
request for information from another piece of software (such as a server), and continue to do other things while waiting for a reply.
... for example, the ajax (asynchronous javascript and xml) programming technique—now usually simply "ajax", even though json is usually used rather than xml in modern applications—is a mechanism that
requests relatively small amounts of data from the server using http, with the result being returned when available rather than immediately.
Entity header - MDN Web Docs Glossary: Definitions of Web-related terms
an entity header is an http header that can be used in an http
request or response, and describes the content of the body of themessage.
... even if they are neither
request, nor response headers, entity headers are often included in such terms.
... a few
request headers after a get
request: in the following example, content-length is an entity header, while host and user-agent are
requests headers: post /myform.html http/1.1 host: developer.mozilla.org user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 content-length: 128 learn more technical knowledge list of all http headers ...
Idempotent - MDN Web Docs Glossary: Definitions of Web-related terms
an http method is idempotent if an identical
request can be made once or several times in a row with the same effect while leaving the server in the same state.
... to be idempotent, only the actual back-end state of the server is considered, the status code returned by each
request may differ: the first call of a delete will likely return a 200, while successive ones will likely return a 404.
... same results: get /pagex http/1.1 get /pagex http/1.1 get /pagex http/1.1 get /pagex http/1.1 post /add_row http/1.1 is not idempotent; if it is called several times, it adds several rows: post /add_row http/1.1 post /add_row http/1.1 -> adds a 2nd row post /add_row http/1.1 -> adds a 3rd row delete /idx/delete http/1.1 is idempotent, even if the returned status code may change between
requests: delete /idx/delete http/1.1 -> returns 200 if idx exists delete /idx/delete http/1.1 -> returns 404 as it just got deleted delete /idx/delete http/1.1 -> returns 404 learn more general knowledge definition of idempotent in the http specification.
Prefetch - MDN Web Docs Glossary: Definitions of Web-related terms
prefetching is when content is downloaded in the background, this is based on the assumption that the content will likely be
requested, enabling the content to load instantly if and when the user
requests it.
... the content is downloaded and cached for anticipated future use without the user making an explicit
request for it.
...they are most relevant when there are a plethora of links to external websites that may be clicked on, like search engine results, dns prefetching resolves domain names in advance thereby speeding up load times by reducing the time associated with domain lookup at
request time.
Proxy server - MDN Web Docs Glossary: Definitions of Web-related terms
a proxy intercepts
requests and serves back responses; it may forward the
requests, or not (for example in the case of a cache), and it may modify it (for example changing its headers, at the boundary between two networks).
...in general there are two main types of proxy servers: a forward proxy that handles
requests from and to anywhere on the internet.
... a reverse proxy taking
requests from the internet and forwarding them to servers in an internal network.
Time to first byte - MDN Web Docs Glossary: Definitions of Web-related terms
time to first byte (ttfb) refers to the time between the browser
requesting a page and when it receives the first byte of information from the server.
... this time includes dns lookup and establishing the connection using a tcp handshake and ssl handshake if the
request is made over https.
... ttfb is the time it takes between the start of the
request and the start of the response, in milliseconds: ttfb = responsestart -
requeststart see also: a typical http session performanceresourcetiming performancetiming ...
How do you set up a local testing server? - Learn web development
this can be due to a variety of reasons, the most likely being: they feature asynchronous
requests.
... some browsers (including chrome) will not run async
requests (see fetching data from the server) if you just run the example from a local file.
... running a simple local http server to get around the problem of async
requests, we need to test such examples by running them through a local web server.
Introducing asynchronous JavaScript - Learn web development
let's look at another example that loads a resource via the xmlhttp
request api (run it live, and see the source): function loadasset(url, type, callback) { let xhr = new xmlhttp
request(); xhr.open('get', url); xhr.responsetype = type; xhr.onload = function() { callback(xhr.response); }; xhr.send(); } function displayimage(blob) { let objecturl = url.createobjecturl(blob); let image = document.createelement('img'); image.src = objecturl; docu...
...it uses xmlhttp
request (often abbreviated to "xhr") to fetch the resource at the given url, then pass the response to the callback to do something with.
...a good example is the fetch() api, which is basically like a modern, more efficient version of xmlhttp
request.
Object building practice - Learn web development
the finished example will look a little something like this: this example will make use of the canvas api for drawing the balls to the screen, and the
requestanimationframe api for animating the whole display — you don't need to have any previous knowledge of these apis, and we hope that by the time you've finished this article you'll be interested in exploring them more.
... add the following to the bottom of your code now: function loop() { ctx.fillstyle = 'rgba(0, 0, 0, 0.25)'; ctx.fillrect(0, 0, width, height); for (let i = 0; i < balls.length; i++) { balls[i].draw(); balls[i].update(); }
requestanimationframe(loop); } all programs that animate things generally involve an animation loop, which serves to update the information in the program and then render the resulting view on each frame of the animation; this is the basis for most games and other such programs.
... runs the function again using the
requestanimationframe() method — when this method is repeatedly run and passed the same function name, it runs that function a set number of times per second to create a smooth animation.
Test your skills: JSON - Learn web development
this basically means that you can't
request a file from one origin using code on a different origin.
... in the live code editor above, both the javascript code and the
requested json file are on the same origin (the code sits on a github repo, and is embedded here in an <iframe>).
... if you put your code on codepen for example, it would fail because the json it is
requesting is not on the same origin.
Server-side website programming first steps - Learn web development
client-server overview now that you know the purpose and potential benefits of server-side programming, we're going to examine in detail what happens when a server receives a "dynamic
request" from a browser.
... as most websites' server-side code handles
requests and responses in a similar way, this will help you understand what you need to do when writing your own code.
... server-side web frameworks the last article showed you what a server-side web application needs to do in order to respond to
requests from a web browser.
Setting up your own test automation environment - Learn web development
let's update our bstack_google_test.js demo, to show how these features work: first, we'll need to import the node
request module, so we can use it to send
requests to the rest api.
... add the following line at the very top of your code: const
request = require("
request"); now we'll update our capabilities object to include a project name — add the following line before the closing curly brace, remembering to add a comma at the end of the previous line (you can vary the build and project names to organize the tests in different windows in the browserstack automation dashboard): 'project' : 'google test 2' next we need to access the sessionid of the current session, so we know where to send the
request (the id is included in the
request url, as you'll see later).
...block near the bottom of the code to add rest api calls (again, replace the your-user-name and your-access-key placeholders in the code with your actual user name and access key values): driver.sleep(2000).then(function() { driver.gettitle().then(function(title) { if(title === 'webdriver - google search') { console.log('test passed');
request({uri: "https://your-user-name:your-access-key@www.browserstack.com/automate/sessions/" + sessionid + ".json", method:"put", form:{"status":"passed","reason":"google results showed correct title"}}); } else { console.log('test failed');
request({uri: "https://your-user-name:your-access-key@www.browserstack.com/automate/sessions/" + sessionid + ".json", method:"put", form:{"status":...
Git and GitHub - Learn web development
different team members will commonly want to create their own separate versions of the code (called branches in git), work on a new feature in that version, and then get it merged in a controlled manner (in github we use pull
requests) with the master version when they are done with it.
... hello world (from github) this is a good place to start — this practical guide gets you to jump right into using github, learning the basics of git such as creating repositories and branches, making commits, and opening and merging pull
requests.
... 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.
Command line crash course - Learn web development
we will first try to fetch the contents of mdn's "fetch" page using the curl command (which can be used to
request content from urls), from /docs/web/api/fetch.
... therefore, if you use curl to
request /docs/web/api/fetch, you won’t get an output.
...| grep location | awk '{ print "https://developer.mozilla.org" $2 }' your final output should look something like this: /docs/web/api/fetch /docs/web/api/globalfetch/globalfetch.fetch() /docs/web/api/globalfetch/fetch /docs/web/api/windoworworkerglobalscope/fetch by combining these commands we've customised the output to show the full urls that the mozilla server is redirecting through when we
request the /docs/web/api/fetch url.
What to do and what not to do in Bugzilla
if you need faster access to get canconfirm or editbugs, especially in order to triage bugs or to participate in a bug day, then you can ask in #bmo on irc, or you may create a bug
requesting permissions.
... resolving bugs as incomplete the problem is vaguely described with no steps to reproduce, or is a support
request.
...esting work critical crashes, loss of data, severe memory leak major major loss of function normal regular issue, some loss of functionality under specific circumstances minor minor loss of function, or other problem where easy workaround is present trivial cosmetic problem like misspelled words or misaligned text enhancement
request for enhancement the blocker severity should be used very seldomly, because only a fraction of the hundreds of thousands bugs really block the development of mozilla and these are normally fixed very quickly.
Debugging update problems
checking update
requests if you're debugging the application update feature in firefox or other mozilla applications, you may need to see what
requests are occurring.
... you can do this using the live http headers addon to determine the url of the update
request.
... that url might look something like: https://aus3.mozilla.org/update/3/firefox/12.0a1/20120106040225/darwin_x86_64-gcc3-u-i386-x86_64-shark/nightly-profiling/darwin%2010.8.0/default/default/update.xml?force=1 you can then
request this url manually to see what's inside.
Limitations of chrome scripts
http
requests you can't observe http
requests in the content process.
... a common pattern here is to use the notificationcallbacks property of the nsihttpchannel to get the dom window that initiated the load, like this: observe: function (subject, topic, data) { if (topic == "http-on-modify-
request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); var domwindow = httpchannel.notificationcallbacks.getinterface(ci.nsidomwindow); } } or this: observe: function (subject, topic, data) { if (topic == "http-on-modify-
request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); var domwindow = httpchannel.notificationcallbacks.getinterface(ci.nsiload...
...in an http observer, you can get the browser message manager for the window using code like this: observe: function (subject, topic, data) { if (topic == "http-on-modify-
request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); var loadcontext = httpchannel.notificationcallbacks.getinterface(ci.nsiloadcontext); // topframeelement is the <browser> element var topframeelement = loadcontext.topframeelement; var browsermm = topframeelement.messagemanager; console.log("browsermm: " + browsermm); } } however, before firefox 38, this te...
HTMLIFrameElement.download()
syntax var instanceofdom
request = instanceofhtmliframeelement.download(url, options); returns a dom
request for handling the download
request.
... its
request.onsuccess handler handles the success case, and its
request.onerror handler handles the failure case.
... examples var browser = document.queryselector('iframe'); var
request = browser.download(foourl, { filename: 'foo.bin' });
request.onsuccess = function() { console.log("file downladed"); }
request.onerror = function() { console.log("download error"); } specification not part of any specification.
HTMLIFrameElement.getStructuredData()
syntax var instanceofdom
request = instanceofhtmliframeelement.getstructureddata(); returns a dom
request to handle the getstructureddata()
request's success and error cases.
... if the
request is successful, the
request.result is a json object representation of all microdata contained on the page loaded in the browser.
... examples var browser = document.queryselector('iframe'); browser.addeventlistener('mozbrowserloadend',function() { var
request = browser.getstructureddata();
request.onsuccess = function() { console.log(
request.result); } }); running this code in a browser api app and then loading up a page that contains microdata (such as the website of british alt-country band salter cane) will result in a json object being returned, along the lines of: { "items": [ { "type":["http://microformats.org/profile/hcard"], "properties":{"fn":["chris askew"], "n":[ { "properties": { "given-name":["chris"], "family-name":["askew"], ...
mozbrowsersecuritychange
this may mean that the
request is being loaded as part of a page in which some content was received over an insecure channel.
... secure: indicates that the data corresponding to the
request was received over a secure channel.
... insecure: indicates that the data corresponding to the
request was received over an insecure channel.
HTMLIFrameElement.purgeHistory()
syntax there is a dom
request version and a promise version: var mydom
request = instanceofhtmliframeelement.purgehistory(); instanceofhtmliframeelement.purgehistory().then(function() { ...
... }); returns either a dom
request object that returns an onsuccess handler if the history is deleted, or an onerror handler if not.
... examples dom
request: var browser = document.queryselector('iframe'); var
request = browser.purgehistory();
request.onsuccess = function() { console.log('history deleted!'); }
request.onerror = function() { console.error(this.error.name); } promise: var browser = document.queryselector('iframe'); browser.purgehistory().then(function() { console.log('history deleted!'); }, function(error) { console.error(this.error.name); }); specification not part of any specification.
Browser API
this can influence resource allocation and some function usage such as
requestanimationframe.
... browser api methods removed in firefox 65 in firefox 65, several of the mozilla browser api methods were removed in an effort to cut down on dom
request usage in the browser, and remove the parts of the browser api that are no longer needed (it is used only by the firefox devtools at this point).
... mozbrowserusernameandpasswordrequired sent when an http authentification is
requested.
WebChannel.jsm
components.utils.import("resource://gre/modules/webchannel.jsm"); constructor webchannel(string webchannelid, nsiuri originorpermission); 2nd argument is a valid origin that should be part of
requests for this channel.
... webchannel(string webchannelid, string originorpermission); 2nd argument is a permission for which the permission manager will be checked to determine if the
request is allowed.
... note that in addition to the permission manager check, the
request must be made over https.
JavaScript code modules
http.jsm a wrapper for xmlhttp
request that provides convenient and simplified api for dealing with http
requests.
... web
request.jsm provides an api to add event listeners for the various stages of making an http
request.
... the event listener receives detailed information about the
request, and can modify or cancel the
request.
Release phase
his (add the emphasized line): [paths] default = hg.mozilla.org/releases/l10n-central/x-testing default-push = ssh://hg.mozilla.org/releases/l10n-central/x-testing if you haven't already cloned the remote repository, enter this command: hg clone ssh://hg.mozilla.org/releases/l10n-central/x-testing mercurial will let you know that it's cloning the repository: destination directory: x-testing
requesting all changes adding changesets adding manifests adding file changes added 4 changesets with 242 changes to 239 files updating to branch default 239 files updated, 0 files merged, 0 files removed, 0 files unresolved the default push url is the same as the default pull url (i.e., ssh://hg.mozilla.org/releases/l10n-central/x-testing).
... there is a specific process to follow in bugzilla for
requesting these reviews: file a bug
requesting the review.
... enter :pike as the
requestee.
Fonts for Mozilla's MathML engine
an enhancement
request has been submitted to microsoft to install latin modern math and stix by default.
...enhancement
requests have been submitted to apple to ship opentype math fonts in the default installation.
... note: there is an enhancement
request opened on the noto bug tracker to improve math support.
Phishing: a short definition
earlier responses by affected banks, and payment providers, was to attempt educating users to not click links in emails, along with
requesting to verify email legitimacy through checking for relevant personal information.
...if both factors don’t match, the service will reject authentication
requests.
...unfortunately, some users still feel it's too tedious unlocking a phone, opening the otp app, and manually typing a few digits each time a provider
requests a new token.
NSS 3.16.3 release notes
ab:8c:e8:6a:81:10:9f:e4:8e ou = valicert class 2 policy validation authority sha1 fingerprint: 31:7a:2a:d0:7f:2b:33:5e:f5:a1:c3:4e:4b:57:e8:b7:d8:f1:fc:a6 ou = valicert class 3 policy validation authority sha1 fingerprint: 69:bd:8c:f4:9c:d3:00:fb:59:2e:17:93:ca:55:6a:f3:ec:aa:35:fb additionally, the following ca certificate was removed as
requested by the ca ou = tdc internet root ca sha1 fingerprint: 21:fc:bd:8e:7f:6c:af:05:1b:d1:b3:43:ec:a8:e7:61:47:f2:0f:8a the following ca certificates were added cn = certification authority of wosign sha1 fingerprint: b9:42:94:bf:91:ea:8f:b6:4b:e6:10:97:c7:fb:00:13:59:b6:76:cb cn = ca 沃通根证书 sha1 fingerprint: 16:32:47:8d:89...
...public primary certification authority sha1 fingerprint: 74:2c:31:92:e6:07:e4:24:eb:45:49:54:2b:e1:bb:c5:3e:61:74:e2 turned off websites and code signing trust bits (1024-bit root) ou = class 2 public primary certification authority - g2 sha1 fingerprint: b3:ea:c4:47:76:c9:c8:1c:ea:f2:9d:95:b6:cc:a0:08:1b:67:ec:9d turned off code signing trust bit (change
requested by ca) cn = verisign class 2 public primary certification authority - g3 sha-1 fingerprint: 61:ef:43:d7:7f:ca:d4:61:51:bc:98:e0:c3:59:12:af:9f:eb:63:11 turned off code signing trust bit (change
requested by ca) cn = ac raíz certicámara s.a.
... sha1 fingerprint: cb:a1:c5:f8:b0:e3:5e:b8:b9:45:12:d3:f9:34:a2:e9:06:10:d3:36 turned off websites trust bit (change
requested by ca) cn = netlock uzleti (class b) tanusitvanykiado sha1 fingerprint: 87:9f:4b:ee:05:df:98:58:3b:e3:60:d6:33:e7:0d:3f:fe:98:71:af turned off websites and code signing trust bits (1024-bit root) cn = netlock expressz (class c) tanusitvanykiado sha1 fingerprint: e3:92:51:2f:0a:cf:f5:05:df:f6:de:06:7f:75:37:e1:65:ea:57:4b turned off websites and code signing trust bits (1024-bit root) bugs fixed in nss 3.16.3 this bugzilla query returns all the bugs fixed in nss 3.16.3: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&targ...
NSS 3.31 release notes
notable changes in nss 3.31 the apis that set a tls version range have been changed to trim the
requested range to the overlap with a systemwide crypto policy, if configured.
... previously, ssl_versionrangeset and ssl_versionrangesetdefault returned a failure if the
requested version range wasn't fully allowed by the systemwide crypto policy.
... they have been changed to return success, if at least one tls version overlaps between the
requested range and the systemwide policy.
NSS Sample Code Sample1
the other hosts (secondary)
request keys from the // primary host.
...this // key needs to exist long enough to be used to process the // response to a key transport
request that is made to the primary // server.
...the secondary host sends its rsa public key to the primary host as // part of a
request for a particular key, or to be added to a list // of secondary hosts.
sslintro.html
the handshake occurs automatically the first time communication is
requested with a socket read/write or send/receive call.
...this occurs, for example, when an https server has received a
request and determines that before it can answer the
request, it needs to
request an authentication certificate from the client.
... at the http protocol level, nothing more is being said (that is, no http
request or response is being sent), so the server first uses ssl_rehandshake to begin a new handshake and then call ssl_forcehandshake to drive the handshake to completion.
Shumway
there are two places where shumway bugs are tracked: github (via issues and pull
requests) manages problems relating to shumway, itself.
...please note that source code will be
requested for the shumway developers to use as small test cases.
... you could also directly commit bug fixes as pull
requests.
JSAPI User Guide
the word javascript may bring to mind features such as event handlers (like onclick), dom objects, window.open, and xmlhttp
request.
...report->filename : "[no filename]", (unsigned int) report->lineno, message); } int run(jscontext *cx) { // enter a
request before running anything in the context.
... jsauto
request ar(cx); // create the global object and a new compartment.
JSDeletePropertyOp
provides
request.
... in js_threadsafe builds, the javascript engine calls this callback only from within an active
request on cx.
... the callback does not need to call js_begin
request()).
JSFastNative
provides
request.
... in js_threadsafe builds, the javascript engine calls this callback only from within an active
request on cx.
... the callback does not need to call js_begin
request()).
JSNative
provides
request.
... in js_threadsafe builds, the javascript engine calls this callback only from within an active
request on cx.
... the callback does not need to call js_begin
request()).
JSPropertyOp
provides
request.
... in js_threadsafe builds, the javascript engine calls this callback only from within an active
request on cx.
... the callback does not need to call js_begin
request()).
JS_CheckAccess
requires
request.
... in a js_threadsafe build, the caller must be in a
request on this jscontext.
... mode jsaccessmode the type of access
requested (read, write, etc.) vp jsval * out parameter.
JS_SetBranchCallback
provides
request.
... in js_threadsafe builds, the javascript engine calls this callback only from within an active
request on cx.
... the callback does not need to call js_begin
request()).
JSAPI reference
k enum jscontextop js_getruntime js_getparentruntime added in spidermonkey 31 js_getobjectruntime added in spidermonkey 17 js_getcontextprivate js_setcontextprivate js_getsecondcontextprivate added in spidermonkey 17 js_setsecondcontextprivate added in spidermonkey 17 js_setinterruptcallback added in spidermonkey 31 js_getinterruptcallback added in spidermonkey 31 js_
requestinterruptcallback added in spidermonkey 31 js_checkforinterrupt added in jsapi 45 js_destroycontextmaybegc obsolete since jsapi 14 js_setbranchcallback obsolete since javascript 1.9.1 js_setoperationcallback obsolete since jsapi 30 js_getoperationcallback obsolete since jsapi 30 js_triggeroperationcallback obsolete since jsapi 30 js_clearoperationcallback obsolete since javascript 1.9.1 ...
... js_begin
request js_end
request js_yield
request obsolete since jsapi 18 js_suspend
request obsolete since jsapi 18 js_resume
request obsolete since jsapi 18 js_getcontextthread obsolete since jsapi 8 js_setcontextthread obsolete since jsapi 8 js_clearcontextthread obsolete since jsapi 8 the following functions are always available, but in non-js_threadsafe builds, they do nothing: js_lockruntime obsolete...
... macros js_default_xml_namespace_id obsolete since jsapi 21 jsfun_bound_method obsolete since javascript 1.8.5 jsfun_getter obsolete since javascript 1.8.5 jsfun_setter obsolete since javascript 1.8.5 jsfun_global_parent obsolete since javascript 1.8.5 jsfun_heavyweight obsolete since jsapi 19 jsfun_lambda obsolete since jsapi 19 c++ features class jsauto
request class jsautolocalrootscope obsolete since javascript 1.8.5 class js::perfmeasurement (in jsperf.h) tracing and debugging js_setfunctioncallback added in spidermonkey 1.8.5 obsolete since jsapi 37 js_getfunctioncallback added in spidermonkey 1.8.5 obsolete since jsapi 37 ...
Feed content access API
use an xmlhttp
request to load the feed, then pass its string to an nsifeedprocessor to parse the feed.
... loading the feed and sending it to the parser is done using code similar to this: fetch: function(feedurl) { var http
request = null; function inforeceived() { var data = http
request.responsetext; var ioservice = components.classes['@mozilla.org/network/io-service;1'] .getservice(components.interfaces.nsiioservice); var uri = ioservice.newuri(feedurl, null, null); if (data.length) { var parser = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); var listener = new feedtestresultlistener(); try { parser.listener = listener; parser.parsefromstring(data, uri); } cat...
...ch(e) { alert("error parsing feed."); } } } http
request = new xmlhttp
request(); http
request.open("get", feedurl, true); try { http
request.onload = inforeceived; http
request.send(null); } catch(e) { alert(e); } } the nsifeedprocessor interface lets you parse the feed data from several possible sources; in this case, we're loading a document into a string, then parsing that string using its parsefromstring() method.
Using the Places annotation service
titemannotationstring(aitemid, aname); getitemannotationint32(aitemid, aname); getitemannotationint64(aitemid, aname); getitemannotationdouble(aitemid, aname); getitemannotationbinary(aitemid, aname, adata, adatalen, amimetype); from javascript: getpageannotation(auri, aname); getitemannotation(aitemid, aname); these functions will return/throw ns_error_not_available if the annotation
requested does not exist.
... you can use the annotations service's hasannotation method to determine in advance if the page has the
requested annotation.
...when the annotation name is "favicon," the annotation protocol handler will pass the
request through to the favicon service for handling.
Components.isSuccessCode
if the task is sufficiently complex that it can fail, the notification will include a status code indicating the success or failure of the operation (see, for example, nsi
requestobserver.onstop
request()).
... const cc = components.classes; const ci = components.interfaces; const cr = components.results; // global flags polled externally var copyfailed = false; var copyinprogress = false; function copybufferedstream(instream, outstream) { var copyobserver = { onstart
request: function(
request, context) { copyinprogress = true; }, onstop
request: function(
request, context, statuscode) { copyinprogress = false; // did the copy fail?
... if (!components.issuccesscode(statuscode)) copyfailed = true; }, queryinterface: function(aiid) { if (aiid.equals(ci.nsi
requestobserver) || aiid.equals(ci.nsisupports)) return this; throw cr.ns_error_no_interface; } }; var copier = cc["@mozilla.org/network/async-stream-copier;1"] .createinstance(ci.nsiasyncstreamcopier); copier.init(instream, outstream, null, true, false, 8192, true, true); copier.asynccopy(copyobserver, null); } ...
Components.utils.importGlobalProperties
system scopes such as jsms and frame scripts don't have certain objects, such as indexeddb and xmlhttp
request, that are available to dom window globals.
... atob blob btoa crypto css fetch file nsidomfile indexeddb nodefilter firefox 60 nsidomnodefilter obsolete since gecko 60 rtcidentityprovider textdecoder textencoder url urlsearchparams xmlhttp
request nsixmlhttp
request obsolete since gecko 60 for string/object in table without a minimum firefox version, it is not exactly known since when it was available, however it is guranteed available from firefox 28 and up.
... var domfile = services.appshell.hiddendomwindow.file('/path/to/file'); xpcom components some objects have an xpcom alternative, which typically allows more flexibility then the dom version here is an example of how to use the dom xmlhttp
request through xpcom interface of nsixmlhttp
request: var oreq = cc["@mozilla.org/xmlextras/xmlhttp
request;1"].createinstance(ci.nsixmlhttp
request); ...
imgIContainerObserver
method overview void framechanged(in imgi
request a
request, in imgicontainer acontainer, [const] in nsintrect adirtyrect); native code only!
...void framechanged( in imgi
request a
request, in imgicontainer acontainer, [const] in nsintrect adirtyrect ); parameters a
request the image
request for which the change occurred.
... notes the a
request parameter was added to this method in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9).
mozIAsyncHistory
.getservice(components.interfaces.moziasynchistory); method overview void getplacesinfo(in jsval aplaceidentifiers, in mozivisitinfocallback acallback); void isurivisited(in nsiuri auri, in mozivisitedstatuscallback acallback); void updateplaces(in moziplaceinfo, [optional] in mozivisitinfocallback acallback); methods getplacesinfo() starts an asynchronous
request to determine whether or not a given uri has been visited; you must implement a callback to receive the result of the
request.
... isurivisited() starts an asynchronous
request to determine whether or not a given uri has been visited; you must implement a callback to receive the result of the
request.
... acallback an object implementing the mozivisitedstatuscallback.isvisited() method; this method will be called with the results once the
request has been completed.
mozIStorageService
openspecialdatabase() opens a connection to a named special database storage that identifies the type of storage
requested.
...mozistorageconnection openspecialdatabase( in string astoragekey ); parameters astoragekey a string key identifying the type of storage
requested.
... return value a new mozistorageconnection providing access to the
requested database.
nsIApplicationUpdateService
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void adddownloadlistener(in nsi
requestobserver listener); astring downloadupdate(in nsiupdate update, in boolean background); void pausedownload(); void removedownloadlistener(in nsi
requestobserver listener); nsiupdate selectupdate([array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); attributes attribute type description backgroundchecker nsiupdatechecker the update checker being used for ...
...void adddownloadlistener( in nsi
requestobserver listener ); parameters listener an object implementing nsi
requestobserver and optionally nsiprogresseventsink that will be notified of state and progress information as the update is downloaded.
...void removedownloadlistener( in nsi
requestobserver listener ); parameters listener the listener object to remove.
nsIDirIndexListener
they can then be transformed into an output format (such as rdf, html and so on) inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void onindexavailable(in nsi
request a
request, in nsisupports actxt, in nsidirindex aindex); void oninformationavailable(in nsi
request a
request, in nsisupports actxt, in astring ainfo); methods onindexavailable() called for each directory entry.
... void onindexavailable( in nsi
request a
request, in nsisupports actxt, in nsidirindex aindex ); parameters a
request the
request.
...void oninformationavailable( in nsi
request a
request, in nsisupports actxt, in astring ainfo ); parameters a
request the
request.
nsIDirectoryServiceProvider
method overview nsifile getfile(in string prop, out prbool persistent); methods getfile() the directory service calls this method when it gets the first
request for a prop or on every
request if the prop is not persistent.
...subsequent
requests for this prop will bypass the provider and use the cache.
... false if the provider will be asked for this prop each time it is
requested.
nsIDownloadManagerUI
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void getattention(); void show([optional] in nsiinterface
requestor awindowcontext, [optional] in unsigned long aid, [optional] in short areason); attributes attribute type description visible boolean true if the download manager ui is visible; otherwise false.
... constants constant value description reason_user_interacted 0 when opening the download manager user interface, this value indicates that it's being done at the user's
request.
... void show( in nsiinterface
requestor awindowcontext, optional in unsigned long aid, optional in short areason optional ); parameters awindowcontext optional the parent window context to show the user interface.
nsIFactory
this can be nsnull if no aggregation is
requested.
... iid the iid of the interface being
requested in the component which is being currently created.
... exceptions thrown ns_error_no_interface indicates that the
requested interface is not supported.
nsIFaviconService
an async
request will be created for this uri and if the data is available, it will asynchronously get saved in the database without any further work from the caller.
... afaviconloadtype one of nsifaviconservice.favicon_load_private or nsifaviconservice.favicon_load_non_private to indicate that any network
requests performed should act like ones from a private browsing context (ie.
...this should be determined via privatebrowsingutils.iswindowprivate(somerelatedwindow) if the favicon may expose the user's private browsing data by performing a network
request, otherwise favicon_load_non_private may be used.
nsIHttpActivityObserver
activity subtype constants constant value description activity_subtype_
request_header 0x5001 the http
request is about to be queued for sending.
... observers can look at
request headers in aextrastringdata activity_subtype_
request_body_sent 0x5002 the http
request's body has been sent.
...http transaction activity for activity notifications of type activity_type_http_transaction, there are three activities that include extra data: activity_subtype_
request_header aextrastringdata contains the text of the header.
nsIMutableArray
exceptions thrown ns_error_failure when a weak reference is
requested, but the element does not support nsiweakreference.
... exceptions thrown ns_error_failure when a weak reference is
requested, but the element does not support nsiweakreference.
... exceptions thrown ns_error_failure when a weak reference is
requested, but the element does not support nsiweakreference.
nsIProtocolProxyCallback
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void onproxyavailable(in nsicancelable a
request, in nsiuri auri, in nsiproxyinfo aproxyinfo, in nsresult astatus); methods onproxyavailable() this method is called when proxy info is available or when an error in the proxy resolution occurs.
... void onproxyavailable( in nsicancelable a
request, in nsiuri auri, in nsiproxyinfo aproxyinfo, in nsresult astatus ); parameters a
request the value returned from asyncresolve.
...this is a failure code if the
request could not be satisfied, in which case the value of astatus indicates the reason for the failure and aproxyinfo will be null.
nsIServiceManager
void getservice( in nscidref aclass, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters aclass the classid of the service that is being
requested.
... void getservicebycontractid( in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters acontractid the contractid of the service that is being
requested.
...after that, they can
request specific services by calling getservice().
nsISmsService
rvice); method overview [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 ); unsigned short getnumberofmessagesfortext(in domstring text); boolean hassupport(); void send(in domstring number, in domstring message, in long
requestid, [optional] in unsigned long long processid); methods 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.
... send() void send( in domstring number, in domstring message, in long
requestid, in unsigned long long processid optional ); parameters number a domstring with a telephone number to send to.
...
requestid missing description processid optional missing description see also smsmanager smsmessage ...
nsIUploadChannel2
acontenttype this value will replace any existing content-type header on the http
request, regardless of whether or not its empty.
...amethod the http
request method to set on the stream.
... astreamhasheaders true if the stream already contains headers for the http
request.
nsIWebBrowser
the chrome may optionally implement nsiinterface
requestor, nsiwebbrowserchromefocus, nsicontextmenulistener and nsitooltiplistener to receive additional notifications from the browser object.
...note: nsiinterface
requestor and nsiweakreference might also need to be implemented by the chrome object.
... see also nsibasewindow nsicontextmenulistener nsidomwindow nsiembeddingsitewindow nsiinterface
requestor nsishistorylistener nsitooltiplistener nsiuricontentlistener nsiweakreference nsiwebbrowserchrome nsiwebbrowserchromefocus nsiwebprogresslistener ...
Autoconfiguration in Thunderbird
the component is actively watched for new bugs (as of november 2015) so there is no need to
request review on the file.
...this may be on the same machine as other web servers, but the web server must be configured to the content to any
requested domain.
... server_name autoconfig.*; return 301 http://autoconfig.hoster.com$
request_uri; } or serve them directly from a common directory: server { listen 10.2.3.4:80; #again, use your server's public ip here!
Mailnews and Mail code review requirements
to obtained a ui-review on an attachment, set ui-review to '?' and enter :bwinton (for blake winton) as the
requestee.
... if a reviewer feels that the patch would benefit from additional reviews, they should
request a second review from an appropriate person.
... unit test rules patches are required to include automated tests which are run during make check or via mozmill in thunderbird, but submitters are encouraged to
request exceptions from reviewers in cases where the cost is believed to outweigh the benefit.
Drawing and Event Handling - Plugins
npp_print:
request a platform-specific print operation for the instance.
...the variable parameter contains the information the call is
requesting, in this case npnvnetscapewindow (the native window in which plug-in drawing occurs).
... windows the
requested information, a value of type hwnd, is returned from npn_getvalue in the value parameter.
Set an XHR breakpoint - Firefox Developer Tools
an xhr (xmlhttp
request) breakpoint breaks code execution when an xhr
request is dispatched so that you can examine the current state of the program.
... you can break on all
requests or on those that include a specific url.
... when your code breaks on an xhr
request, the righthand pane will have two additional sections: call stack the list of functions that were executed in order ot get to the currently executing code.
Inspecting web sockets - Firefox Developer Tools
accessing the inspector when you are inspecting a web app that utilizes a web socket connection, the web socket
requests are listed in the list of
requests in the network monitor along with all other
requests.
...only
requests with the 101 status code (websocket protocol handshake) are visible, which indicates that the server is switching to a web socket connection.
... clicking on a web socket
request opens the usual sidebar to reveal additional details.
Performance Analysis - Firefox Developer Tools
(alternatively, if you have only just opened the network monitor, so it's not yet populated with the list of
requests, you'll get a stopwatch icon in the main window.) the network monitor then loads the site twice: once with an empty browser cache, and once with a primed browser cache.
... to get back to the network monitor's list of network
requests click the "back" button on the left.
... network monitor features the following articles cover different aspects of using the network monitor: toolbar network
request list network
request details network traffic recording throttling ...
Web Console Helpers - Firefox Developer Tools
:block (starting in firefox 80) followed by an unquoted string, blocks
requests where the url contains that string.
... in the network monitor, the string now appears and is selected in the
request blocking sidebar.
...in the network monitor, the string is removed from the
request blocking sidebar.
AbortController.signal - Web APIs
the signal read-only property of the abortcontroller interface returns an abortsignal object instance, which can be used to communicate with/abort a dom
request as desired.
... when the fetch
request is initiated, we pass in the abortsignal as an option inside the
request's options object (see {signal}, below).
... this associates the signal and controller with the fetch
request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener.
AudioContext.getOutputTimestamp() - Web APIs
performancetime: a point in the time coordinate system of a performance interface; the time after the document containing the audio context was first rendered examples in the following code we start to play an audio file after a play button is clicked, and start off a
requestanimationframe loop running, which constantly outputs the contexttime and performancetime.
... play.addeventlistener('click', () => { if(!audioctx) { audioctx = new window.audiocontext(); } getdata(); source.start(0); play.setattribute('disabled', 'disabled'); raf =
requestanimationframe(outputtimestamps); }); stop.addeventlistener('click', () => { source.stop(0); play.removeattribute('disabled'); cancelanimationframe(raf); }); // function to output timestamps function outputtimestamps() { let ts = audioctx.getoutputtimestamp() console.log('context time: ' + ts.contexttime + ' | performance time: ' + ts.performancetime); raf =
requestanimationframe(outputtimestamps); } specifications specification status comment web audio apithe definition of 'getoutpu...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
Bluetooth - Web APIs
referringdevice; promise<sequence<bluetoothdevice>> getdevices(); promise<bluetoothdevice>
requestdevice(optional
requestdeviceoptions options = {}); }; bluetooth includes bluetoothdeviceeventhandlers; bluetooth includes characteristiceventhandlers; bluetooth includes serviceeventhandlers; properties inherits properties from its parent eventtarget.
... bluetooth.getdevices() returns a promise that resolved to an array of bluetoothdevices which the origin already obtained permission for via a call to bluetooth.
requestdevice().
... bluetooth.
requestdevice() returns a promise to a bluetoothdevice object with the specified options.
Body - Web APIs
the body mixin of the fetch api represents the body of the response/
request, allowing you to declare what its content type is and how it should be handled.
... body is implemented by both
request and response.
...you'll notice that since we are
requesting an image, we need to run body.blob() (response implements body) to give the response its correct mime type.
Cache.matchAll() - Web APIs
syntax cache.matchall(
request, {options}).then(function(response) { // do something with the response array }); parameters
request optional the
request for which you are attempting to find responses in the cache.
... this can be a
request object or a url.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the
request http method (normally only get and head are allowed.) it defaults to false.
Clipboard - Web APIs
read()
requests arbitrary data (such as images) from the clipboard, returning a promise.
... readtext()
requests text from the system clipboard; returns a promise which is resolved with a domstring containing the clipboard's text once it's available.
... for webextensions, you can
request the clipboardread and clipboardwrite permissions to be able to use clipboard.readtext() and clipboard.writetext().
ClipboardItem - Web APIs
the clipboard-read permission must be
requested, which you can do by trying to read data from the clipboard.
... gettype() returns a promise that resolves with a blob of the
requested mime type, or an error if the mime type is not found.
... examples writing to clipboard here we're writing a new clipboarditem.clipboarditem() to the clipboard by
requesting a png image using the fetch api, and in turn, the responses' blob() method, to create the new clipboarditem.
CredentialsContainer.get() - Web APIs
syntax var promise = credentialscontainer.get([options]) parameters options optional an object of type credential
requestoptions that contains options for the
request.
... federated: a federatedcredential
requestoptions object containing requirements for returned federated credentials.
... publickey: an publickeycredential
requestoptions object containing requirements for returned webauthn credentials.
DirectoryReaderSync - Web APIs
self.
requestfilesystemsync = self.webkit
requestfilesystemsync || self.
requestfilesystemsync; // global for holding the list of entry file system urls.
... if (!data.cmd || data.cmd != 'list') { return; } try { var fs =
requestfilesystemsync(temporary, 1024*1024 /*1mb*/); getallentries(fs.root.createreader()); self.postmessage({entries: paths}); } catch (e) { onerror(e); } }; method overview entrysync readentries () raises (fileexception); method readentries() returns a lost of entries from a specific directory.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
Document.exitFullscreen() - Web APIs
the document method exitfullscreen()
requests that the element on this document which is currently being presented in full-screen mode be taken out of full-screen mode, restoring the previous state of the screen.
... this usually reverses the effects of a previous call to element.
requestfullscreen().
... document.onclick = function (event) { if (document.fullscreenelement) { document.exitfullscreen() .then(() => console.log("document exited form full screen mode")) .catch((err) => console.error(err)) } else { document.documentelement.
requestfullscreen(); } } note: for a more complete example, see the example in element.
requestfullscreen().
Document.fullscreenEnabled - Web APIs
syntax var isfullscreenavailable = document.fullscreenenabled; value a boolean value which is true if the document and the elements within can be placed into full-screen mode by calling element.
requestfullscreen().
... example in this example, before attempting to
request full-screen mode for a <video> element, the value of fullscreenenabled is checked, in order to avoid making the attempt when not available.
... function
requestfullscreen() { if (document.fullscreenenabled) { videoelement.
requestfullscreen(); } else { console.log('your browser cannot use fullscreen right now'); } } specifications specification status comment fullscreen apithe definition of 'document.fullscreenenabled' in that specification.
Document: scroll event - Web APIs
instead, it is recommended to throttle the event using
requestanimationframe(), settimeout(), or a customevent, as follows.
...this example optimizes thescroll event for
requestanimationframe.
... // reference: http://www.html5rocks.com/en/tutorials/speed/animations/ let last_known_scroll_position = 0; let ticking = false; function dosomething(scroll_pos) { // do something with the scroll position } window.addeventlistener('scroll', function(e) { last_known_scroll_position = window.scrolly; if (!ticking) { window.
requestanimationframe(function() { dosomething(last_known_scroll_position); ticking = false; }); ticking = true; } }); see more, similar examples on the resize event page.
Element: scroll event - Web APIs
instead, it is recommended to throttle the event using
requestanimationframe(), settimeout(), or a customevent, as follows.
...this example optimizes thescroll event for
requestanimationframe.
... // reference: http://www.html5rocks.com/en/tutorials/speed/animations/ let last_known_scroll_position = 0; let ticking = false; function dosomething(scroll_pos) { // do something with the scroll position } window.addeventlistener('scroll', function(e) { last_known_scroll_position = window.scrolly; if (!ticking) { window.
requestanimationframe(function() { dosomething(last_known_scroll_position); ticking = false; }); ticking = true; } }); note: you can find more examples on the resize event page.
FetchEvent.preloadResponse - Web APIs
this promise resolves to the first matching url
request in the cache object.
... addeventlistener('fetch', event => { event.respondwith(async function() { // respond from the cache if we can const cachedresponse = await caches.match(event.
request); if (cachedresponse) return cachedresponse; // else, use the preloaded response, if it's there const response = await event.preloadresponse; if (response) return response; // else try the network.
... return fetch(event.
request); }()); }); specifications specification status comment service workersthe definition of 'preloadresponse' in that specification.
FetchEvent.navigationPreload - Web APIs
addeventlistener('fetch', event => { event.respondwith(async function() { // respond from the cache if we can const cachedresponse = await caches.match(event.
request); if (cachedresponse) return cachedresponse; // else, use the preloaded response, if it's there const response = await event.preloadresponse; if (response) return response; // else try the network.
... return fetch(event.
request); }()); }); specifications specification status comment service workersthe definition of 'navigationpreload' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FileException - Web APIs
invalid_modification_err 9 the modification
requested is not allowed.
...for example, the app is accessing a directoryentry when the user is
requesting a fileentry.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FileSystem - Web APIs
some browsers offer additional apis to create and manage file systems, such as chrome's
requestfilesystem() method.
... basic concepts there are two ways to get access to a filesystem object: you can directly ask for one representing a sandboxed file system created just for your web app directly by calling window.
requestfilesystem().
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FileSystemDirectoryEntry.getDirectory() - Web APIs
fileerror.security_err the
request to access the directory was denied for security reasons.
... create optional if this property is true, and the
requested file or directory doesn't exist, the user agent should create it.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FileSystemDirectoryEntry.getFile() - Web APIs
fileerror.security_err the
request to access the file was denied for security reasons.
... create optional if this property is true, and the
requested file or directory doesn't exist, the user agent should create it.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FileSystemDirectoryEntry - Web APIs
window.
requestfilesystem = window.
requestfilesystem || window.webkit
requestfilesystem; window.directoryentry = window.directoryentry || window.webkitdirectoryentry; ...
... function onfs(fs){ fs.root.getdirectory('documents', {create:true}, function(directoryentry){ //directoryentry.isfile === false //directoryentry.isdirectory === true //directoryentry.name === 'documents' //directoryentry.fullpath === '/documents' }, onerror); } // opening a file system with temporary storage window.
requestfilesystem(temporary, 1024*1024 /*1mb*/, onfs, onerror); properties this interface has no properties of its own, but inherits properties from its parent interface, filesystementry.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FileSystemEntry - Web APIs
window.
requestfilesystem = window.
requestfilesystem || window.webkit
requestfilesystem; ...
... // opening a file system with temporary storage window.
requestfilesystem(temporary, 1024*1024 /*1mb*/, function(fs) { fs.root.getfile('log.txt', {}, function(fileentry) { fileentry.remove(function() { console.log('file removed.'); }, onerror); }, onerror); }, onerror); properties this interface provides the following properties.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FullscreenOptions.navigationUI - Web APIs
the fullscreenoptions dictionary's navigationui property is used when calling
requestfullscreen() to specify to what extent the user agent should include its standard user interface while the element is presented in full-screen mode.
... example in this example, the entire document is placed into full-screen mode by calling
requestfullscreen() on the document's document.documentelement, which is the document's root <html> element.
... let elem = document.documentelement; elem.
requestfullscreen({ navigationui: "show" }).then({}).catch(err => { alert(`an error occurred while trying to switch into full-screen mode: ${err.message} (${err.name})`); }); the promise's resolve handler does nothing, but if the promise is rejected, an error message is displayed by calling alert().
HTMLImageElement.crossOrigin - Web APIs
permitted values are: anonymous
requests by the <img> element have their mode set to cors and their credentials mode set to same-origin.
... use-credentials
requests by the htmlimageelement will use the cors mode and the include credentials mode; all image
requests by the element will use cors, regardless of what domain the fetch is from.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
HTMLTableElement - Web APIs
when set, if the object doesn't represent a <caption>, a domexception with the hierarchy
requesterror name is thrown.
...when set, if the object doesn't represent a <thead>, a domexception with the hierarchy
requesterror name is thrown.
...when set, if the object doesn't represent a <tfoot>, a domexception with the hierarchy
requesterror name is thrown.
IDBDatabase: abort event - Web APIs
// open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('mi...
...nutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = (event) => { const db = dbopen
request.result; db.addeventlistener('abort', () => { console.log('transaction aborted'); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // abort the transaction transaction.abort(); }; the same example, but assigning the event handler to the onabort property: // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = (event) => { const db = event.target.re...
...asktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = (event) => { const db = dbopen
request.result; db.onabort = () => { console.log('transaction aborted'); }; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // abort the transaction transaction.abort(); }; ...
IDBDatabase: close event - Web APIs
bubbles no cancelable no interface event event handler property onerror examples this example opens a database and listens for the close event: // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('mi...
...nutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = (event) => { const db = dbopen
request.result; db.addeventlistener('close', () => { console.log('database connection closed'); }); }; the same example, using the onclose property instead of addeventlistener(): // open the database const dbopen
request = window.indexeddb.open('todolist', 4); dbopen
request.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the object...
...store will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopen
request.onsuccess = (event) => { const db = dbopen
request.result; db.onclose = () => { console.log('database connection closed'); }; }; ...
IDBDatabase.deleteObjectStore() - Web APIs
transactioninactiveerror occurs if a
request is made on a source database that doesn't exist (e.g.
... example var dbname = "sampledb"; var dbversion = 2; var
request = indexeddb.open(dbname, dbversion);
request.onupgradeneeded = function(e) { var db =
request.result; if (e.oldversion < 1) { db.createobjectstore("store1"); } if (e.oldversion < 2) { db.deleteobjectstore("store1"); db.createobjectstore("store2"); } // etc.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBDatabase.name - Web APIs
// let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being // opened successfully, or not dbopen
request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... this is used a lot below db = dbopen
request.result; // this line will log the name of the database, which should be "todolist" console.log(db.name); }; specifications specification status comment indexed database api 2.0the definition of 'name' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBDatabase.objectStoreNames - Web APIs
example // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopen
request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... this is used a lot below db = dbopen
request.result; // this line will log the version of the connected database, which should be // an object that looks like { ['my-store-name'] } console.log(db.objectstorenames); }; specifications specification status comment indexed database api 2.0the definition of 'objectstorenames' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBDatabase.onabort - Web APIs
}; example this example shows an idbopendb
request.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases.
... dbopen
request.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function() { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function() { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notif...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBDatabase.transaction() - Web APIs
for a complete example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // this is used a lot below db = dbopen
request.result; // run the displaydata() function to populate the task list with // all the to-do list data already in the idb displaydata(); }; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBDatabase.version - Web APIs
example // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); // these two event handlers act on the database // being opened successfully, or not dbopen
request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... this is used a lot below db = dbopen
request.result; // this line will log the version of the connected database, which should be "4" console.log(db.version); }; specifications specification status comment indexed database api 2.0the definition of 'version' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBIndex.getAll() - Web APIs
syntax var getallkeys
request = idbindex.getall(); var getallkeys
request = idbindex.getall(query); var getallkeys
request = idbindex.getall(query, count); parameters query optional a key or an idbkeyrange identifying the records to retrieve.
... return value an idb
request object on which subsequent events related to this operation are fired.
... example var myindex = objectstore.index('index'); var getall
request = myindex.getall(); getall
request.onsuccess = function() { console.log(getall
request.result); } specification specification status comment indexed database api draftthe definition of 'getall()' in that specification.
IDBObjectStore.indexNames - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopen
request = window.indexeddb.open("todolist", 4); dbopen
request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...duplicate items not allowed.</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todolist"); console.log(objectstore.indexnames); // make a
request to add our newitem object to the object store var objectstore
request = objectstore.add(newitem[0]); objectstore
request.onsuccess = function(event) { // report the success of our
request note.innerhtml += '<li>
request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'indexnames' in that specificat...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBTransactionSync - Web APIs
idbobjectstoresync objectstore( in domstring name ) raises (idbdatabaseexception); parameters name the name of the
requested object store.
... returns idbobjectstoresync an object for accessing the
requested object store.
... exceptions the method can raise an idbdatabaseexception with the following code: not_found_err if the
requested object store is not in this transaction's scope.
Locks.mode - Web APIs
the mode read-only property of the lock interface returns the access mode passed to lockmanager.
request() when the lock was
requested.
... example the following examples show how the mode property is passed in the call to lockmanager.
request().
... // should show "exclusive" (the default) navigator.locks.
request("my_resource", show_lock_properties); // should show "exclusive" navigator.locks.
request("my_resource", {mode: "exclusive"}, show_lock_properties); // should show "shared" navigator.locks.
request("my_resource", {mode: "shared"}, show_lock_properties); function show_lock_properties(lock) { console.log(`the lock name is: ${lock.name}`); console.log(`the lock mode is: ${lock.mode}`); } specifications specification status comment web locks apithe definition of 'mode' in that specification.
LockedFile.getMetadata() - Web APIs
syntax var
request = instanceoflockedfile.getmetadata(param); parameters param optional an object used to
request specific metadata.
...the following metadata are supported: size : will provide the size of the file lastmodified : will provide the date when the file was last modified return a file
request object.
... in case of success, the
request's result is an object with the metadata
requested through the param object.
LockedFile.readAsArrayBuffer() - Web APIs
syntax var
request = instanceoflockedfile.readasarraybuffer(size); parameters size a number representing the number of bytes to read in the file.
... return a file
request object to handle the success or failure of the operation.
... in case of success, the
request's result is an arraybuffer representing the data that have been read.
LockedFile.readAsText() - Web APIs
syntax var
request = instanceoflockedfile.readastext(size[, encoding]); parameters size a number representing the number of bytes to read in the file.
... return a file
request object to handle the success or failure of the operation.
... in case of success, the
request's result is a string representing the data that have been read.
MediaTrackConstraints.cursor - Web APIs
the mediatrackconstraints dictionary's cursor property is a constraindomstring describing the
requested or mandatory constraints placed upon the value of the cursor constrainable property, which is used to specify whether or not the cursor should be included in the captured video.
... example: cursor always visible this example sets up the constraints to
request that the cursor always be visible.
... let displaymediaoptions = { cursor: "always" }; example: cursor visible during motion with fallback in this example, the cursor property is configured to
request that the cursor be visible when in motion, falling back to always being visible if the user agent doesn't support in-motion only cursor rendering.
MerchantValidationEvent.complete() - Web APIs
another payment
request is currently being processed, the current payment
request is not currently being displayed to the user, or payment information is currently being updated.
... example in this example, we see the client-side code needed to support merchant validation for a payment
request called pay
request: pay
request.onmerchantvalidation = event => { const validationdatapromise = getvalidationdata(event.validationurl); event.complete(validationdatapromise); } function getvalidationdata(url) { /* ...retrieve the validation data from the url...
... specifications specification status comment payment
request apithe definition of 'merchantvalidationevent.complete()' in that specification.
NavigationPreloadManager - Web APIs
addeventlistener('fetch', event => { event.respondwith(async function() { // respond from the cache if we can const cachedresponse = await caches.match(event.
request); if (cachedresponse) return cachedresponse; // else, use the preloaded response, if it's there const response = await event.preloadresponse; if (response) return response; // else try the network.
... return fetch(event.
request); }()); }); specifications specification status comment service workersthe definition of 'navigationpreloadmanager' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
Online and offline events - Web APIs
you need to know when the user is offline, so that you can queue your server
requests for a later time.
...according to the specification: the navigator.online attribute must return false if the user agent will not contact the network when the user follows links or when a script
requests a remote page (or knows that such an attempt would fail)...
...und: red; } and the corresponding htmlxxx when mochitests for this are created, point to those instead and update this example -nickolay <div id="status"></div> <div id="log"></div> <p>this is a test</p> here's the live result notes if the api isn't implemented in the browser, you can use other signals to detect if you are offline including using service workers and responses from xmlhttp
request.
Notifications API - Web APIs
first, the user needs to grant the current origin permission to display system notifications, which is generally done when the app or site initialises, using the notification.
requestpermission() method.
... this should be done in response to a user gesture, such as clicking a button, for example: btn.addeventlistener('click', function() { let promise = notification.
requestpermission(); // wait for permission }) this is not only best practice — you should not be spamming users with notifications they didn't agree to — but going forward browsers will explicitly disallow notifications not triggered in response to a user gesture.
... this will spawn a
request dialog, along the following lines: from here the user can choose to allow notifications from this origin, or block them.
PaymentAddress.toJSON() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
...requires the comma-delineated list in dom.payments.
request.supportedregions to contain one or more of the supported 2-character iso locales, currently us and ca.disabled from version 62: this feature is behind the dom.payments.
request.enabled preference (needs to be set to true).
...requires the comma-delineated list in dom.payments.
request.supportedregions to contain one or more of the supported 2-character iso locales, currently us and ca.disabled from version 62: this feature is behind the dom.payments.
request.enabled preference (needs to be set to true).
PaymentCurrencyAmount.currencySystem - Web APIs
this obsolete property was removed in the may 3, 2018 update of the payment
request api specification.
... specifications specification status comment payment
request apithe definition of 'paymentcurrencyamount' in that specification.
... candidate recommendation no longer part of the specification payment
request api the definition of 'paymentcurrencyamount.currencysystem' in that specification.
PaymentDetailsUpdate - Web APIs
this can be done either by calling the payment
requestupdateevent.updatewith() method or by using the payment
request.show() method's detailspromise parameter to provide a promise that returns a paymentdetailsupdate that updates the payment information before the user interface is even enabled for the first time.
... displayitems optional an array of paymentitem objects, each describing one line item for the payment
request.
... specifications specification status comment payment
request apithe definition of 'paymentdetailsupdate' in that specification.
PaymentMethodChangeEvent.methodDetails - Web APIs
request.onpaymentmethodchange = function(ev) { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "visa": // do apple pay specific handling for visa card...
... ev.updatewith(newstuff); }; const response = await
request.show(); note that the methoddetails property is being used by the calculatediscount() function to compute any payment discount, then updatewith() is called to update the event with the computed update.
... specifications specification status comment payment
request apithe definition of 'paymentmethodchangeevent.methoddetails' in that specification.
PaymentMethodChangeEvent.methodName - Web APIs
see payment method identifiers in payment
request api for more information.
...
request.onpaymentmethodchange = function(ev) { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "visa": // do apple pay specific handling for visa card...
... ev.updatewith(newstuff); }; const response = await
request.show(); specifications specification status comment payment
request apithe definition of 'paymentmethodchangeevent.methodname' in that specification.
PaymentValidationErrors - Web APIs
the paymentvalidationerrors dictionary represents objects providing information about any and all errors that occurred while processing a payment
request.
... when validation of the paymentresponse returned by the payment
request.show() or paymentresponse.retry() methods fails, your code creates a paymentvalidationerrors object to pass into retry() so that the user agent knows what needs to be fixed and what if any error messages to display to the user.
... example specifications specification status comment payment
request api candidate recommendation initial definition.
ProgressEvent - Web APIs
the progressevent interface represents events measuring progress of an underlying process, like an http
request (for an xmlhttp
request, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>).
... examples the following example adds a progressevent to a new xmlhttp
request and uses it to display the status of the
request.
... var progressbar = document.getelementbyid("p"), client = new xmlhttp
request() client.open("get", "magical-unicorns") client.onprogress = function(pe) { if(pe.lengthcomputable) { progressbar.max = pe.total progressbar.value = pe.loaded } } client.onloadend = function(pe) { progressbar.value = pe.loaded } client.send() specifications specification status comment xmlhttp
requestthe definition of 'progressevent' in that specification.
PublicKeyCredentialCreationOptions.extensions - Web APIs
extensions are values
requesting additional processing by the client and by the authenticator.
... note: an analogous option exists for the fetching operation (navigators.credentials.get()), see publickeycredential
requestoptions.extensions.
...as of june 2020, only appid (used during creation with publickeycredential
requestoptions.extensions) is supported by chrome and edge.
PublicKeyCredentialCreationOptions - Web APIs
properties publickeycredentialcreationoptions.rp an object describing the relying party which
requested the credential creation.
...those extensions are used to
request additional processing (e.g.
...smith", }, //
requested format of new keypair pubkeycredparams: [{ type: "public-key", alg: cose_alg_ecdsa_w_sha256, }], // timeout after 1 minute timeout: 60000, // do not send the authenticator's origin attestation attestation: "none", extensions: { uvm: true, exts: true }, // filter out authenticators...
PushManager.register() - Web APIs
the register method is used to ask the system to
request a new endpoint for notifications.
... syntax var
request = navigator.push.register(); return a dom
request object to handle the success or failure of the method call.
... if the method call is successful, the
request's result will be a string, which is the endpoint url.
PushManager.unregister() - Web APIs
syntax var
request = navigator.push.unregister(pushendpoint); properties pushendpoint a pushendpoint to be unregistered.
... return a dom
request object to handle the success or failure of the method call.
... if the method call is successful, the
request's result will be a pushregistration object representing the endpoint that has been unregistered.
PushManager - Web APIs
the pushmanager interface of the push api provides a way to receive notifications from third-party servers as well as
request urls for push notifications.
... deprecated methods pushmanager.haspermission() returns a promise that resolves to the pushpermissionstatus of the
requesting webapp, which will be one of granted, denied, or default.
....serviceworker.register('serviceworker.js').then( function(serviceworkerregistration) { serviceworkerregistration.pushmanager.subscribe().then( function(pushsubscription) { console.log(pushsubscription.endpoint); // the push subscription details needed by the application // server are now available, and can be sent to it using, // for example, an xmlhttp
request.
RTCIceCandidatePairStats.readable - Web APIs
the obsolete rtcicecandidatepairstats property readable reports whether or not the connection described by the candidate pair has received at least one valid incoming ice
request.
... syntax isreadable = rtcicecandidatepairstats.readable; value a boolean value which is true if the connection described by this candidate pair has received at least one valid ice
request, and is therefore ready to be read from.
... note: this property was removed from the specification in early 2017 because you can determine whether or not the connection is readable by checking to see if
requestsreceived is greater than 0: if (icpstats.
requestsreceived > 0) { /* at least one ice
request has been received */ } ...
RTCIceCandidatePairStats.retransmissionsReceived - Web APIs
the rtcicecandidatepairstats dictionary's retransmissionsreceived property indicates the total number of stun connectivity check
request retransmissions that have been received so far on the pair of candidates.
... syntax retransmissionsreceived = rtcicecandidatepairstats.retransmissionsreceived; value an integer value indicating the total number of retransmitted stun connectivity check
requests have been received on the connection referenced by this candidate pair so far.
... note: retransmissions are connectivity check
requests with a transaction_transmit_counter attribute whose req field is greater than 1 (indicating that the
request has been transmitted more than once).
RTCIceCandidatePairStats.retransmissionsSent - Web APIs
the rtcicecandidatepairstats dictionary's retransmissionssent property indicates the total number of stun connectivity check
request retransmissions that have been sent so far on the pair of candidates.
... syntax retransmissionssent = rtcicecandidatepairstats.retransmissionssent; value an integer value indicating the total number of retransmitted stun connectivity check
requests have been sent on the connection referenced by this candidate pair so far.
... note: retransmissions are connectivity check
requests with a transaction_transmit_counter attribute whose req field is greater than 1 (indicating that the
request has been transmitted more than once).
RTCIceCandidatePairStats.totalRoundTripTime - Web APIs
the rtcicecandidatepairstats dictionary's totalroundtriptime property is the total time that has elapsed between sending stun
requests and receiving the responses, for all such
requests that have been made so far on the pair of candidates described by this rtcicecandidatepairstats object.
... this value includes both connectivity check and consent check
requests.
... syntax totalrtt = rtcicecandidatepairstats.totalroundtriptime; value this floating-point value indicates the total number of seconds which have elapsed between sending out stun connectivity and consent check
requests and receiving their responses, for all such
requests made so far on the connection described by this candidate pair.
RTCPeerConnection.restartIce() - Web APIs
the webrtc api's rtcpeerconnection interface offers the restartice() method to allow a web application to easily
request that ice candidate gathering be redone on both ends of the connection.
... if negotiation fails to complete—either due to rollback or because incoming offers are in the process of being negotiated—the rtcpeerconnection will remember that you
requested ice restart.
... pc.addeventlistener("iceconnectionstatechange", event => { if (pc.iceconnectionstate === "failed") { /* possibly reconfigure the connection in some way here */ /* then
request ice restart */ pc.restartice(); } }); with this code in place, a transition to the failed state during ice negotiation will cause a negotiationneeded event to be fired, in response to which your code should renegotiate as usual.
Response.clone() - Web APIs
example in our fetch response clone example (see fetch response clone live) we create a new
request object using the
request() constructor, passing it a jpg path.
... we then fetch this
request using fetch().
... var image1 = document.queryselector('.img1'); var image2 = document.queryselector('.img2'); var my
request = new
request('flowers.jpg'); fetch(my
request).then(function(response) { var response2 = response.clone(); response.blob().then(function(myblob) { var objecturl = url.createobjecturl(myblob); image1.src = objecturl; }); response2.blob().then(function(myblob) { var objecturl = url.createobjecturl(myblob); image2.src = objecturl; }); }); specifications specification status comment fetchthe definition of 'clone()' in ...
Response.headers - Web APIs
example in our fetch response example (see fetch response live) we create a new
request object using the
request() constructor, passing it a jpg path.
... we then fetch this
request using fetch(), extract a blob from the response using body.blob, create an object url out of it using url.createobjecturl, and display this in an <img>.
... var myimage = document.queryselector('img'); var my
request = new
request('flowers.jpg'); fetch(my
request).then(function(response) { console.log(response.headers); // returns a headers{} object response.blob().then(function(myblob) { var objecturl = url.createobjecturl(myblob); myimage.src = objecturl; }); }); specifications specification status comment fetchthe definition of 'headers' in that specification.
Response.ok - Web APIs
example in our fetch response example (see fetch response live) we create a new
request object using the
request() constructor, passing it a jpg path.
... we then fetch this
request using fetch(), extract a blob from the response using body.blob, create an object url out of it using url.createobjecturl, and display this in an <img>.
... var myimage = document.queryselector('img'); var my
request = new
request('flowers.jpg'); fetch(my
request).then(function(response) { console.log(response.ok); // returns true if the response returned successfully response.blob().then(function(myblob) { var objecturl = url.createobjecturl(myblob); myimage.src = objecturl; }); }); specifications specification status comment fetchthe definition of 'ok' in that specification.
Response.redirected - Web APIs
the read-only redirected property of the response interface indicates whether or not the response is the result of a
request you made which was redirected.
... syntax var isredirected = response.redirected; value a boolean which is true if the response indicates that your
request was redirected.
... examples detecting redirects checking to see if the response comes from a redirected
request is as simple as checking this flag on the response object.
Response.status - Web APIs
example in our fetch response example (see fetch response live) we create a new
request object using the
request() constructor, passing it a jpg path.
... we then fetch this
request using fetch(), extract a blob from the response using body.blob, create an object url out of it using url.createobjecturl, and display this in an <img>.
... var myimage = document.queryselector('img'); var my
request = new
request('flowers.jpg'); fetch(my
request).then(function(response) { console.log(response.status); // returns 200 response.blob().then(function(myblob) { var objecturl = url.createobjecturl(myblob); myimage.src = objecturl; }); }); specifications specification status comment fetchthe definition of 'status' in that specification.
Response.statusText - Web APIs
example in our fetch response example (see fetch response live) we create a new
request object using the
request() constructor, passing it a jpg path.
... we then fetch this
request using fetch(), extract a blob from the response using body.blob, create an object url out of it using url.createobjecturl, and display this in an <img>.
... var myimage = document.queryselector('img'); var my
request = new
request('flowers.jpg'); fetch(my
request).then(function(response) { console.log(response.statustext); // returns "ok" if the response returned successfully response.blob().then(function(myblob) { var objecturl = url.createobjecturl(myblob); myimage.src = objecturl; }); }); specifications specification status comment fetchthe definition of 'statustext' in that specification.
Response.url - Web APIs
example in our fetch response example (see fetch response live) we create a new
request object using the
request() constructor, passing it a jpg path.
... we then fetch this
request using fetch(), extract a blob from the response using body.blob, create an object url out of it using url.createobjecturl, and display this in an <img>.
... var myimage = document.queryselector('img'); var my
request = new
request('flowers.jpg'); fetch(my
request).then(function(response) { console.log(response.url); // returns /docs/web/api/response/flowers.jpg response.blob().then(function(myblob) { var objecturl = url.createobjecturl(myblob); myimage.src = objecturl; }); }); specifications specification status comment fetchthe definition of 'url' in that specification.
ServiceWorkerGlobalScope.onfetch - Web APIs
when fired, the code returns a promise that resolves to the first matching
request in the cache object.
... self.addeventlistener('fetch', function(event) { console.log('handling fetch event for', event.
request.url); event.respondwith( caches.match(event.
request).then(function(response) { if (response) { console.log('found response in cache:', response); return response; } console.log('no response found in cache.
... about to fetch from network...'); return fetch(event.
request).then(function(response) { console.log('response from network is:', response); return response; }).catch(function(error) { console.error('fetching failed:', error); throw error; }); }) ); }); specifications specification status comment service workersthe definition of 'event handlers' in that specification.
StorageQuota - Web APIs
the storagequota property of the navigator interface of the quota management api provides means to query and
request storage usage and quota information.
... storagequota.
requestpersistentquota
requests persistent storage for the
requesting application and returns a promise to an instance of storageinfo.
... there is no guarantee that the
requested space will be granted by the user agent.
USBOutTransferResult - Web APIs
it represents the result from
requesting a transfer of data from the usb host to the usb device.
... properties usbouttransferresult.byteswrittenread only returns the number of bytes from the transfer
request that were sent to the device.
... usbouttransferresult.statusread only returns the status of the transfer
request, one of: "ok" - the transfer was successful.
Visual Viewport API - Web APIs
one thing that may not be clear in this example is the use of the pendingupdate flag and the call to
requestanimationframe().
...using
requestanimationframe() ensures that the transform ocurrs before the next render.
... let pendingupdate = false; function viewporthandler(event) { if (pendingupdate) return; pendingupdate = true;
requestanimationframe(() => { pendingupdate = false; var layoutviewport = document.getelementbyid('layoutviewport'); // since the bar is position: fixed we need to offset it by the // visual viewport's offset from the layout viewport origin.
WakeLockSentinel - Web APIs
an object representing the wake lock is returned via the navigator.wakelock.
request() method.
... examples in this example we create an asynchronous function which
requests a wakelocksentinel.
... // create a reference for the wake lock let wakelock = null; // create an async function to
request a wake lock const
requestwakelock = async () => { try { wakelock = await navigator.wakelock.
request('screen'); // listen for our release event wakelock.addeventlistener('release', () => { // if wake lock is released alter the ui accordingly }); } catch (err) { // if wake lock
request fails - usually system related, such as battery } } wakelockonbutton.addeventlistener('click', () => {
requestwakelock(); }) wakelockoffbutton.addeventlistener('click', () => { if (wakelock !== null) { wa...
WebGLActiveInfo - Web APIs
properties webglactiveinfo.name the read-only name of the
requested variable.
... webglactiveinfo.size the read-only size of the
requested variable.
... webglactiveinfo.type the read-only type of the
requested variable.
WebGLRenderingContext.makeXRCompatible() - Web APIs
ase invalidstateerror: showsimplemessagebox("you don't appear to have a compatible xr headset available.", "cancel"); break; default: handlefatalerror(err); break; } xrsession.end(); } } async function handlestartbuttonclick(event) { if (event.target.classlist.contains("use-webxr") && navigator.xr) { try { xrsession = await navigator.xr.
requestsession("immersive-vr"); usingxr = true; } catch(err) { xrsession = null; usingxr = false; } } startgame(); } function startgame() { currentscene = "scene1"; loadsceneresources(currentscene); /* and so on */ } this works by having two buttons, one which starts the game normally and the other which starts the game in vr mode.
...the function determines that the button clicked was the one
requesting immersive-vr mode by checking to see if the button has the use-webxr class on it.
... if the button clicked by the user has that class (and we've confirmed that webxr is available by ensuring that the navigator.xr property exists), we use
requestsession() to
request a new webxr session and set the usingxr flag to true.
A basic 2D WebGL animation example - Web APIs
entrotation); gl.uniform4fv(uglobalcolor, [0.1, 0.7, 0.2, 1.0]); gl.bindbuffer(gl.array_buffer, vertexbuffer); avertexposition = gl.getattriblocation(shaderprogram, "avertexposition"); gl.enablevertexattribarray(avertexposition); gl.vertexattribpointer(avertexposition, vertexnumcomponents, gl.float, false, 0, 0); gl.drawarrays(gl.triangles, 0, vertexcount); window.
requestanimationframe(function(currenttime) { let deltaangle = ((currenttime - previoustime) / 1000.0) * degreespersecond; currentangle = (currentangle + deltaangle) % 360; previoustime = currenttime; animatescene(); }); } the first thing that needs to be done in order to draw a frame of the animation is to clear the background to the desired color.
...that's done here by calling
requestanimationframe(), which asks that a callback function be executed the next time the browser is ready to update the screen.
... our
requestanimationframe() callback receives as input a single parameter, currenttime, which specifies the time at which the frame drawing began.
WebRTC connectivity - Web APIs
srflx a server reflexive candidate is generated by a stun/turn server; the connection's initiator
requests a candidate from the stun server, which forwards the
request through the remote peer's nat, which creates and returns a candidate whose ip address is local to the remote peer.
... the stun server then replies to the initiator's
request with a candidate whose ip address is unrelated to the remote peer.
... tcp candidate types tcp candidates (that is, candidates whose protocol is tcp) can be of these types: active the transport will try to open an outbound connection but won't receive incoming connection
requests.
Signaling and video calling - Web APIs
you can use anything you like, from websocket to xmlhttp
request to carrier pigeons to exchange the signaling information between the two peers.
...this function's role is to close the call, and send a signalling server notification to the other peer,
requesting it also close.
... once the rtcpeerconnection has been created, we
request access to the user's camera and microphone by calling mediadevices.getusermedia(), which is exposed to us through the navigator.mediadevices.getusermedia property.
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
here's what that looks like conceptually: your code tells the webxr engine that you want to provide the next animation frame by calling the xrsession method
requestanimationframe(), providing a callback function that renders a frame of animation.
... example frame callback a fairly basic (but typical) callback for rendering frames might look like this: function myanimationframecallback(time, frame) { let adjustedrefspace = applypositionoffsets(xrreferencespace); let pose = frame.getviewerpose(adjustedrefspace); animationframe
requestid = frame.session.
requestanimationframe(myanimationframecallback); if (pose) { let gllayer = frame.session.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); checkglerror("binding the framebuffer"); gl.clearcolor(0, 0, 0, 1.0); gl.cleardepth(1.0); gl.clear(gl.color_buffer_bit | gl.depth_buffer_bit); checkglerror("clearing the framebuffe...
... next, we go ahead and queue up the
request to render the next frame of video, so we don't have to worry about doing it later, by simply calling
requestanimationframe() again.
Visualizations with Web Audio API - Web APIs
escribed in the previous section to set up the buffer: analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); next, we clear the canvas of what had been drawn on it before to get ready for the new visualization display: canvasctx.clearrect(0, 0, width, height); we now define the draw() function: function draw() { in here, we use
requestanimationframe() to keep looping the drawing function once it has been started: var drawvisual =
requestanimationframe(draw); next, we grab the time domain data and copy it into our array analyser.getbytetimedomaindata(dataarray); next, fill the canvas with a solid colour to start canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); set a line width and stroke...
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); next, we start our draw() function off, again setting up a loop with
requestanimationframe() so that the displayed data keeps updating, and clearing the display with each animation frame.
... function draw() { drawvisual =
requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); now we set our barwidth to be equal to the canvas width divided by the number of bars (the buffer length).
XRRigidTransform() - Web APIs
examples in this example, the beginning of the animation of a scene is shown, starting with a
request for a reference space of a given type, then shifting the coordinate system based on a transform before
requesting the first animation frame.
... let animationframe
requestid = 0; xrsession.
requestreferencespace("local-floor") .then((refspace) => { xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform(viewerposition, viewerorientation)); animationframe
requestid = xrsession.
requestanimationframe(drawframe); }); after
requesting a reference space of type local-floor, the returned promise is eventually resolved, at which time we receive a new reference space object, refspace.
... then
requestanimationframe() is called to ask for a new animation frame to draw into.
XRRigidTransform - Web APIs
even better, once it's been computed, it's cached so that subsequent
requests are significantly faster.
...it then
requests the first animation frame callback by calling the session's
requestanimationframe() method.
... xrsession.
requestreferencespace(refspacetype) .then((refspace) => { xrreferencespace = refspace; xrreferencespace = xrreferencespace.getoffsetreferencespace( new xrrigidtransform(viewerstartposition, cubeorientation)); animationframe
requestid = xrsession.
requestanimationframe(drawframe); specifications specification status comment webxr device apithe definition of 'xrrigidtransform' in that specification.
XRSession.visibilityState - Web APIs
the possible values of visibilitystate are: hidden the virtual scene generated by the xrsession is not currently visible to the user, so its
requestanimationframe() callbacks are not being executed until thevisibilitystate changes.
...to that end, the session's
requestanimationframe() callbacks are being processed at the xr device's native refresh rate and input controllers are being processed as normal.
...in order to optimize resource utilization, the user agent may be handling the session's
requestanimationframe() callbacks at a throttled rate.
XRVisibilityState - Web APIs
values hidden the virtual scene generated by the xrsession is not currently visible to the user, so its
requestanimationframe() callbacks are not being executed until thevisibilitystate changes.
...to that end, the session's
requestanimationframe() callbacks are being processed at the xr device's native refresh rate and input controllers are being processed as normal.
...in order to optimize resource utilization, the user agent may be handling the session's
requestanimationframe() callbacks at a throttled rate.
XRWebGLLayer() - Web APIs
the browser selects the anti-aliasing method to use; there is no support for
requesting a specific mode yet.
... depth optional a boolean value which, if true,
requests that the new layer have a depth buffer; otherwise, no depth layer is allocated.
... stencil optional a boolean value which, if true,
requests that the new layer include a stencil buffer.
XRWebGLLayerInit.antialias - Web APIs
the boolean antialias property, if present and set to true in the xrwebgllayerinit object provided as the xrwebgllayer() constructor's layerinit parameter,
requests that the new webgl rendering layer support anti-aliasing.
... there is no way to
request a specific anti-aliasing format or level; this decision is left up to the user agent.
... syntax let layerinit = { antialias: boolvalue }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { antialias: boolvalue }); value a boolean value which can be set to true to
request anti-aliasing support in the new webgl rendering layer.
XRWebGLLayerInit - Web APIs
the browser selects the anti-aliasing method to use; there is no support for
requesting a specific mode yet.
... depth optional a boolean value which, if true,
requests that the new layer have a depth buffer; otherwise, no depth layer is allocated.
... stencil optional a boolean value which, if true,
requests that the new layer include a stencil buffer.
Cognitive accessibility - Accessibility
enable the user to postpone content updates by providing a way to
request content updates rather than updating automatically.
... change setting based on an active
request form control operation and data entry should result in predictable behavior.
... if a submission causes a legal or financial transaction to occur, provide a stated time within which the
request can be amended or canceled by the user.
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
no support for document formatting or "dom" as
requested by some vendors: support a custom interface that gives them the formatting information they are
requesting.
...the tree view object itself handles all of the
requests for get_accname for child objects.
... when the win32 api function accessibleobjectfromwindow() is called, windows sends the window in question a wm_getobject message
requesting an iaccessible for your root object in the window.
Web accessibility for seizures and physical reactions - Accessibility
this is "1" if the user has
requested not to be tracked by web sites, content, or advertising" media queries level 5 environmentmq (planned in media queries level 5) light-level has three valid values: dim, normal, and washed.
... prefers-contrast from w3c's draft document, media queries level 5 section on prefers-contrast: "the prefers-contrast media feature is used to detect if the user has
requested the system increase or decrease the amount of contrast between adjacent colors.
... prefers-reduced-transparency the prefers-reduced-transparency media feature is used to detect if the user has
requested the system minimize the amount of transparent or translucent layer effects it uses.
CSS Animations tips and tricks - CSS: Cascading Style Sheets
function play() { document.queryselector(".box").classname = "box"; window.
requestanimationframe(function(time) { window.
requestanimationframe(function(time) { document.queryselector(".box").classname = "box changing"; }); }); } this looks weird, doesn't it?
... to be sure that the styles are recalculated, we use window.
requestanimationframe(), specifying a callback.
... our callback cleverly calls
requestanimationframe() a second time!
HTML5 - Developer guides
server-sent events allows a server to push events to a client, rather than the classical paradigm where the server could send data only in response to a client's
request.
... xmlhttp
request level 2 allows fetching asynchronously some parts of the page, allowing it to display dynamic content, varying according to the time and user actions.
...
requestanimationframe allows control of animations rendering to obtain optimal performance.
Index - Developer guides
2 ajax ajax, dom, json, javascript, references, xmlhttp
request asynchronous javascript and xml, while not a technology in itself, is a term coined in 2005 by jesse james garrett, that describes a "new" approach to using a number of existing technologies together 3 community ajax if you know of useful mailing lists, newsgroups, forums, or other communities related to ajax, please link to them here.
... 4 getting started ajax, api, advanced, javascript, webmechanics, xmlhttp
request this article guides you through the ajax basics and gives you some simple hands-on examples to get you started.
... 37 parsing and serializing xml ajax, add-ons, dom, dom parsing, document, extensions, guide, htmldocument, json, parsing, parsing xml, serializing, serializing xml, xml, xmldocument, xmlhttp
request in this article, we'll look at the objects provided by the web platform to make the common tasks of serializing and parsing xml easy.
Parsing and serializing XML - Developer guides
xmlhttp
request loads content from a url; xml content is returned as an xml document object with a dom tree built from the xml itself.
..."error while parsing" : odom.documentelement.nodename); parsing url-addressable resources into dom trees using xmlhttp
request here is sample code that reads and parses a url-addressable xml file into a dom tree: var xhr = new xmlhttp
request(); xhr.onload = function() { dump(xhr.responsexml.documentelement.nodename); } xhr.onerror = function() { dump("error while getting xml."); } xhr.open("get", "example.xml"); xhr.responsetype = "document"; xhr.send(); the value returned in the xhr object's responsexml field is...
...alternatively, use a dom tree obtained from xmlhttp
request.
User input and controls - Developer guides
this is the code to
request pointer lock on an element: element.
requestpointerlock(); note: for a full tutorial and reference, read our pointer_lock_api page.
...you can achieve this by calling element.
requestfullscreen() on that element.
... bear in mind that many browsers still implement this with a vendor prefix, so you will probably need to fork your code something like this: var elem = document.getelementbyid("myvideo"); if (elem.
requestfullscreen) { elem.
requestfullscreen(); } else if (elem.ms
requestfullscreen) { elem.ms
requestfullscreen(); } else if (elem.moz
requestfullscreen) { elem.moz
requestfullscreen(); } else if (elem.webkit
requestfullscreen) { elem.webkit
requestfullscreen(); } note: to find more out about adding fullscreen functionality your application, read our documentation about using fullscreen mode.
HTML attribute: crossorigin - HTML: Hypertext Markup Language
the crossorigin attribute, valid on the <audio>, <img>, <link>, <script>, and <video> elements, provides support for cors, defining how the element handles crossorigin
requests, thereby enabling the configuration of the cors
requests for the element's fetched data.
... these attributes are enumerated, and have the following possible values: keyword description anonymous cors
requests for this element will have the credentials flag set to 'same-origin'.
... use-credentials cors
requests for this element will have the credentials flag set to 'include'.
<form> - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...possible (case insensitive) values: post: the post method; form data sent as the
request body.
... examples html <!-- form which will send a get
request to the current url --> <form> <label>name: <input name="submitted-name" autocomplete="name"> </label> <button>save</button> </form> <!-- form which will send a post
request to the current url --> <form method="post"> <label>name: <input name="submitted-name" autocomplete="name"> </label> <button>save</button> </form> <!-- form with fieldset, legend, and label --> <form metho...
<input type="file"> - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if the
requested facing mode isn't available, the user agent may fall back to its preferred default mode.
... note: capture was previously a boolean attribute which, if present,
requested that the device's media capture device(s) such as camera or microphone be used instead of
requesting a file input.
<input type="image"> - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...this url is then sent to the server using an http get
request.
... post the form's data is included in the body of the
request that is sent to the url given by the formaction or action attribute using an http post
request.
<input type="password"> - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
... <label for="userpassword">password: </label> <input id="userpassword" type="password" required> <input type="submit" value="submit"> specifying an input mode if your recommended (or required) password syntax rules would benefit from an alternate text entry interface than the standard keyboard, you can use the inputmode attribute to
request a specific one.
... examples
requesting a social security number this example only accepts input which matches the format for a valid united states social security number.
HTML documentation index - HTML: Hypertext Markup Language
39 html attribute: crossorigin advanced, attribute, cors, html, needscontent, reference, security the crossorigin attribute, valid on the <audio>, <img>, <link>, <script>, and <video> elements, provides support for cors, defining how the element handles crossorigin
requests, thereby enabling the configuration of the cors
requests for the element's fetched data.
...it is expected that the <keygen> element will be used in an html form along with other information needed to construct a certificate
request, and that the result of the process will be a signed certificate.
... 235 preloading content with rel="preload" guide, html, javascript, link, media, performance, web performance, as, preload, rel the preload value of the <link> element's rel attribute lets you declare fetch
requests in the html's <head>, specifying resources that your page will need very soon, which you want to start loading early in the page lifecycle, before browsers' main rendering machinery kicks in.
Using the application cache - HTML: Hypertext Markup Language
all
requests to such resources bypass the cache, even if the user is offline.
... as an example, you can use network entries to load and execute scripts and other code from the server instead of the cache: cache manifest network: /api the cache manifest section listed above ensures that
requests to load resources contained in the http://www.example.com/api/ subtree always go to the network without attempting to access the cache.
...for example, let's say the cache manifest file http://www.example.com/example.appcache includes the following content: cache manifest fallback: example/bar/ example.html any
request to http://www.example.com/example/bar/ or any of its subdirectories and their content cause the browser to issue a network
request to attempt to load the
requested resource.
Reason: Did not find method in CORS header ‘Access-Control-Allow-Methods’ - HTTP
the http method being used by the cors
request is not included in the list of methods specified by the response's access-control-allow-methods header.
... this header specifies a comma-delineated list of the http methods which may be used when using cors to access the url specified in the
request; if the
request is using any other method, this error occurs.
... for example, if the response includes: access-control-allow-methods: get,head,post trying to use a put
request will fail with this error.
Reason: CORS preflight channel did not succeed - HTTP
the cors
request requires preflight, preflighting could not be performed.
... there are a couple of reasons why preflighting might fail: a cross-site
request has previously been performed that already did a preflight, and doing the preflight again is not permitted.
... the preflight
request simply suffered any kind of networking error that might ordinarily occur.
Accept-Charset - HTTP
the accept-charset
request http header advertises which character encodings the client understands.
... if the server cannot serve any character encoding from this
request header, it can theoretically send back a 406 not acceptable error code.
... header type
request header forbidden header name yes syntax accept-charset: <charset> // multiple types, weighted with the quality value syntax: accept-charset: utf-8, iso-8859-1;q=0.5 directives <charset> a character encoding name, like utf-8 or iso-8859-15.
Allow - HTTP
this header must be sent if the server responds with a 405 method not allowed status code to indicate which
request methods can be used.
... an empty allow header indicates that the resource allows no
request methods, which might occur temporarily for a given resource, for example.
... header type entity header forbidden header name no syntax allow: <http-methods> directives <http-methods> the comma-separated list of allowed http
request methods.
Connection - HTTP
if the value sent is keep-alive, the connection is persistent and not closed, allowing for subsequent
requests to the same server to be done.
...this is the default on http/1.0
requests.
...having a persistent connection is the default on http/1.1
requests.
Content-Range - HTTP
<range-start> an integer in the given unit indicating the beginning of the
request range.
... <range-end> an integer in the given unit indicating the end of the
requested range.
... examples content-range: bytes 200-1000/67589 specifications specification title rfc 7233, section 4.2: content-range hypertext transfer protocol (http/1.1): range
requests ...
CSP: referrer - HTTP
no referrer information is sent along with
requests.
... "origin-when-cross-origin" / "origin-when-crossorigin" send a full url when performing a same-origin
request, but only send the origin of the document for other cases.
... "unsafe-url" send a full url (stripped from parameters) when performing a same-origin or cross-origin
request.
DNT - HTTP
the dnt (do not track)
request header indicates the user's tracking preference.
... header type
request header forbidden header name yes syntax dnt: 0 dnt: 1 dnt: null directives 0 the user prefers to allow tracking on the target site.
... examples reading do not track status from javascript the user's dnt preference can also be read from javascript using the navigator.donottrack property: navigator.donottrack; // "0" or "1" specifications specification status comment tracking preference expression (dnt)the definition of 'dnt header field for http
requests' in that specification.
Early-Data - HTTP
the early-data header is set by an intermediary to indicate that the
request has been conveyed in tls early data, and also indicates that the intermediary understands the 425 (too early) status code.
... the early-data header is not set by the originator of the
request (i.e., a browser).
... header type
request header forbidden header name no syntax early-data: 1 examples get /resource http/1.0 host: example.com early-data: 1 specifications specification title rfc 8470, section 5.1: the early-data header field using early data in http ...
Feature-Policy: payment - HTTP
the http feature-policy header field's payment directive controls whether the current document is allowed to use the payment
request api.
... when this policy is disabled, the payment
request() constructor will throw a syntaxerror.
... specifications specification status comment payment
request api candidate recommendation see section 16.
From - HTTP
the from
request header contains an internet email address for a human user who controls the
requesting user agent.
...a crawler), the from header should be sent, so you can be contacted if problems occur on servers, such as if the robot is sending excessive, unwanted, or invalid
requests.
... header type
request header forbidden header name no syntax from: <email> directives <email> a machine-usable email address.
If-Range - HTTP
the if-range http
request header makes a range
request conditional: if the condition is fulfilled, the range
request will be issued and the server sends back a 206 partial content answer with the appropriate body.
... header type
request header forbidden header name no syntax if-range: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt if-range: <etag> directives <etag> an entity tag uniquely representing the
requested resource.
... examples if-range: wed, 21 oct 2015 07:28:00 gmt specifications specification title rfc 7233, section 3.2: if-range hypertext transfer protocol (http/1.1): range
requests ...
Keep-Alive - HTTP
the keep-alive general header allows the sender to hint about how the connection may be used to set a timeout and a maximum amount of
requests.
... max: indicating the maximum number of
requests that can be sent on this connection before closing it.
... unless 0, this value is ignored for non-pipelined connections as another
request will be sent in the next response.
Pragma - HTTP
the pragma http/1.0 general header is an implementation-specific header that may have various effects along the
request-response chain.
... note: pragma is not specified for http responses and is therefore not a reliable replacement for the general http/1.1 cache-control header, although it does behave the same as cache-control: no-cache, if the cache-control header field is omitted in a
request.
...forces caches to submit the
request to the origin server for validation before releasing a cached copy.
Referer - HTTP
the referer
request header contains the address of the previous web page from which a link to the currently
requested page was followed.
... an unsecured http
request is used and the referring page was received with a secure protocol (https).
... header type
request header forbidden header name yes syntax referer: <url> directives <url> an absolute or partial address of the previous web page from which a link to the currently
requested page was followed.
Retry-After - HTTP
the retry-after response http header indicates how long the user agent should wait before making a follow-up
request.
... when sent with a 429 (too many
requests) response, this indicates how long to wait before making a new
request.
... when sent with a redirect response, such as 301 (moved permanently), this indicates the minimum time that the user agent is asked to wait before issuing the redirected
request.
Sec-Fetch-Dest - HTTP
the sec-fetch-dest fetch metadata header indicates the
request's destination, that is how the fetched data will be used.
... header type fetch metadata
request header forbidden header name yes, since it has prefix sec- cors-safelisted
request header syntax sec-fetch-dest: audio sec-fetch-dest: audioworklet sec-fetch-dest: document sec-fetch-dest: embed sec-fetch-dest: empty sec-fetch-dest: font sec-fetch-dest: image sec-fetch-dest: manifest sec-fetch-dest: nested-document sec-fetch-dest: object sec-fetch-dest: paintworklet sec-fetch-dest: report sec-fetch-dest: script sec-fetch-dest: serviceworker sec-fetch-dest: sharedworker sec-fetch-dest: style sec-fetch-dest: track sec-fetch-dest: video sec-fetch-dest: worker sec-fetch-dest: xslt sec-fetch-dest: audioworklet sec-fetch-dest: audioworklet values audio audioworklet document embed empty font image ...
... manifest object paintworklet report script serviceworker sharedworker style track video worker xslt nested-document examples todo specifications specification title fetch metadata
request headers the sec-fetch-dest http
request header ...
Tk - HTTP
the tk response header indicates the tracking status that applied to the corresponding
request.
...the origin server is unable or unwilling to respect a tracking preference received from the
requesting user agent.
...the
request resulted in a potential change to the tracking status applicable to this user, user agent, or device.
X-Forwarded-Host - HTTP
the x-forwarded-host (xfh) header is a de-facto standard header for identifying the original host
requested by the client in the host http
request header.
... host names and ports of reverse proxies (load balancers, cdns) may differ from the origin server handling the
request, in that case the x-forwarded-host header is useful to determine which host was originally used.
... header type
request header forbidden header name no syntax x-forwarded-host: <host> directives <host> the domain name of the forwarded server.
GET - HTTP
the http get method
requests a representation of the specified resource.
...
requests using get should only retrieve data.
...
request has body no successful response has body yes safe yes idempotent yes cacheable yes allowed in html forms yes syntax get /index.html specifications specification title rfc 7231, section 4.3.1: get hypertext transfer protocol (http/1.1): semantics and content ...
TRACE - HTTP
the final recipient of the
request should reflect the message received, excluding some fields described below, back to the client as the message body of a 200 (ok) response with a content-type of message/http.
... the final recipient is either the origin server or the first server to receive a max-forwards value of 0 in the
request.
...
request has body no successful response has body no safe no idempotent yes cacheable no allowed in html forms no syntax trace /index.html specifications specification title rfc 7231, section 4.3.8: trace hypertext transfer protocol (http/1.1): semantics and content ...
HTTP resources and specifications - HTTP
specification title status rfc 7230 hypertext transfer protocol (http/1.1): message syntax and routing proposed standard rfc 7231 hypertext transfer protocol (http/1.1): semantics and content proposed standard rfc 7232 hypertext transfer protocol (http/1.1): conditional
requests proposed standard rfc 7233 hypertext transfer protocol (http/1.1): range
requests proposed standard rfc 7234 hypertext transfer protocol (http/1.1): caching proposed standard rfc 5861 http cache-control extensions for stale content informational rfc 8246 http immutable responses proposed standard rfc 7235 hypertext transf...
... rfc 7540 hypertext transfer protocol version 2 (http/2) proposed standard rfc 7541 hpack: header compression for http/2 on the standard track rfc 7838 http alternative services on the standard track rfc 7301 transport layer security (tls) application-layer protocol negotiation extension used to negotiate http/2 at the transport to save an extra
request/response round trip.
... cross-origin resource sharing living standard rfc 7034 http header field x-frame-options informational rfc 6797 http strict transport security (hsts) proposed standard upgrade insecure
requests upgrade insecure
requests candidate recommendation content security policy 1.0 content security policy 1.0 csp 1.1 and csp 3.0 doesn't extend the http standard obsolete microsoft document specifying legacy document modes* defines x-ua-compatible note rfc 5689 http extensions for web distributed authoring and versioning (webdav) these extensions of the web, ...
200 OK - HTTP
the http 200 ok success status response code indicates that the
request has succeeded.
... the meaning of a success depends on the http
request method: get: the resource has been fetched and is transmitted in the message body.
... trace: the message body contains the
request message as received by the server.
201 Created - HTTP
the http 201 created success status response code indicates that the
request has succeeded and has led to the creation of a resource.
... the new resource is effectively created before this response is sent back and the new resource is returned in the body of the message, its location being either the url of the
request, or the content of the location header.
... the common use case of this status code is as the result of a post
request.
501 Not Implemented - HTTP
the hypertext transfer protocol (http) 501 not implemented server error response code means that the server does not support the functionality required to fulfill the
request.
... this status can also send a retry-after header, telling the
requester when to check back to see if the functionality is supported by then.
... 501 is the appropriate response when the server does not recognize the
request method and is incapable of supporting it for any resource.
BigInt.prototype.toLocaleString() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...s console.log(bigint.tolocalestring('de-de')); // → 123.456.789.123.456.789 // arabic in most arabic speaking countries uses eastern arabic digits console.log(bigint.tolocalestring('ar-eg')); // → ١٢٣٬٤٥٦٬٧٨٩٬١٢٣٬٤٥٦٬٧٨٩ // india uses thousands/lakh/crore separators console.log(bigint.tolocalestring('en-in')); // → 1,23,45,67,89,12,34,56,789 // the nu extension key
requests a numbering system, e.g.
... chinese decimal console.log(bigint.tolocalestring('zh-hans-cn-u-nu-hanidec')); // → 一二三,四五六,七八九,一二三,四五六,七八九 // when
requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(bigint.tolocalestring(['ban', 'id'])); // → 123.456.789.123.456.789 using options the results provided by tolocalestring can be customized using the options argument: var bigint = 123456789123456789n; //
request a currency format console.log(bigint.tolocalestring('de-de', { style: 'currency', currency: 'eur' })); // → 123.456.789.123.456.789,00 € // the japanese yen doesn't use a minor unit console.log(bigint.tolocalestring('ja-jp', { style: 'currency', currency: 'jpy' })) // → ¥123,456,789,123,...
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if any unicode extension values were
requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were
requested and are supported for this locale are included in locale.
..."gregory" numberingsystem the values
requested using the unicode extension keys "ca" and "nu" or filled in as default values.
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if any unicode extension values were
requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were
requested and are supported for this locale are included in locale.
... numberingsystem the value provided for this properties in the options argument, if present, or the value
requested using the unicode extension key "nu" or filled in as a default.
Intl.NumberFormat - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...r thousands console.log(new intl.numberformat('de-de').format(number)); // → 123.456,789 // arabic in most arabic speaking countries uses real arabic digits console.log(new intl.numberformat('ar-eg').format(number)); // → ١٢٣٤٥٦٫٧٨٩ // india uses thousands/lakh/crore separators console.log(new intl.numberformat('en-in').format(number)); // → 1,23,456.789 // the nu extension key
requests a numbering system, e.g.
... chinese decimal console.log(new intl.numberformat('zh-hans-cn-u-nu-hanidec').format(number)); // → 一二三,四五六.七八九 // when
requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(new intl.numberformat(['ban', 'id']).format(number)); // → 123.456,789 using options the results can be customized using the options argument: var number = 123456.789; //
request a currency format console.log(new intl.numberformat('de-de', { style: 'currency', currency: 'eur' }).format(number)); // → 123.456,79 € // the japanese yen doesn't use a minor unit console.log(new intl.numberformat('ja-jp', { style: 'currency', currency: 'jpy' }).format(number)); // → ¥123,457 // limit to three significant digits con...
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if any unicode extension values were
requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were
requested and are supported for this locale are included in locale.
... numberingsystem the value
requested using the unicode extension key "nu" or filled in as a default.
Number.prototype.toLocaleString() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...s comma as decimal separator and period for thousands console.log(number.tolocalestring('de-de')); // → 123.456,789 // arabic in most arabic speaking countries uses eastern arabic digits console.log(number.tolocalestring('ar-eg')); // → ١٢٣٤٥٦٫٧٨٩ // india uses thousands/lakh/crore separators console.log(number.tolocalestring('en-in')); // → 1,23,456.789 // the nu extension key
requests a numbering system, e.g.
... chinese decimal console.log(number.tolocalestring('zh-hans-cn-u-nu-hanidec')); // → 一二三,四五六.七八九 // when
requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(number.tolocalestring(['ban', 'id'])); // → 123.456,789 using options the results provided by tolocalestring can be customized using the options argument: var number = 123456.789; //
request a currency format console.log(number.tolocalestring('de-de', { style: 'currency', currency: 'eur' })); // → 123.456,79 € // the japanese yen doesn't use a minor unit console.log(number.tolocalestring('ja-jp', { style: 'currency', currency: 'jpy' })) // → ¥123,457 // limit to three significant digits console.log(number.tolocalestring('en...
Codecs used by WebRTC - Web media technologies
the sender is not required to support this mechanism, however, so you have to be prepared to receive media at a different resolution than you
requested.
... beyond this simple maximum resolution
request, specific codecs may offer further ways to ask for specific media configurations.
... default codecs unless otherwise specified, the default—or, more accurately, preferred—codecs
requested by each browser's implementation of webrtc are shown in the table below.
Web Performance
this article explains what latency is, how it impacts performance, how to measure latency, and how to reduce it.using dns-prefetchdns-prefetch is an attempt to resolve domain names before resources get
requested.
... beacon api the beacon interface schedules an asynchronous and non-blocking
request to a web server.
... reading performance charts developer tools provide information on performance, memory, and network
requests.
Same-origin policy - Web security
cross-origin network access the same-origin policy controls interactions between two different origins, such as when you use xmlhttp
request or an <img> element.
...some http
requests require preflight.
... how to block cross-origin access to prevent cross-origin writes, check an unguessable token in the
request — known as a cross-site
request forgery (csrf) token.
Features restricted to secure contexts - Web security
not supported 63 background sync (see syncmanager, for example) 49 not supported not supported not supported cache-control: immutable not supported 15 11 49 credential management api 51 not supported not supported not supported generic sensor api 67 not supported not supported not supported payment
request api (and basic card payment).
... 61 15 11.1 in development (behind the dom.payments.
request.enabled pref).
... getusermedia() restricted to secure contexts in chrome 47 temporary access available only (users cannot choose "remember this decision" in the permission
request dialog).
Introduction to using XPath in JavaScript - XPath
ments in an html document: var paragraphcount = document.evaluate( 'count(//p)', document, null, xpathresult.any_type, null ); alert( 'this document contains ' + paragraphcount.numbervalue + ' paragraph elements' ); although javascript allows us to convert the number to a string for display, the xpath interface will not automatically convert the numerical result if the stringvalue property is
requested, so the following code will not work: var paragraphcount = document.evaluate('count(//p)', document, null, xpathresult.any_type, null ); alert( 'this document contains ' + paragraphcount.stringvalue + ' paragraph elements' ); instead, it will return an exception with the code ns_dom_type_error.
...ddress street="1600 pennsylvania avenue" city="washington" country="usa"/> <phonenumber>202-456-1111</phonenumber> </person> <person> <name first="tony" last="blair" /> <address street="10 downing street" city="london" country="uk"/> <phonenumber>020 7925 0918</phonenumber> </person> </people> to make the contents of the xml document available within the extension, we create an xmlhttp
request object to load the document synchronously, the variable xmldoc will contain the document as an xmldocument object against which we can use the evaluate method javascript used in the extensions xul/js documents.
... var req = new xmlhttp
request(); req.open("get", "chrome://yourextension/content/peopledb.xml", false); req.send(null); var xmldoc = req.responsexml; var nsresolver = xmldoc.creatensresolver( xmldoc.ownerdocument == null ?
Caching compiled WebAssembly modules - WebAssembly
function opendatabase() { return new promise((resolve, reject) => { var
request = indexeddb.open(dbname, dbversion);
request.onerror = reject.bind(null, 'error opening wasm cache database');
request.onsuccess = () => { resolve(
request.result) };
request.onupgradeneeded = event => { var db =
request.result; if (db.objectstorenames.contains(storename)) { console.log(`clearing out version ${event.oldversion} wasm cache`); ...
... function lookupindatabase(db) { return new promise((resolve, reject) => { var store = db.transaction([storename]).objectstore(storename); var
request = store.get(url);
request.onerror = reject.bind(null, `error getting wasm module ${url}`);
request.onsuccess = event => { if (
request.result) resolve(
request.result); else reject(`module ${url} was not found in wasm cache`); } }); } storing and instantiating modules next, we define a function storeindatabase() that fires off an async o...
... function storeindatabase(db, module) { var store = db.transaction([storename], 'readwrite').objectstore(storename); var
request = store.put(module, url);
request.onerror = err => { console.log(`failed to store in wasm cache: ${err}`) };
request.onsuccess = err => { console.log(`successfully stored ${url} in wasm cache`) }; } using our helper functions with all the promise-based helper functions defined, we can now express the core logic of an indexeddb cache lookup.
Low-Level APIs - Archive of obsolete content
in many cases these modules have simpler, more restricted analogs among the "high-level apis" (for example, windows or
request).
... net/xhr provides access to xmlhttp
request functionality.
Chrome Authority - Archive of obsolete content
manifest generation the manifest is a list, included in the generated xpi, which specifies which modules have
requested require() access to which other modules.
... it also records which modules have
requested chrome access.
Downloading Files - Archive of obsolete content
var privacy = privatebrowsingutils.privacycontextfromwindow(aurlsourcewindow); var progresselement = document.getelementbyid("progress_element"); persist.progresslistener = { onprogresschange: function(awebprogress, a
request, acurselfprogress, amaxselfprogress, acurtotalprogress, amaxtotalprogress) { var percentcomplete = math.round((acurtotalprogress / amaxtotalprogress) * 100); progresselement.textcontent = percentcomplete +"%"; }, onstatechange: function(awebprogress, a
request, astateflags, astatus) { // do something } } persist.saveuri(obj_uri, null, null, null, "", targetfile, privacy); downl...
... instead of using qi like above, you can also implement nsiinterface
requestor and return nsiauthprompt from there, like nsiwebbrowserpersist.progresslistener documentation suggests.
Post data to window - Archive of obsolete content
need more elaborate examples, examples of displaying the response in a new tab, in background tabs, and a link to using xmlhttp
request for post
requests.
...here is an example: var datastring = "name1=data1&name2=data2"; // post method
requests must wrap the encoded text in a mime // stream const cc = components.classes; const ci = components.interfaces; var stringstream = cc["@mozilla.org/io/string-input-stream;1"].
Windows - Archive of obsolete content
this can be used in cases in which you need to uniquely identify a dom window during the duration of the application's lifespan: var util = win.queryinterface(components.interfaces.nsiinterface
requestor).getinterface(components.interfaces.nsidomwindowutils); var windowid = util.outerwindowid; after running that code, windowid contains the outer window's unique id.
... similarly, you can get the current inner window id using the nsidomwindowutils attribute currentinnerwindowid: var util = win.queryinterface(components.interfaces.nsiinterface
requestor).getinterface(components.interfaces.nsidomwindowutils); var windowid = util.currentinnerwindowid; programatically modifying html when attempting to modify html elements, it is important to specify the namespace.
User Notifications and Alerts - Archive of obsolete content
this section lists a few alternatives that give you the possibility of notifying the user and
requesting action without being too annoying.
...on = new object(); let declinebutton = new object(); let message = this._bundle.getstring("xulschoolhello.friendmessage.label"); let that = this; acceptbutton.label = this._bundle.getstring("xulschoolhello.acceptbutton.label"); acceptbutton.accesskey = this._bundle.getstring("xulschoolhello.acceptbutton.accesskey"); acceptbutton.popup = null; acceptbutton.callback = function() { that.accept
request(); }; // similarly for decline button.
Notes on HTML Reflow - Archive of obsolete content
a frame
requests a incremental reflow (or one is
requested on a frame's behalf) when something about the frame itself has changed.
...to
request (or schedule ) an incremental reflow (e.g., in response to a change in the content model), a reflow command object is created and passed to the presentation shell via the nsipresshell::appendreflowcommand method.
Enabling the behavior - updating the status periodically - Archive of obsolete content
function loadtinderboxstatus() { gxmlhttp
request = new xmlhttp
request(); gxmlhttp
request.onload = updatetinderboxstatus; gxmlhttp
request.open("get", "http://tinderbox.mozilla.org/seamonkey/panel.html"); gxmlhttp
request.send(null); window.settimeout(loadtinderboxstatus, 60000); } window.settimeout(loadtinderboxstatus, 1000); window.settimeout schedules functions to run at some future time.
...this allows users to get relatively frequent updates about tinderbox without overloading the tinderbox server or slowing down mozilla with
requests.
JavaScript Client API - Archive of obsolete content
createrecord the createrecord( id, collection ) method gets called by the engine to
request a new record for an item with a given guid.
...the higher you set this number, the more urgently the scheduler treats your
request.
importUserCertificates - Archive of obsolete content
the
request id in the response being imported must match the
request id in the associated certification
request or recovery
request.
...if it fails, one of the following error strings will be returned: error string description "error:usercancel" the user canceled the import operation "error:invalidcertificate" one of the certificate packages was incorrectly formatted "error:internalerror" the software encountered some internal error, such as out of memory "error:invalid
requestid" the
request id in the response message does not match any outstanding
request ...
popChallengeResponse - Archive of obsolete content
"error:internalerror" the software encountered some internal error, such as out of memory challenge-response proof of possession expected input: popodeckeychallcontent ::= sequence of challenge -- one challenge per encryption key certification
request (in the -- same order as these
requests appear in fullcerttemplates).
... --
request is being made) of rand, where rand is specified as -- rand ::= sequence { -- int integer, -- - the randomly-generated integer a (above) -- senderhash octet string -- - the result of applying the one-way function (owf) to -- - the sender's general name -- } -- the size of "int" must be small enough such that "rand" can b...
Mozilla Application Framework in Detail - Archive of obsolete content
web services mozilla includes built-in support for popular web services standards xml-rpc, soap, and wsdl as well as a simple xmlhttp
request object similar to the one in ie.
...mozilla's xml-rpc support includes synchronous and asynchronous
requesting and downloading of data from a server.
Mozilla Crypto FAQ - Archive of obsolete content
in light of the new encryption export regulations it is also possible that the bernstein case may be declared moot on the basis that professor bernstein is now free to do what he originally
requested to do, i.e., publish his encryption source code online.
...see also the
request for an advisory opinion made to the bureau of export administration by bernstein's lawyers and the resulting advisory opinion issued by bxa in response to that
request.
Space Manager Detailed Design - Archive of obsolete content
if the (adjusted) y offset intersects a band, then gather the banddata: walk the internal banddata list from head to tail for each band data entry, see if the top of the band is greater than the (adjusted) y offset
requested if it is, then band is below the offset
requested, so the area between the band and the y offset is available - create a trapezoid with that region and return it.
... first, walk all of the bands until a band that is to the right of the desired offset is located starting at that band, walk the remaining bands: if the current band is to the right of the
requested band, then there is available space.
Supporting per-window private browsing - Archive of obsolete content
var channel = services.io.newchannel("http://example.org", null, null); channel.queryinterface(components.interfaces.nsiprivatebrowsingchannel); channel.setprivate(true); // force the channel to be loaded in private mode similarly, xmlhttp
request objects created via createinstance(ci.nsixmlhttp
request) will often require explicit adjustment, since they have no context from which to derive a privacy status.
... var xhr = components.classes["@mozilla.org/xmlextras/xmlhttp
request;1"].createinstance(components.interfaces.nsixmlhttpreqeust); var channel = xhr.channel.queryinterface(components.interfaces.nsiprivatebrowsingchannel); channel.setprivate(true); ...
Venkman Introduction - Archive of obsolete content
any loaded file which matches the file pattern, and contains an executable line at the
requested line number will have a breakpoint set.
... using file->open from venkman will open a local file in the debugger, and using file->open web location will open and display the entire html contents of the
requested page.
Binding Implementations - Archive of obsolete content
a getter contains script whose return value is handed back when the property is
requested.
... properties also support a shorthand syntax for defining getters and setters that forward
requests or assignments to an anonymous content element.
Elements - Archive of obsolete content
onget - the onget attribute's value is a script that executes when the value of the property is
requested.
...the return value of the script represents the value of the property that will be returned to the
requestor.
The Implementation of the Application Object Model - Archive of obsolete content
this code is responsible for lazily presenting content nodes based on the rdf graph structure to the application that
requests those nodes.
... since this presentation happens "on demand", no content node is instantiated until the application specifically
requests it, or demands an operation that requires the instantiation of the node to successfully complete, e.g., asking for the number of children of a content node.
menupopup - Archive of obsolete content
this handler is usually used to dynamically set the contents when the user
requests to display it.
... showing: a
request has been made to open the popup, but it has not yet been shown.
tooltip - Archive of obsolete content
this handler is usually used to dynamically set the contents when the user
requests to display it.
... showing: a
request has been made to open the popup, but it has not yet been shown.
2006-10-06 - Archive of obsolete content
peter lairo
requested someone who are knowledgeable in w3c standards to confirm if the use of <blockquote type="cite"> is valid w3c code.
... a: robert helmer pointed out the mozilla.org's config file could be found here and to look for -->mozconfig<---------------------------------------- -->end mozconfig<---------------------------------------- updated: developer documentation issues for thunderbird 2 eric shepherd has
requested feedback for any developer documentation issues that might need dealing with for thunderbird 2.
Browser-side plug-in API - Archive of obsolete content
this chapter describes methods in the plug-in api that are provided by the browser; these allow call back to the browser to
request information, tell the browser to repaint part of the window, and so forth.
... npn_destroystream npn_forceredraw npn_getauthenticationinfo npn_geturl npn_geturlnotify npn_getvalue npn_getvalueforurl npn_invalidaterect npn_invalidateregion npn_memalloc npn_memflush npn_memfree npn_newstream npn_pluginthreadasynccall npn_poppopupsenabledstate npn_posturl npn_posturlnotify npn_pushpopupsenabledstate npn_reloadplugins npn_
requestread npn_setvalue npn_setvalueforurl npn_status npn_useragent npn_version npn_write ...
NPN_GetValueForURL - Archive of obsolete content
the browser passes back the
requested information.
... description this entry point is designed to allow plugins which implement their own http stacks to form
requests to the web server in the same way the browser does.
NPP_Print - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary
requests a platform-specific print operation for an embedded or full-screen plug-in.
... description npp_print is called when the user
requests printing for a web page that contains a visible plug-in (either embedded or full-page).
.htaccess ( hypertext access ) - Archive of obsolete content
deny from 146.0.74.205 # blocks all access from 146.0.74.205 to the directory ssi or server side include : include external files to each file
requested by the user without the need to write include statements in the file; you can have them automatically attached to all the files, whether at top or bottom, automatically through your .htaccess file.
... php_value auto_prepend_file "/real/path/to/file/functions.php" # adds function.php at the top of
requested document php_value auto_append_file "/real/path/to/file/footer.php" # adds footer.html at bottom of
requested document customized error responses : user can be directed to different pages depending on the error they caused or by the webserver.
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
armed with some basic java knowledge, you can extend javascript to include some of the most desired capability such as database access, remote web
requests, and xml processing.
...first a call to get the xml feed is made using the get method from the jaxer.web namespace, using the option that
requests the response as a new e4x object.
Troubleshooting XForms Forms - Archive of obsolete content
conflicts with other plug-ins if you are using the noscript plugin you may notice that your put and/or post
requests are being converted to get
requests.
...the xss sub-tab has the following options: turn cross-site post
requests into data-less get
requests anti-xss protection exceptions you can temporarily fix the problem by unchecking the turn cross-site post
requests into data-less get
requests check box.
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
this class should also inherit from nsiclassinfo and implement its methods to be able to
request all necessary privileges from the mozilla security manager (see example 2).
... if (!scriptablepeer) { nsitestplugin *scriptablepeer = new nsscriptablepeer(); if (scriptablepeer) ns_addref(scriptablepeer); // addref for ourself, // don't forget to release on // shutdown to trigger its destruction } // add reference for the caller
requesting the object ns_addref(scriptablepeer); *(nsisupports **)value = scriptablepeer; } else if (variable == nppvpluginscriptableiid) { nsiid* ptr = (nsiid *)npn_memalloc(sizeof(nsiid)); *ptr = scriptableiid; *(nsiid **)value = ptr; } return rv; } nperror npp_destroy (npp instance, npsaveddata** save) { if(instance == null) return npe...
Desktop mouse and keyboard controls - Game development
draw function perform the action assigned to it — move the ship left: function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); if(rightpressed) { playerx += 5; } else if(leftpressed) { playerx -= 5; } if(downpressed) { playery += 5; } else if(uppressed) { playery -= 5; } ctx.drawimage(img, playerx, playery);
requestanimationframe(draw); } the draw function first clears the whole canvas — we draw everything from scratch on every single frame.
...then the player's ship is drawn on the screen and the next draw is called from within the
requestanimationframe.
CDN - MDN Web Docs Glossary: Definitions of Web-related terms
these servers store duplicate copies of data so that servers can fulfill data
requests based on which servers are closest to the respective end-users.
...using cdn for those library files is preferable for a number of reasons: serving libraries' static assets over cdn lowers the
request burden on an organization's own servers.
Client hints - MDN Web Docs Glossary: Definitions of Web-related terms
client hints are a set of http
request header fields for proactive content negotiation allowing clients to indicate a list of device and agent specific preferences.
...for example, based on accept-ch example above, the client could append dpr, width, viewport-width, and downlink headers to all subsequent
requests.
DoS attack - MDN Web Docs Glossary: Definitions of Web-related terms
dos (denial of service) is a network attack that prevents legitimate use of server resources by flooding the server with
requests.
...here is a non-exhaustive list of dos attack types: bandwidth attack service
request flood syn flooding attack icmp flood attack peer-to-peer attack permanent dos attack application level flood attack learn more denial-of-service attack on wikipedia denial-of-service on owasp ddos ...
Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
dos (denial of service) is a network attack that prevents legitimate use of server resources by flooding the server with
requests.
...here is a non-exhaustive list of dos attack types: bandwidth attack service
request flood syn flooding attack icmp flood attack peer-to-peer attack permanent dos attack application level flood attack learn more denial-of-service attack on wikipedia denial-of-service on owasp ddos ...
Domain sharding - MDN Web Docs Glossary: Definitions of Web-related terms
the initial response from an http
request is generally an html file listing other resources such as javascript, css, images and other media files that need to be downloaded.
... http2 supports unlimited concurrent
requests making domain sharding an obsolete requirement when http/2 is enabled.
HSTS - MDN Web Docs Glossary: Definitions of Web-related terms
http strict transport security lets a web site inform the browser that it should never load the site using http and should automatically convert all attempts to access the site using http to https
requests instead.
... in other words, it tells the browser that changing the protocol from http to https in a url works (and is more secure) and asks the browser to do it for every
request.
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
in the early days of the web, mvc architecture was mostly implemented on the server-side, with the client
requesting updates via forms or links, and receiving updated views back to display in the browser.
... however, these days, more of the logic is pushed to the client with the advent of client-side data stores, and xmlhttp
request allowing partial page updates as required.
Page prediction - MDN Web Docs Glossary: Definitions of Web-related terms
page prediction is a browser feature or script which, when enabled, tells the browser to download resources the user is likely to visit before the user
requests the content.
...for example, as the user types in the address bar, the browser might send the current text in the address bar to the search engine before the user submits the
request.
Web performance - MDN Web Docs Glossary: Definitions of Web-related terms
web performance is the objective time from when a
request for content is made until the
requested content is displayed in the user's browser, objective render times, and the subjective user experience of load time and runtime.
...subjectively, it is the user's perception of whether the time it takes between the time the user
requests the content and the time until the user feels the content
requested is available and usable feels slow or fast.
Safe - MDN Web Docs Glossary: Definitions of Web-related terms
what is important here is that by calling a safe method, the client doesn't
request any server change itself, and therefore won't create an unnecessary load or burden for the server.
...in particular, an application should not allow get
requests to alter its state.
Practical positioning examples - Learn web development
in addition, so-called "single page apps" are becoming very popular — especially for mobile web uis — because having everything served as a single file cuts down on the number of http
requests required to view all the content, thereby improving performance.
... note: some web developers take things even further, only having one page of information loaded at once, and dynamically changing the information shown using a javascript feature such as xmlhttp
request.
What is a URL? - Learn web development
it indicates which web server is being
requested.
...it is worth noting that the part after the #, also known as the fragment identifier, is never sent to the server with the
request.
How the Web works - Learn web development
the browser sends an http
request message to the server, asking it to send a copy of the website to the client (you go to the shop and order your goods).
... if the server approves the client's
request, the server sends the client a "200 ok" message, which means "of course you can look at that website!
Creating hyperlinks - Learn web development
then it goes to that server and finds the file that's being
requested.
... with a relative url, the browser just looks up the file that's being
requested on the same server.
Perceived performance - Learn web development
loading essential data in initial
requests and progressively loading features and data only as needed helps mitigate low bandwidth and lower spec hardware.
... make things like type-ahead a progressive enhancement: use css to display input modal, js to add typeahead/autocomplete as it is available make task initiators appear more interactive making a content
request on keydown rather than waiting for keyup can shave 200ms off the perceived load of the content.
Properly configuring server MIME types - Learn web development
note: historically, firefox has loaded css files even if they had the wrong mime type, as long as the html document that
requested them was being processed in quirks mode.
... for security reasons, gecko 2.0 will no longer do this for stylesheets loaded from a different origin than the
requesting document.
Browser chrome tests
function test() { //
requestlongertimeout accepts an integer factor, that is a multiplier for the the default 30 seconds timeout.
...
requestlongertimeout(2); waitforexplicitfinish(); settimeout(completetest, 40000); } function completetest() { ok(true, "timeout did not run"); finish(); } exceptions in tests any exceptions thrown under test() will be caught and reported in the test output as a failure.
Bugzilla
bugzilla.mozilla.org (often abbreviated b.m.o) is mozilla.org's bug-tracking system, a database for recording bugs and enhancement
requests for firefox, thunderbird, seamonkey, camino, and other mozilla.org projects.
... testopia - test case management extension bugzilla.org - the project site wikipedia:bugzilla - general description of bugzilla (not specific to mozilla projects) bmo on wiki.mozilla.org - information about mozilla's customized bugzilla installation, including how to contribute to it tools bugzilla todos lists review and flag
requests, patches to check in, unfulfilled
requests you made of other people, and assigned bugs.
HTTP logging
logging only http
request and response headers there are two ways to do this: replace moz_log=nshttp:5 with moz_log=nshttp:3 in the commands above.
... there's a handy extension for firefox called http header live that you can use to capture just the http
request and response headers.
Contributing to the Mozilla code base
now that you've got your first bug fixed you should
request level 1 access to the repository to push to the try server and get automated feedback about your changes on multiple platforms.
... after fixing a nontrivial number of bugs you should
request level 3 access so you can land your own code after it has been reviewed.
Process scripts
this can be achieved by traversing the docshell tree up to the top window and then retrieving its content message manager, as follows: function contentmmfromcontentwindow(window) { let tree = window.queryinterface(ci.nsiinterface
requestor).getinterface(ci.nsidocshelltreeitem); let top = tree.sametyperoottreeitem; let iface = queryinterface(ci.nsidocshell).queryinterface(ci.nsiinterface
requestor); return iface.getinterface(ci.nsicontentframemessagemanager); } this is intended for unprivileged pages running in a content process.
... if the above doesn't work try this: function contentmmfromcontentwindow_method2(acontentwindow) { return acontentwindow.queryinterface(ci.nsiinterface
requestor) .getinterface(ci.nsidocshell) .queryinterface(ci.nsiinterface
requestor) .getinterface(ci.nsicontentframemessagemanager); } ...
Blocked: Custom cookie permission
message firefox: cookieblockedbypermission=
request to access cookies or storage on “x” was blocked because of custom cookie permission.
... a
request to access cookies or storage was blocked because there's a custom user-defined permission set.
HTMLIFrameElement.setVisible()
as an example, if the content of a browser <iframe> uses the window.
requestanimationframe method and if the visible state is set to true, window.
requestanimationframe will be called as often as necessary.
... however, if the visible state is set to false, window.
requestanimationframe will be called only when there are free resources to do it.
Embedding Tips
you may also use the progress listener to query the
request supplied in onstatechange for more information.
... for example, if you wanted to check the server response headers, you might check onstatechange for state_start | state_is_
request flags, and from the nsi
request argument qi fornsihttpchanne and call methods on that to determine response codes and other information from the server.
How to get a stacktrace with WinDbg
after the crash or hang you need to capture the debug information to include in a bug comment or support
request.
...to provide the information to the development community, submit this file with a support
request or attach it to a related bug on bugzilla.
Implementing Download Resuming
if the download gets interrupted, necko will call the stream listener's onstop
request method with a failure status.
...you may want to use nsisimplestreamlistener to simplify this task; to get progress notifications, you can implement nsiprogresseventsink and set an interface
requester as the notificationcallbacks of the channel that gives out such an event sink (this needs to be done before calling asyncopen).
Internationalized Domain Names (IDN) Support in Mozilla Browsers
how idn works when a browser sees a host name such as http://developer.mozilla.org, it passes a
request to the dns resolver service (usually built into an os), which in turn sends a
request to a nearest domain name server to return an ip address that corresponds to the host name.
... how mozilla browsers handle non-ascii domain names unicode and nameprep when mozilla receives idn input from the user via the location bar or a
request to process non-ascii host name links, it first turns them into unicode, then normalizes the input string to make it conform to general uri requirement.
Downloads.jsm
promise resolves to the
requested downloadlist object.
... promise resolves to the
requested downloadsummary object.
FxAccountsProfileClient.jsm
examples using the fxaccountsprofileclient chrome code let client = new fxaccountsprofileclient({ serverurl: "https://profile.accounts.firefox.com/v1", token: "fxa_oauth_bearer_token", }); client.fetchprofile().then(profile => console.log(profile)); error handling the fxaccountsprofileclient.jsm normalizes
request and client errors into fxaccountsprofileclienterror object.
... fxaccountsprofileclienterror attributes name string name of the error fxaccountsprofileclienterror code number status code of the
request errno number error number error string error description message string error message ...
Webapps.jsm
n(adata, aid) _cloneapp: function(adata, anewapp, alocalemanifest, amanifest, aid, alocalid) _writemanifestfile: function(aid, aispackage, ajsonmanifest) _nextlocalid: function() _appidformanifesturl: function(auri) makeappid: function() _saveapps: function() _readmanifests: function(adata) _ensuresufficientstorage: function(anewapp) _checkdownloadsize: function(afreebytes, anewapp) _get
requestchannel: function(afullpackagepath, aislocalfileinstall, aoldapp,) _senddownloadprogressevent: function(anewapp, aprogress) _getpackage: function(a
requestchannel, aid, aoldapp, anewapp) _computefilehash: function(afilepath) _sendappliedevent: function(aapp) _openandreadpackage: function(azipfile, aoldapp, anewapp, aislocalfileinstall,) _openpackage: function(azipfile, aapp, aislocalfileinsta...
...ll) _opensignedpackage: function(ainstallorigin, amanifesturl, azipfile, acertdb) _readpackage: function(aoldapp, anewapp, aislocalfileinstall, aisupdate,) _checksignature: function(aapp, aissigned, aislocalfileinstall) _saveetag: function(aisupdate, aoldapp, a
requestchannel, ahash, amanifest) _checkorigin: function(aissigned, aoldapp, amanifest, aisupdate) _getids: function(aissigned, azipreader, aconverter, anewapp, aoldapp,) _checkforstoreidmatch: function(aisupdate, anewapp, astoreid, astoreversion) revertdownloadpackage: function(aid, aoldapp, anewapp, aisupdate, aerror) uninstall: function(amanifesturl) _promptforuninstall: function(adata) confirmuninstall: function(adata) denyuninstall: function(adata, areason = "error_unknown_failure") getself: function(adata, amm) checkinst...
Application Translation with Mercurial
aboutprivatebrowsing.dtd, patch, v1 go to the review 'flags' category and set the one for review to ?, meaning that you
request review for the patch.
...if the person
requests changes, follow the instructions under proof-reading and altering the patch.
Index
17 localization sign-off reviews guide, localization, mozilla this article presents an overview of why we do sign-off reviews of localizations, the details on the criteria used for the sign-off reviews, and the process for
requesting a review and for following its progress.
... 18 localization technical reviews guide, localization, mozilla this guide provides details on what a localization technical review is, what criteria are used for the technical reviews, and the process for
requesting one and following its progress.
Localizing extension metadata on addons.mozilla.org
the values you provide here are used as fallback values if someone
requests a language that doesn't exist.
...you can already
request for amo fields localization on the forums, and these fields will be added soon to the web translation system.
Localizing with Mercurial
the localization team owner needs to file a bug
requesting an hg account.
... this bug will
request level 1 l10n priviledges.
Mozilla DOM Hacking Guide
there are two other similar macros: #define dom_classinfo_map_begin_no_primary_interface(_class) _dom_classinfo_map_begin(_class, nsnull, pr_true) this macro is used if the dom class (for example xmlhttp
request) does not have any interface, yet you want the xmlhttp
request object to be available from javascript.
...it's the queryinterface implementation for the nsiclassinfo interface, which is
requested internally by xpconnect.
Mozilla Web Services Security Model
load [not implemented!] ability to load documents via xmlhttp
request or similar mechanisms.
... soap soap
requests without verification headers soapv soap
requests with verification headers the from attribute the from attribute on the allow element says which calling sites the allow element applies to.
JS::PerfMeasurement
perfmeasurement::perfmeasurement(eventmask tomeasure) the constructor creates a new profiling object, which measures some subset of the
requested events.
... it will not have any more bits set than were set in the mask passed to the constructor, but if the os cannot or will not measure all of the
requested events, then only those events that will actually be measured have their bits set.
Patches and pushes
enter :flod as the
requestee.
... if the r+ is "with nits" (i.e., that's short for nit-picky
requests), fix those before committing.
PR_Access
returns one of the following values: if the
requested access is permitted, pr_success.
... if the
requested access is not permitted, pr_failure.
PR_GetRandomNoise
size the size, in bytes, of the
requested random number.
...the generated size may be less than the size
requested.
PR_Listen
returns the function returns one of the following values: upon successful completion of listen
request, pr_success.
...it creates a queue for pending connections and starts to listen for connection
requests on the socket.
PR_MALLOC
syntax #include <prmem.h> void * pr_malloc(_bytes); parameter _bytes size of the
requested memory block.
... description this macro allocates memory of the
requested size from the heap.
NSS 3.25.1 release notes
notable changes in nss 3.25.1 md5 signature algorithms sent by the server in certificate
request messages are now properly ignored.
... bugs fixed in nss 3.25.1 the following bug has been fixed in nss 3.25.1: ignore md5 signature algorithms in certificate
requests compatibility nss 3.25.1 shared libraries are backwards compatible with all older nss 3.x shared libraries.
NSS 3.26.2 release notes
notable changes in nss 3.26.2 md5 signature algorithms sent by the server in certificate
request messages are now properly ignored.
... bugs fixed in nss 3.26.2 the following bug has been fixed in nss 3.26.2: ignore md5 signature algorithms in certificate
requests compatibility nss 3.26.2 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.38 release notes
when creating a certificate
request (csr) using certutil -r, an existing orphan private key can be reused.
... new functions in secitem.h secitem_makeitem - allocate and make an item with the
requested contents new macros in ssl.h ssl_record_size_limit - used to control the tls record size limit extension notable changes in nss 3.38 fixed cve-2018-0495 in bug 1464971.
NSS 3.48 release notes
applications may set environment variable nss_min_mp_pbe_iteration_count to
request a higher iteration count than the library's default, or nss_max_mp_pbe_iteration_count to
request a lower iteration count for test environments.
... nss 3.48 bug 1600775 - require nspr 4.24 for nss 3.48 bug 1593401 - fix race condition in self-encrypt functions bug 1599545 - fix assertion and add test for early key update bug 1597799 - fix a crash in nssckfwobject_getattributesize bug 1591178 - add entrust root certification authority - g4 certificate to nss bug 1590001 - prevent negotiation of versions lower than 1.3 after helloretry
request bug 1596450 - added a simplified and unified mac implementation for hmac and cmac behind pkcs#11 bug 1522203 - remove an old pentium pro performance workaround bug 1592557 - fix prng known-answer-test scripts bug 1586176 - encryptupdate should use maxout not block size (cve-2019-11745) bug 1593141 - add `notbefore` or similar "beginning-of-validity-period" parameter to mozilla::pkix::trustdo...
NSS API Guidelines
high cert lib/certhigh ocsp.h, ocspt.h crmf provides functions, and data types, to handle certificate management message format (cmmf) and certificate
request message format (crmf, see rfc 2511) data.
... secport_verify_pointer(classname, pointer, secerror, returnvalue)- check if a given pointer really belongs to the
requested class.
PKCS11 FAQ
it's perfectly valid to reject the password change
request with a return value such as ckr_function_not_supported.
... to get a key into an initialized token, go to your local certificate authority and initiate a certificate
request.
NSS tools : pk12util
if the cryptographic module does not support the
requested algorithm, then the next best fit will be selected (usually the default).
... if no suitable replacement for the desired algorithm can be found, the tool returns the error no security module can perform the
requested operation.
NSS Tools pk12util
it may be the case that the cryptographic module does not support the
requested algorithm and a best fit will be selected, likely to be the default.
... if no suitable replacement for the desired algorithm can be found a "no security module can perform the
requested operation" will appear on the error message.
NSS tools : pk12util
if the cryptographic module does not support the
requested algorithm, then the next best fit will be selected (usually the default).
... if no suitable replacement for the desired algorithm can be found, the tool returns the error no security module can perform the
requested operation.
NSS tools : signtool
however, all of the
requested fields are optional for test certificates.
... organization unit: server products division state or province: california country (must be exactly 2 characters): us username: someuser email address: someuser@netscape.com enter password or pin for "communicator certificate db": [password will not echo] generated public/private key pair certificate
request generated certificate has been signed certificate "mytestcert" added to database exported certificate to x509.raw and x509.cacert.
Multithreading in Necko
for example, the http protocol handler has code that runs on the socket transport thread to kick off pending
requests well before the main thread would get around to doing so.
... dns thread (0-1) on most platforms dns
requests a processed on a background thread.
JS::Add*Root
requires
request.
... in a js_threadsafe build, the caller must be in a
request on this jscontext.
SpiderMonkey 1.8.5
erbyid js_getpropertybyid js_getpropertybyiddefault js_getpropertydefault js_getpropertydescriptorbyid js_getruntimesecuritycallbacks js_getsecuritycallbacks js_getstringcharsandlength js_getstringcharsz js_getstringcharszandlength js_getstringencodinglength js_haspropertybyid js_initctypesclass js_internjsstring js_isconstructing_possiblywithgiventhisobject js_isextensible js_isin
request js_leavecrosscompartmentcall js_lookuppropertybyid js_lookuppropertywithflagsbyid js_new js_newcompartmentandglobalobject js_newdateobject js_newdateobjectmsec js_newfunctionbyid body new c++ helpers while jsapi remains a c api, the engine is now implemented in c++.
... jsauto
request jsautosuspend
request jsautocheck
request jsautoentercompartment js::anchor<> js::call obsolete apis js_clearnewbornroots js_enterlocalrootscope js_leavelocalrootscope js_leavelocalrootscopewithresult js_forgetlocalroot js_newgrowablestring deleted apis js_addnamedroot – use js_add*root js_addnamedrootrt – use js_add*root js_addroot – use js_add*root js_clearnewbornroots – no longer needed js_clearoperationcallback js_clearregexproots js_decompilescript js_destroyscript js_enterlocalrootscope js_executescriptpart js_forgetlocalroot js_getfunctionname js_getoperationlimit js_getscriptob...
SpiderMonkey 1.8.7
erbyid js_getpropertybyid js_getpropertybyiddefault js_getpropertydefault js_getpropertydescriptorbyid js_getruntimesecuritycallbacks js_getsecuritycallbacks js_getstringcharsandlength js_getstringcharsz js_getstringcharszandlength js_getstringencodinglength js_haspropertybyid js_initctypesclass js_internjsstring js_isconstructing_possiblywithgiventhisobject js_isextensible js_isin
request js_leavecrosscompartmentcall js_lookuppropertybyid js_lookuppropertywithflagsbyid js_new js_newcompartmentandglobalobject js_newdateobject js_newdateobjectmsec js_newfunctionbyid body new c++ helpers while jsapi remains a c api, the engine is now implemented in c++.
... jsauto
request jsautosuspend
request jsautocheck
request jsautoentercompartment js::anchor<> js::call obsolete apis js_clearnewbornroots js_enterlocalrootscope js_leavelocalrootscope js_leavelocalrootscopewithresult js_forgetlocalroot js_newgrowablestring deleted apis js_getscopechain use js_getglobalforscopechain api changes operation callback js_setoperationcallback was introduced in js 1.8.0, replacing the branch callback, in anticipation of the addition of the tracing jit (tracemonkey).
Shell global objects
interruptif(cond)
requests interrupt callback if cond is true.
...hook gets passed the
requested code's url, and should return a string.
Embedded Dialog API
responsibilities of the embedding application basic windowing api to be able to respond to script
requests to open new windows, an embedded gecko browser must have a way of opening new windows.
...this flag
requests the presence or absence of particular features in the window surrounding the browser; features such as a toolbar or menubar.
Avoiding leaks in JavaScript XPCOM components
the most common strategies for managing heap allocation are the following: malloc and free (or new and delete) the simplest strategy for heap allocation is that the programmer makes one function call to
request memory from the heap and another one to return it.
...consider the example of bug 170022 (which also demonstrates a leak via a global variable, fixed later in bug 231266): const observer = { observe: function(subject, topic, data) { if (topic != "open-new-tab-
request" || subject != window) return; delayedopentab(data); } }; const service = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); service.addobserver(observer, "open-new-tab-
request", false); in this example, there is a similar cycle between observe and service.
HOWTO
async network
requests problem you want to make network
requests or do other asynchronous work in xpcshell.
... however, when you start your script, it exits immediately, before the network
request returns.
inIDOMUtils
if you have
requested anonymous content, then if the element has an xbl binding then this will be the binding's anonymous nodes, otherwise if the element is itself an anonymous node containing an insertion point then this will be a list combining the element's explicit children from its binding parent's anonymous nodes and any children inserted as a result of the insertion point.
...if you have
requested anonymous content and the element's parent has an xbl binding then the element containing the insertion point is returned instead.
mozIStorageConnection
an asynchronous statement can only be used to dispatch asynchronous
requests to the asynchronous execution thread and cannot be used to take any synchronous actions on the database.
... exceptions thrown ns_error_failure table already exists or the
requested table couldn't be created.
mozIStorageProgressHandler
the mozistorageprogresshandler interface lets storage consumers receive callbacks during the execution of sqlite
requests.
... return value return true to abort the
request or false to allow it to continue.
nsIArray
uuid the iid of the
requested interface.
... result the object, queryinterface'd to the
requested interface.
nsIAsyncStreamCopier
inherits from: nsi
request last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void asynccopy(in nsi
requestobserver aobserver, in nsisupports aobservercontext); void init(in nsiinputstream asource, in nsioutputstream asink, in nsieventtarget atarget, in boolean asourcebuffered, in boolean asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink); methods asynccopy() starts the copy operation.
...void asynccopy( in nsi
requestobserver aobserver, in nsisupports aobservercontext ); parameters aobserver receives notifications.
nsIBadCertListener2
method overview boolean notifycertproblem(in nsiinterface
requestor socketinfo, in nsisslstatus status, in autf8string targetsite); methods notifycertproblem() called in case of a broken ssl status.
... boolean notifycertproblem( in nsiinterface
requestor socketinfo, in nsisslstatus status, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection.
nsIContentFrameMessageManager
var acfmm = gbrowser.selectedbrowser._docshell.queryinterface(ci.nsiinterface
requestor).getinterface(ci.nsicontentframemessagemanager); get content message manager from content window window here is a html window or any window inside a tab, this code would run from a framescript.
... var acfmm = window.queryinterface(ci.nsiinterface
requestor) .getinterface(ci.nsidocshell) .queryinterface(ci.nsiinterface
requestor) .getinterface(ci.nsicontentframemessagemanager); ...
nsIContentViewer
void loadcomplete(in unsigned long astatus); void loadstart(in nsisupports adoc); void move(in long ax, in long ay); void open(in nsisupports astate, in nsishentry ashentry); void pagehide(in boolean isunload); boolean permitunload([optional] in boolean acallercloseswindow); boolean
requestwindowclose(); void resetclosewindow(); void setbounds([const] in nsintrectref abounds); native code only!
...
requestwindowclose() boolean
requestwindowclose(); parameters none.
nsIDNSListener
inherits from: nsisupports last changed in gecko 1.7 method overview void onlookupcomplete(in nsicancelable a
request, in nsidnsrecord arecord, in nsresult astatus); methods onlookupcomplete() called when an asynchronous host lookup completes.
... void onlookupcomplete( in nsicancelable a
request, in nsidnsrecord arecord, in nsresult astatus ); parameters a
request the value returned from asyncresolve.
nsIDOMProgressEvent
dom/interfaces/events/nsidomprogressevent.idlscriptable this interface represents the events sent with progress information while uploading data using the xmlhttp
request object.
... see also using xmlhttp
request xmlhttp
request nsixmlhttp
requesteventtarget nsixmlhttp
request ...
nsIDocumentLoader
g/docloaderservice;1"] .createinstance(components.interfaces.nsidocumentloader); method overview void clearparentdocloader(); obsolete since gecko 1.8 void createdocumentloader(out nsidocumentloader aninstance); obsolete since gecko 1.8 void destroy(); obsolete since gecko 1.8 void fireonlocationchange(in nsiwebprogress awebprogress, in nsi
request a
request, in nsiuri auri); obsolete since gecko 1.8 void fireonstatuschange(in nsiwebprogress awebprogress, in nsi
request a
request, in nsresult astatus, in wstring amessage); obsolete since gecko 1.8 void getcontentviewercontainer(in nsisupports adocumentid, out nsicontentviewercontainer aresult); native code only!
... fireonlocationchange() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void fireonlocationchange( in nsiwebprogress awebprogress, in nsi
request a
request, in nsiuri auri ); parameters awebprogress a
request auri fireonstatuschange() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void fireonstatuschange( in nsiwebprogress awebprogress, in nsi
request a
request, in nsresult astatus, in wstring amessage ); parameters awebprogress arequ...
nsIDownloadObserver
inherits from: nsisupports last changed in gecko 1.7 method overview void ondownloadcomplete(in nsidownloader downloader, in nsi
request request, in nsisupports ctxt, in nsresult status, in nsifile result); methods ondownloadcomplete() called to signal a download that has completed.
... void ondownloadcomplete( in nsidownloader downloader, in nsi
request request, in nsisupports ctxt, in nsresult status, in nsifile result ); parameters downloader
request ctxt status result ...
nsIExternalProtocolService
xternalprotocolhandlerexists(in string aprotocolscheme); astring getapplicationdescription(in autf8string ascheme); nsihandlerinfo getprotocolhandlerinfo(in acstring aprotocolscheme); nsihandlerinfo getprotocolhandlerinfofromos(in acstring aprotocolscheme, out boolean afound); boolean isexposedprotocol(in string aprotocolscheme); void loaduri(in nsiuri auri, [optional] in nsiinterface
requestor awindowcontext); void loadurl(in nsiuri aurl); void setprotocolhandlerdefaults(in nsihandlerinfo ahandlerinfo, in boolean aoshandlerexists); methods externalprotocolhandlerexists() check whether a handler for a specific protocol exists.
...void loaduri( in nsiuri auri, [optional] in nsiinterface
requestor awindowcontext ); parameters auri the uri to load.
nsIFeedProcessor
to create an instance, use: var feedprocessor = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); method overview void parseasync(in nsi
requestobserver
requestobserver, in nsiuri uri); void parsefromstream(in nsiinputstream stream, in nsiuri uri); void parsefromstring(in astring str, in nsiuri uri); attributes attribute type description listener nsifeedresultlistener the feed result listener that will respond to feed events.
... void parseasync( in nsi
requestobserver
requestobserver, in nsiuri uri ); parameters
requestobserver the observer to be notified when parsing starts and stops.
nsIMemoryReporterManager
registermultireporter()
requests that memory multi-reporter notifications be sent to the specified objects.
... registerreporter()
requests that memory reporter notifications be sent to the specified objects.
nsIMessageWakeupService
requesting wakeups to
request a wakeup, a wakeup condition must be registered with the category manager in the "wakeup-
request" category.
...to indicate a wakeup
request in a manifest file, add a line that looks something like this: category wakeup-
request nscomponent @mozilla.org/myservice;1,nsimyinterface,getservice,mymessage1,mymessage2[,..] the category entry value consists of a comma separate string that contains: the contract id for your component (e.g.
nsIMsgIdentity
requestreturnreceipt boolean readonly: default
request for return receipt option for this identity.
... receiptheadertype long readonly:
requestdsn boolean readonly: default
request for dsn option for this identity.
nsIProtocolHandler
boolean allowport( in long port, in string scheme ); parameters port the port for which an override is being
requested.
... scheme the scheme for which an override is being
requested.
nsIProtocolProxyService
etfailoverforproxy(in nsiproxyinfo aproxyinfo, in nsiuri auri, in nsresult areason); void registerfilter(in nsiprotocolproxyfilter afilter, in unsigned long aposition); void unregisterfilter(in nsiprotocolproxyfilter afilter); constants constant value description resolve_non_blocking 1<<0 this flag may be passed to the resolve method to
request that it fail instead of block the calling thread.
... if a nsiprotocolhandler disallows all proxying, then filters will never have a chance to intercept proxy
requests for such urls.
nsIPushSubscription
sending a post
request to this url routes the message to the instance of firefox that created the subscription.
... example const { classes: cc, interfaces: ci, utils: cu } = components; const scriptsecuritymanager = cc["@mozilla.org/scriptsecuritymanager;1"] .getservice(ci.nsiscriptsecuritymanager); const pushservice = cc["@mozilla.org/push/service;1"] .getservice(ci.nsipushservice); function sendsubscriptiontoserver(subscription) { let
request = cc["@mozilla.org/xmlextras/xmlhttp
request;1"] .createinstance(ci.nsixmlhttp
request);
request.open("post", "https://example.com/register-for-push", true);
request.addeventlistener("error", () => { cu.reporterror("error sending subscription to server"); });
request.send(json.stringify({ endpoint: subscription.endpoint, // base64-encode the key and authentica...
nsISHistory
requestedindex long the index of the last document that started to load that is not yet finished loading.
...nsishentry getentryatindex( in long index, in boolean modifyindex ); parameters index the index value whose entry is
requested.
nsISSLErrorListener
method overview boolean notifysslerror(in nsiinterface
requestor socketinfo, in print32 error, in autf8string targetsite); methods notifysslerror() called in case of an ssl error.
... boolean notifysslerror( in nsiinterface
requestor socketinfo, in print32 error, in autf8string targetsite ); parameters socketinfo a network communication context that can be used to obtain more information about the active connection.
nsIScriptableIO
if the text mode is specified, a buffer is always used, regardless of whether or not it is specifically
requested.
...if the text mode is specified, a buffer is always used, regardless of whether or not it is specifically
requested.
nsIScrollable
when passing this in to a method you are
requesting or setting data for the horizontal scrollbar.
...when passing this in to a method you are
requesting or setting data for the vertical scrollbar.
nsISearchEngine
responsetype since an engine can have several different
request urls, differentiated by response types, this parameter selects a
request to add parameters to.
... purpose [optional] a string meant to indicate the context of the search
request.
nsISelection
return value whether or not the range contains the
requested noe.
...nsidomrange getrangeat( in long index ); parameters index return value the nsidomrange
requested modify() modifies the selection.
nsISpeculativeConnect
method overview void speculativeconnect(in nsiuri auri, in nsiinterface
requestor acallbacks, in nsieventtarget atarget); methods speculativeconnect() call this method to hint to the networking layer that a new transaction for the specified uri is likely to happen soon.
...void speculativeconnect( in nsiuri auri, in nsiinterface
requestor acallbacks, in nsieventtarget atarget ); parameters auri the uri of the hinted transaction.
nsIStringBundle
return value returns the
requested string.
... return value returns the
requested string.
nsISupports
void queryinterface( in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result ); parameters uuid the uuid of the
requested interface result the resulting interface pointer.
... exceptions thrown ns_error_no_interface the
requested interface is not available.
nsITaskbarWindowPreview
note that even while the preview is hidden, its thumbnails and/or previews may still be
requested by other parts of the operating system through the nsitaskbarwindowpreview's controller.
... return value an nsitaskbarpreviewbutton describing the
requested button.
nsITransferable
requestingnode nsidomnode the source dom node this transferable was created from.
... to get the appropriate load context in javascript callers, one needs to get to the document that the transferable corresponds to, and then get the load context from the document like this: var loadcontext = doc.defaultview.queryinterface(ci.nsiinterface
requestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsiloadcontext); in c++ callers, if you have the corresponding document, you can just call nsidocument.getloadcontext() to get to the load context object.
nsIWeakReference
void queryreferent( in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result ); parameters uuid the uuid of the
requested interface.
...ns_error_no_interface the
requested interface is not available.
nsIWebProgress
the nsiwebprogress interface is used to add or remove nsiwebprogresslistener instances to observe the loading of asynchronous
requests (usually in the context of a dom window).
... constant value description notify_state_
request 0x00000001 only receive the nsiwebprogresslistener.onstatechange() event if the astateflags parameter includes nsiwebprogresslistener::state_is_
request.
nsIZipWriter
afile, in boolean aqueue); void addentrystream(in autf8string azipentry, in prtime amodtime, in print32 acompression, in nsiinputstream astream, in boolean aqueue); void close(); nsizipentry getentry(in autf8string azipentry); boolean hasentry(in autf8string azipentry); void open(in nsifile afile, in print32 aioflags); void processqueue(in nsi
requestobserver aobserver, in nsisupports acontext); void removeentry(in autf8string azipentry, in boolean aqueue); attributes attribute type description comment acstring gets or sets the comment associated with the currently open zip file.
... void processqueue( in nsi
requestobserver aobserver, in nsisupports acontext ); parameters aobserver the observer to receive notifications from the queue.
Using nsIDirectoryService
in the example below, prop is a string that references your
requested file locations.
...when the service is asked for a file location, it goes through its list of providers asking each if it knows the
requested location until it finds one that does.
XPCOM
unless otherwise noted you register for the topics using the nsiobserverservice.setting http
request headershttp is one of the core technologies behind the web.
... in addition to the actual content, some important information is passed with http headers for both http
requests and responses.storagestorage is a sqlite database api.
Address Book examples
* the onshow method should take the input fields in the document, * and render the
requested photo in the img tag with id * atargetid.
... the * onsave method is responsible for analyzing the photo of this * type
requested by the user, and storing it, as well as the * other fields required by onload/onshow to retrieve and display * the photo again.
Address book sync client design
* * atransactionid - the id for this particular
request * astatus - status code for the sync
request * amsg - a text string describing the error (if any).
... * * atransactionid - the id for this particular
request * astatus - status code for the sync
request * amsg - a text string describing the error (if any).
Plug-in Side Plug-in API - Plugins
npp_print
requests a platform-specific print operation for an embedded or full-screen plug-in.
... npp_urlnotify notifies the instance of the completion of a url
request.
Debugging service workers - Firefox Developer Tools
it is also worth knowing that if you are testing an app's offline capabilities, you'll be able to see whether
requests are being retrieved from a service worker-initiated cache rather than from the network by looking at network monitor.
... note: there is currently a bug whereby the network monitor cannot show network
requests from a service worker running in a different process to the application (bug 1432311).
Browser Console - Firefox Developer Tools
so it logs the same sorts of information as the web console - network
requests, javascript, css, and security errors and warnings, and messages explicitly logged by javascript code.
... browser console logging the browser console logs the same sorts of messages as the web console: http
requests warnings and errors (including javascript, css, security warnings and errors, and messages explicitly logged by javascript code using the console api).
Debugger.Frame - Firefox Developer Tools
(in the terms used by the ecmascript specification, the variableenvironment of the execution context for the eval code is the variableenvironment of the execution context that this frame represents.) if implementation restrictions prevent spidermonkey from extending this frame’s environment as
requested, this call throws an error exception.
...in the terms used by the ecmascript specification, the variableenvironment of the execution context for the eval code is the variableenvironment of the execution context that this frame represents, and thebindings appear in a new declarative environment, which is the eval code’s lexicalenvironment.) if implementation restrictions prevent spidermonkey from extending this frame’s environment as
requested, this call throws an error exception.
Network monitor recording - Firefox Developer Tools
this is useful in situations where, for example, you are trying to get a stable view of a page for debugging purposes, but under normal circumstances the view keeps evolving due to persistent network
requests.
... network monitor features the following articles cover different aspects of using the network monitor: toolbar network
request list network
request details performance analysis throttling ...
Rich output - Firefox Developer Tools
examining
request details similar to examining object details, you can see the details about a network
request directly in the console.
... click on the arrow next to the
request and a details panel will open that is equivalent to the headers panel in the network monitor tool.
AbortController.AbortController() - Web APIs
when the fetch
request is initiated, we pass in the abortsignal as an option inside the
request's options object (see {signal}, below).
... this associates the signal and controller with the fetch
request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener.
AbortSignal: abort event - Web APIs
the abort event of the fetch api is fired when a fetch
request is aborted, i.e.
... you can use the abort event in an addeventlistener method: var controller = new abortcontroller(); var signal = controller.signal; signal.addeventlistener('abort', function() { console.log('
request aborted'); }; or use the onabort event handler property: var controller = new abortcontroller(); var signal = controller.signal; signal.onabort = function() { console.log('
request aborted'); }; specifications specification status domthe definition of 'abort' in that specification.
AbortSignal.aborted - Web APIs
the aborted read-only property returns a boolean that indicates whether the dom
request(s) the signal is communicating with is/are aborted (true) or not (false).
...console.log('
request has been aborted') : console.log('
request not aborted'); specifications specification status comment domthe definition of 'onabort' in that specification.
AbortSignal.onabort - Web APIs
when the fetch
request(s) the signal is communicating with is/are aborted.
... var controller = new abortcontroller(); var signal = controller.signal; signal.onabort = function() { console.log('
request aborted'); }; specifications specification status comment domthe definition of 'onabort' in that specification.
AbsoluteOrientationSensor - Web APIs
model.quaternion.fromarray(sensor.quaternion).inverse(); }); sensor.addeventlistener('error', error => { if (event.error.name == 'notreadableerror') { console.log("sensor is not available."); } }); sensor.start(); permissions example using orientation sensors requires
requesting permissions for multiple device sensors.
... because the permissions uses promises, a good way to
request permissions is to use promise.all.
AnalyserNode.fftSize - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then
requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input.
... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount ; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { drawvisual =
requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.beginpath(); var slicewidth = width * 1.0 / bufferlength; var x = 0; for(var i = 0; i < bufferlength; i++) { ...
AnalyserNode.frequencyBinCount - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then
requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input.
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual =
requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5 - 1; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,heig...
AnalyserNode.getByteFrequencyData() - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then
requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input.
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual =
requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-b...
AnalyserNode.getByteTimeDomainData() - Web APIs
return value void | none example the following example shows basic usage of an audiocontext to create an analysernode, then
requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input.
... analyser.fftsize = 2048; const bufferlength = analyser.fftsize; const dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { drawvisual =
requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; const slicewidth = width * 1.0 / bufferlength; let x = 0; canvasctx.beginpath(); for(var i = 0; i < bufferlength; i++) { const v = dataarray[i]/128.0; cons...
AnalyserNode.getFloatFrequencyData() - Web APIs
while the audio is playing, we collect the frequency data repeatedly with
requestanimationframe() and draw a "winamp bargraph style" to a <canvas> element.
...//create 2d canvas const canvas = document.createelement('canvas'); canvas.style.position = 'absolute'; canvas.style.top = 0; canvas.style.left = 0; canvas.width = window.innerwidth; canvas.height = window.innerheight; document.body.appendchild(canvas); const canvasctx = canvas.getcontext('2d'); canvasctx.clearrect(0, 0, canvas.width, canvas.height); function draw() { //schedule next redraw
requestanimationframe(draw); //get spectrum data analysernode.getfloatfrequencydata(dataarray); //draw black background canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, canvas.width, canvas.height); //draw spectrum const barwidth = (canvas.width / bufferlength) * 2.5; let posx = 0; for (let i = 0; i < bufferlength; i++) { const barheight = (dataarray[i] + 140) * 2; ...
AnalyserNode.getFloatTimeDomainData() - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then
requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input.
... analyser.fftsize = 1024; var bufferlength = analyser.fftsize; console.log(bufferlength); var dataarray = new float32array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual =
requestanimationframe(draw); analyser.getfloattimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.beginpath(); var slicewidth = width * 1.0 / bufferlength; var x = 0; for(var i = 0; i < bufferlength; i++) { var v = dataarray[i] * 200.0; var y ...
AnalyserNode.maxDecibels - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then
requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input.
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual =
requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-b...
AnalyserNode.minDecibels - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then
requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input.
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual =
requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-b...
AnalyserNode.smoothingTimeConstant - Web APIs
example the following example shows basic usage of an audiocontext to create an analysernode, then
requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph style" output of the current audio input.
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { drawvisual =
requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-b...
AnalyserNode - Web APIs
basic usage the following example shows basic usage of an audiocontext to create an analysernode, then
requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input.
... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // get a canvas defined with id "oscilloscope" var canvas = document.getelementbyid("oscilloscope"); var canvasctx = canvas.getcontext("2d"); // draw an oscilloscope of the current audio source function draw() {
requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = "rgb(200, 200, 200)"; canvasctx.fillrect(0, 0, canvas.width, canvas.height); canvasctx.linewidth = 2; canvasctx.strokestyle = "rgb(0, 0, 0)"; canvasctx.beginpath(); var slicewidth = canvas.width * 1.0 / bufferlength; var x = 0; for (var i = 0; i < bufferlength; i++) { var v = dataarr...
AudioBufferSourceNode.loop - Web APIs
you can run the full example live (or view the source.) function getdata() { source = audioctx.createbuffersource();
request = new xmlhttp
request();
request.open('get', 'viper.ogg', true);
request.responsetype = 'arraybuffer';
request.onload = function() { var audiodata =
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destinat...
...ion); source.loop = true; }, function(e){"error with decoding audio data" + e.err}); }
request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } specification specification status comment web audio apithe definition of 'loop' in that specification.
AudioBufferSourceNode.loopEnd - Web APIs
function getdata() { source = audioctx.createbuffersource();
request = new xmlhttp
request();
request.open('get', 'viper.ogg', true);
request.responsetype = 'arraybuffer';
request.onload = function() { var audiodata =
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; songlength = buffer.duration; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; ...
... source.connect(audioctx.destination); source.loop = true; loopstartcontrol.setattribute('max', math.floor(songlength)); loopendcontrol.setattribute('max', math.floor(songlength)); }, function(e){"error with decoding audio data" + e.err}); }
request.send(); } ...
AudioBufferSourceNode.loopStart - Web APIs
function getdata() { source = audioctx.createbuffersource();
request = new xmlhttp
request();
request.open('get', 'viper.ogg', true);
request.responsetype = 'arraybuffer';
request.onload = function() { var audiodata =
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; songlength = buffer.duration; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; ...
... source.connect(audioctx.destination); source.loop = true; loopstartcontrol.setattribute('max', math.floor(songlength)); loopendcontrol.setattribute('max', math.floor(songlength)); }, function(e){"error with decoding audio data" + e.err}); }
request.send(); } ...
AudioBufferSourceNode.playbackRate - Web APIs
<input class="playback-rate-control" type="range" min="0.25" max="3" step="0.05" value="1"> <span class="playback-rate-value">1.0</span> function getdata() { source = audioctx.createbuffersource();
request = new xmlhttp
request();
request.open('get', 'viper.ogg', true);
request.responsetype = 'arraybuffer';
request.onload = function() { var audiodata =
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destinat...
...ion); source.loop = true; }, function(e){"error with decoding audio data" + e.err}); }
request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute('disabled'); playbackcontrol.setattribute('disabled', 'disabled'); } playbackcontrol.oninput = function() { source.playbackrate.value = playbackcontrol.value; playbackvalue.innerhtml = playbackcontrol.value; } specification specification status comment web audio apithe definition of 'playbackrate' in that specification.
AudioContext.baseLatency - Web APIs
note: you can
request a certain latency during construction time with the latencyhint option, but the browser may ignore the option.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
AuthenticatorResponse.clientDataJSON - Web APIs
the original value is passed via publickeycredential
requestoptions.challenge or publickeycredentialcreationoptions.challenge.
... origin the fully qualified origin of the
requester which has been given by the client/browser to the authenticator.
BaseAudioContext.createAnalyser() - Web APIs
example the following example shows basic usage of an audiocontext to create an analyser node, then use
requestanimationframe() to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input.
... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { drawvisual =
requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.beginpath(); var slicewidth = width * 1.0 / bufferlength; var x = 0; for(var i = 0; i < bufferlength; i++) { ...
BaseAudioContext.createConvolver() - Web APIs
// grab audio track via xhr for convolver node var soundsource, concerthallbuffer; ajax
request = new xmlhttp
request(); ajax
request.open('get', 'concert-crowd.ogg', true); ajax
request.responsetype = 'arraybuffer'; ajax
request.onload = function() { var audiodata = ajax
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuffer; }, function(e)...
...{"error with decoding audio data" + e.err}); } ajax
request.send(); ...
BluetoothCharacteristicProperties - Web APIs
let device = await navigator.bluetooth.
requestdevice({ filters: [{services: ['heart_rate']}] }); let gatt = await device.gatt.connect(); let service = await gatt.getprimaryservice('heart_rate'); let characteristic = await service.getcharacteristic('heart_rate_measurement'); if (characteristic.properties.notify) { characteristics.addeventlistener('characteristicvaluechanged', function(event) { console.log(`received heart rate mea...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
Body.arrayBuffer() - Web APIs
if you need to play ogg during downloading (stream it) - consider htmlaudioelement: new audio("music.ogg").play(); in getdata() we create a new
request using the
request() constructor, then use it to fetch an ogg music track.
... once getdata() has finished running, we start the audio source playing with start(0), then disable the play button so it can't be clicked again when it is already playing (this would cause an error.) function getdata() { source = audioctx.createbuffersource(); var my
request = new
request('viper.ogg'); fetch(my
request).then(function(response) { return response.arraybuffer(); }).then(function(buffer) { audioctx.decodeaudiodata(buffer, function(decodeddata) { source.buffer = decodeddata; source.connect(audioctx.destination); }); }); }; // wire up buttons to stop and play audio play.onclick = function() { getdata(); source.start(0); ...
Body.blob() - Web APIs
example in our fetch
request example (run fetch
request live), we create a new
request using the
request() constructor, then use it to fetch a jpg.
... var myimage = document.queryselector('img'); var my
request = new
request('flowers.jpg'); fetch(my
request) .then(response => response.blob()) .then(function(myblob) { var objecturl = url.createobjecturl(myblob); myimage.src = objecturl; }); specifications specification status comment fetchthe definition of 'blob()' in that specification.
Body.json() - Web APIs
example in our fetch json example (run fetch json live), we create a new
request using the
request() constructor, then use it to fetch a .json file.
... const mylist = document.queryselector('ul'); const my
request = new
request('products.json'); fetch(my
request) .then(response => response.json()) .then(data => { for (const product of data.products) { let listitem = document.createelement('li'); listitem.appendchild( document.createelement('strong') ).textcontent = product.name; listitem.append( ` can be found in ${ product.location }.
Body.text() - Web APIs
when getdata() is run, we create a new
request using the
request() constructor, then use it to fetch a specific .txt file.
... let myarticle = document.queryselector('article'); let mylinks = document.queryselectorall('ul a'); for(let i = 0; i <= mylinks.length-1; i++) { mylinks[i].onclick = function(e) { e.preventdefault(); let linkdata = e.target.getattribute('data-page'); getdata(linkdata); } }; function getdata(pageid) { console.log(pageid); var my
request = new
request(pageid + '.txt'); fetch(my
request).then(function(response) { return response.text().then(function(text) { myarticle.innerhtml = text; }); }); } specifications specification status comment fetchthe definition of 'text()' in that specification.
BudgetService.reserve() - Web APIs
the reserve() property of the budgetservice interface returns a promise that resolves to a boolean indicating whether the
requested budget operation can be reserved.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
BudgetService - Web APIs
budgetservice.reserve() returns a promise that resolves to a boolean, indicating whether the
requested budget operation can be reserved.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
CSSStyleSheet.insertRule() - Web APIs
if rule cannot be inserted at index 0 due to some css constraint, the method aborts with a hierarchy
requesterror.
... if trying to insert an @import at-rule after a style rule, the method aborts with a hierarchy
requesterror.
ConvolverNode.buffer - Web APIs
// grab audio track via xhr for convolver node var soundsource, concerthallbuffer; ajax
request = new xmlhttp
request(); ajax
request.open('get', 'concert-crowd.ogg', true); ajax
request.responsetype = 'arraybuffer'; ajax
request.onload = function() { var audiodata = ajax
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuffer; }, function(e)...
...{"error with decoding audio data" + e.err}); } ajax
request.send(); ...
ConvolverNode.normalize - Web APIs
// grab audio track via xhr for convolver node var soundsource, concerthallbuffer; ajax
request = new xmlhttp
request(); ajax
request.open('get', 'concert-crowd.ogg', true); ajax
request.responsetype = 'arraybuffer'; ajax
request.onload = function() { var audiodata = ajax
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuffer; }, function(e)...
...{"error with decoding audio data" + e.err}); } ajax
request.send(); ...
DataTransfer.dropEffect - Web APIs
for the dragenter and dragover events, dropeffect will be initialized based on what action the user is
requesting.
...within event handlers for dragenter and dragover events, dropeffect should be modified if a different action is desired than the action that the user is
requesting.
Document.exitPointerLock() - Web APIs
the exitpointerlock() method asynchronously releases a pointer lock previously
requested through element.
requestpointerlock.
... to track the success or failure of the
request, it is necessary to listen for the pointerlockchange and pointerlockerror events.
Element.getAttributeNS() - Web APIs
getattributens() differs from getattribute() in that it allows you to further specify the
requested attribute as being part of a particular namespace, as in the example above, where the attribute is part of the fictional "specialspace" namespace on mozilla.
...for that reason, you should use hasattributens() to check for an attribute's existence prior to calling getattributens() if it is possible that the
requested attribute does not exist on the specified element.
FileList - Web APIs
return value the file representing the
requested file.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FileSystemEntry.copyTo() - Web APIs
errors fileerror.invalid_modification_err the
requested operation involves an impossible change, such as moving a directory inside itself or one of its own child directories, or copying an item within the same directory without renaming it.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FileSystemEntry.getMetadata() - Web APIs
fileerror.security_err security restrictions prohibit obtaining the
requested metadata.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FileSystemEntry.moveTo() - Web APIs
errors fileerror.invalid_modification_err the
requested operation involves an impossible change, such as moving a directory inside itself or one of its own child directories, or copying an item within the same directory without renaming it.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FileSystemFileEntry - Web APIs
var bb = new blobbuilder(); bb.append('meow'); filewriter.write(bb.getblob('text/plain')); }, errorhandler); }, errorhandler); } window.
requestfilesystem(window.temporary, 1024*1024, oninitfs, errorhandler); specifications specification status comment file and directory entries apithe definition of 'filesystemfileentry' in that specification.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FileSystemFlags - Web APIs
properties create optional if this property is true, and the
requested file or directory doesn't exist, the user agent should create it.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
File and Directory Entries API - Web APIs
they're available on the window object and implemented in localfilesystem:
requestfilesystem() and resolvelocalfilesystemurl().
...they're available on the worker object and implemented in localfilesystemsync:
requestfilesystemsync() and resolvelocalfilesystemsyncurl().
FormData - Web APIs
the formdata interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the xmlhttp
request.send() method.
... specifications specification status comment xmlhttp
requestthe definition of 'formdata' in that specification.
FormDataEvent - Web APIs
this allows a formdata object to be quickly obtained in response to a formdata event firing, rather than needing to put it together yourself when you wish to submit form data via a method like xmlhttp
request (see using formdata objects).
...ntdefault(); // construct a formdata object, which fires the formdata event new formdata(formelem); }); // formdata handler to retrieve data formelem.addeventlistener('formdata', (e) => { console.log('formdata fired'); // get the form data from the event object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit the data via xhr var
request = new xmlhttp
request();
request.open("post", "/formhandler");
request.send(data); }); specifications specification status comment html living standardthe definition of 'formdataevent' in that specification.
GeolocationCoordinates.longitude - Web APIs
upon receiving a click event, we call getcurrentposition() to
request the device's current position.
... this is an asynchronous
request, so we provide a callback which receives as in put a geolocationposition object describing the determined position.
HTMLCanvasElement.toDataURL() - Web APIs
if the
requested type is not image/png, but the returned value starts with data:image/png, then the
requested type is not supported.
... return value a domstring containing the
requested data uri.
HTMLFormElement: formdata event - Web APIs
ntdefault(); // construct a formdata object, which fires the formdata event new formdata(formelem); }); // formdata handler to retrieve data formelem.addeventlistener('formdata', (e) => { console.log('formdata fired'); // get the form data from the event object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit the data via xhr var
request = new xmlhttp
request();
request.open("post", "/formhandler");
request.send(data); }); the onformdata version would look like this: formelem.onformdata = (e) => { console.log('formdata fired'); // get the form data from the event object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit the data via xhr var
request = new xmlhttpreque...
...st();
request.open("post", "/formhandler");
request.send(data); }; specifications specification status comment html living standardthe definition of 'formdata' in that specification.
HTMLImageElement.useMap - Web APIs
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
HTMLMediaElement - Web APIs
keep in mind that browsers may ignore autoplay
requests, so you should ensure that your code isn't dependent on autoplay working.
... pause fired when a
request to pause play is handled and the activity has entered its paused state, most commonly occurring when the media's htmlmediaelement.pause() method is called.
HTMLSelectElement.add() - Web APIs
exceptions a domerror of the type hierarchy
requesterror if the item passed to the method is an ancestor of the htmlselectelement.
...it throws a domerror of the type hierarchy
requesterror if the passed item is an ancestor of the htmlselectelement and no longer throws if the before parameter is not found.
In depth: Microtasks and the JavaScript runtime environment - Web APIs
this is further alleviated by using asynchronous javascript techniques such as promises to allow the main code to continue to run while waiting for the results of a
request.
... however, code running at a more fundamental level—such as code comprising a library or framework—may need a way to schedule code to be run at a safe time while still executing on the main thread, independent of the results of any single
request or task.
Working with the History API - Web APIs
adding and modifying history entries using pushstate() changes the referrer that gets used in the http header for xmlhttp
request objects created after you change the state.
... the referrer will be the url of the document whose window is this at the time of creation of the xmlhttp
request object.
IDBEnvironment - Web APIs
example the following code creates a
request for a database to be opened asychronously, after which the database is opened when the
request's onsuccess handler is fired: var db; function opendb() { var dbopen
request = window.indexeddb.open("todolist"); dbopen
request.onsuccess = function(e) { db = dbopen
request.result; }; } browser compatibility the compatibility table on this page is generated from structured data.
... if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IDBIndexSync - Web APIs
returns void exceptions this method can raise an idbdatabaseexception with the following code: not_found_err if no records exist in this index for the
requested key range.
... returns void exceptions this method can raise an idbdatabaseexception with the following code: not_found_err if no records exist in this index for the
requested key range.
FileHandle.getFile() - Web APIs
syntax var
request = instanceoffilehandle.getfile(); return a dom
request object.
... in case of success, the
request's result is a file object.
IDBMutableFile - Web APIs
mutablefile.getfile() returns a dom
request object.
... in case of success, the
request's result is a file object representing a snapshot of the handled file.
IDBVersionChangeEvent.oldVersion - Web APIs
example var dbname = "sampledb"; var dbversion = 2; var
request = indexeddb.open(dbname, dbversion);
request.onupgradeneeded = function(e) { var db =
request.result; if (e.oldversion < 1) { db.createobjectstore("store1"); } if (e.oldversion < 2) { db.deleteobjectstore("store1"); db.createobjectstore("store2"); } // etc.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
IdleDeadline - Web APIs
the idledeadline interface is used as the data type of the input parameter to idle callbacks established by calling window.
requestidlecallback().
... to learn more about how
request callbacks work, see collaborative scheduling of background tasks.
Timing element visibility with the Intersection Observer API - Web APIs
function handlerefreshinterval() { let redrawlist = []; visibleads.foreach(function(adbox) { let previoustime = adbox.dataset.totalviewtime; updateadtimer(adbox); if (previoustime != adbox.dataset.totalviewtime) { redrawlist.push(adbox); } }); if (redrawlist.length) { window.
requestanimationframe(function(time) { redrawlist.foreach(function(adbox) { drawadtimer(adbox); }); }); } } the array redrawlist will be used to keep a list of all the ads which need to be redrawn during this refresh cycle, since it may not be exactly the same as the elapsed time due to system activity or because you've set the interval to something other than every 1000 millis...
... finally, if there's at least one element to redraw, we use
requestanimationframe() to schedule a function that will redraw each element in the redrawlist during the next animation frame.
Intersection Observer API - Web APIs
the intersection observer api lets code register a callback function that is executed whenever an element they wish to monitor enters or exits another element (or the viewport), or when the amount by which the two intersect changes by a
requested amount.
...it should operate as quickly as possible; if anything time-consuming needs to be done, use window.
requestidlecallback().
LockManager.query() - Web APIs
pending: an array of lock objects for pending lock
requests.
... example const state = await navigator.locks.query(); for (const lock of state.held) { console.log(`held lock: name ${lock.name}, mode ${lock.mode}`); } for (const
request of state.pending) { console.log(`
requested lock: name ${
request.name}, mode ${
request.mode}`); } specifications specification status comment web locks apithe definition of 'query()' in that specification.
LockManager - Web APIs
the lockmanager interface of the the web locks api provides methods for
requesting a new lock object and querying for an existing lock object.
... methods lockmanager.
request()
requests a lock object with parameters specifying its name and characteristics.
LockedFile.append() - Web APIs
syntax var
request = instanceoflockedfile.append(data); parameters data the data to write into the file.
... return a file
request object to handle the success or failure of the operation.
LockedFile.truncate() - Web APIs
syntax var
request = instanceoflockedfile.truncate(start); parameters start optional a number representing the index where to start the operation.
... return a file
request object to handle the success or failure of the operation.
LockedFile.write() - Web APIs
syntax var
request = instanceoflockedfile.write(data); parameters data the data to write into the file.
... return a file
request object to handle the success or failure of the operation.
MediaDevices.getDisplayMedia() - Web APIs
since getdisplaymedia() requires a video track, the returned stream will have one even if no video track is expressly
requested by the constraints object.
... async function startcapture(displaymediaoptions) { let capturestream = null; try { capturestream = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); } catch(err) { console.error("error: " + err); } return capturestream; } this uses await to asynchronously wait for getdisplaymedia() to resolve with a mediastream which contains the display contents as
requested by the specified options.
MediaKeyMessageEvent() - Web APIs
syntax var mediakeymessageevent = new mediakeymessageevent(typearg, options) parameters typearg a domstring containing one of may be one of license-
request, license-renewal, license-renewal, or individualization-
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
MediaRecorder.ondataavailable - Web APIs
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.
...you can use timeslice alongside mediarecorder.stop() and mediarecorder.
requestdata() to produce multiple same-length blobs plus other shorter blobs as well.
MediaRecorder.onerror - Web APIs
this exception can also occur when a
request is made on a source that has been deleted or removed.
... notsupportederror an attempt was made to instantiate a mediarecorder using a mime type that isn't supported on the user's device; one or more of the
requested container, codecs, or profiles as well as other information may be invalid.
MediaRecorder.start() - Web APIs
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.
...if this parameter isn't included, the entire media duration is recorded into a single blob unless the
requestdata() method is called to obtain the blob and trigger the creation of a new blob into which the media continues to be recorded.
MediaSource.endOfStream() - Web APIs
for example, you might have a function that handles media chunk
requests, separate from other network
requests.
... when you make an xmlhttp
request call for a media chunk, and onabort or onerror triggers, you might want to call endofstream('network'), display a descriptive message in the ui, and maybe retry the network
request immediately or wait until the network is back up (via some kind of polling.) decode: terminates playback and signals that a decoding error has occured.
MediaSource - Web APIs
examples the following simple example loads a video with xmlhttp
request, playing it as soon as it can.
... this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; function fetchab (url, cb) { console.log(url); var xhr = new xmlhttp
request; xhr.open('get', url); xhr.responsetype = 'arraybuffer'; xhr.onload = function () { cb(xhr.response); }; xhr.send(); }; specifications specification status comment media source extensionsthe definition of 'mediasource' in that specification.
MediaTrackConstraints.autoGainControl - Web APIs
the mediatrackconstraints dictionary's autogaincontrol property is a constrainboolean describing the
requested or mandatory constraints placed upon the value of the autogaincontrol constrainable property.
...if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the automatic gain control feature; if it can't be met, then the
request will result in an error.
MediaTrackConstraints.echoCancellation - Web APIs
the mediatrackconstraints dictionary's echocancellation property is a constrainboolean describing the
requested or mandatory constraints placed upon the value of the echocancellation constrainable property.
...if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the echo cancellation feature; if it can't be met, then the
request will result in an error.
MediaTrackConstraints.facingMode - Web APIs
the mediatrackconstraints dictionary's facingmode property is a constraindomstring describing the
requested or mandatory constraints placed upon the value of the facingmode constrainable property.
... an exact value in this case indicates that the specified facing mode is specifically required; for example: var constraints = { facingmode: { exact: "user" } }; this indicates that only a user-facing camera is acceptable; if there is no user-facing camera, or the user declines permission to use that camera, the media
request will fail.
MediaTrackConstraints.noiseSuppression - Web APIs
the mediatrackconstraints dictionary's noisesuppression property is a constrainboolean describing the
requested or mandatory constraints placed upon the value of the noisesuppression constrainable property.
...if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the noise suppression feature; if it can't be met, then the
request will result in an error.
MediaTrackSupportedConstraints.frameRate - Web APIs
the framerate constraint can be used to establish acceptable upper and lower bounds on the video frame rate for a new video track, or to specify an exact frame rate that must be provided for the
request to succeed.
... example this simple example looks to see if your browser supports constraining the frame rate when
requesting video tracks.
MediaTrackSupportedConstraints - Web APIs
because of the way interface definitions in webidl work, if a constraint is
requested but not supported, no error will occur.
... instead, the specified constraints will be applied, with any unrecognized constraints stripped from the
request.that can lead to confusing and hard to debug errors, so be sure to use getsupportedconstraints() to retrieve this information before attempting to establish constraints if you need to know the difference between silently ignoring a constraint and a constraint being accepted.
MerchantValidationEvent.methodName - Web APIs
syntax methodid = merchantvalidationevent.methodname; value a read-only domstring which uniquely identifies the payment handler which is
requesting merchant validation.
... specifications specification status comment payment
request apithe definition of 'merchantvalidationevent.methodname' in that specification.
Navigation Timing API - Web APIs
concepts and usage you can use the navigation timing api to gather performance data on the client side, which you can then transmit to a server using xmlhttp
request or other techniques.
... calculate
request response time you can calculate the time elapsed between the beginning of a
request and the completion of getting the response using code like this: const connecttime = perfdata.responseend - perfdata.
requeststart; here, the time at which the
request was initiated (
requeststart).
Navigator.getUserMedia() - Web APIs
syntax navigator.getusermedia(constraints, successcallback, errorcallback); parameters constraints a mediastreamconstraints object specifying the types of media to
request, along with any requirements for each type.
... successcallback a function which is invoked when the
request for media access is approved.
Notification.permission - Web APIs
examples the following snippet could be used if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notifications, then
request permission if required, before then sending a notification.
... // let's check whether notification permissions have alredy been granted else if (notification.permission === "granted") { // if it's okay let's create a notification var notification = new notification("hi there!"); } // otherwise, we need to ask the user for permission else if (notification.permission !== 'denied' || notification.permission === "default") { notification.
requestpermission(function (permission) { // if the user accepts, let's create a notification if (permission === "granted") { var notification = new notification("hi there!"); } }); } // at last, if the user has denied notifications, and you // want to be respectful there is no need to bother them any more.
OfflineAudioContext.startRendering() - Web APIs
mple, see our offline-audio-context-promise github repo (see the source code too.) // define online and offline audio context var audioctx = new audiocontext(); var offlinectx = new offlineaudiocontext(2,44100*40,44100); source = offlinectx.createbuffersource(); // use xhr to load an audio track, and // decodeaudiodata to decode it and offlineaudiocontext to render it function getdata() {
request = new xmlhttp
request();
request.open('get', 'viper.ogg', true);
request.responsetype = 'arraybuffer';
request.onload = function() { var audiodata =
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.connect(offlinectx.destination); source.start(); //source.loop = true; o...
...x.createbuffersource(); song.buffer = renderedbuffer; song.connect(audioctx.destination); play.onclick = function() { song.start(); } }).catch(function(err) { console.log('rendering failed: ' + err); // note: the promise should reject when startrendering is called a second time on an offlineaudiocontext }); }); }
request.send(); } // run getdata to start the process off getdata(); specifications specification status comment web audio apithe definition of 'startrendering()' in that specification.
OfflineAudioContext - Web APIs
mple, see our offline-audio-context-promise github repo (see the source code too.) // define online and offline audio context var audioctx = new audiocontext(); var offlinectx = new offlineaudiocontext(2,44100*40,44100); source = offlinectx.createbuffersource(); // use xhr to load an audio track, and // decodeaudiodata to decode it and offlineaudiocontext to render it function getdata() {
request = new xmlhttp
request();
request.open('get', 'viper.ogg', true);
request.responsetype = 'arraybuffer';
request.onload = function() { var audiodata =
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.connect(offlinectx.destination); source.start(); //source.loop = true; o...
...x.createbuffersource(); song.buffer = renderedbuffer; song.connect(audioctx.destination); play.onclick = function() { song.start(); } }).catch(function(err) { console.log('rendering failed: ' + err); // note: the promise should reject when startrendering is called a second time on an offlineaudiocontext }); }); }
request.send(); } // run getdata to start the process off getdata(); specifications specification status comment web audio apithe definition of 'offlineaudiocontext' in that specification.
OffscreenCanvas - Web APIs
}; you can also use
requestanimationframe in workers onmessage = function(evt) { const canvas = evt.data.canvas; const gl = canvas.getcontext("webgl"); function render(time) { // ...
...
requestanimationframe(render); }
requestanimationframe(render); }; specifications specification status comment html living standardthe definition of 'offscreencanvas' in that specification.
PasswordCredential - Web APIs
the data in the objects will be added to the
request body and sent to the remote endpoint with the credentials.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
PayerErrors - Web APIs
the payererrors dictionary is used by the payment
request api to indicate the presence of—and to explain how to correct—validation errors in the payer details.
... example specifications specification status comment payment
request apithe definition of 'payererrors' in that specification.
PaymentAddress.country - Web APIs
ntry = paymentaddress.country; value a domstring which contains the iso3166-1 alpha-2 code identifying the country in which the address is located, or an empty string if no country is available, which frequently can be assumed to mean "same country as the site owner." usage notes if the payment handler validates the address and determines that the value of country is invalid, a call to payment
requestupdateevent.updatewith() will be made with a details object containing a shippingaddresserrors field.
... specifications specification status comment payment
request apithe definition of 'paymentaddress.country' in that specification.
PaymentCurrencyAmount - Web APIs
the paymentcurrencyamount dictionary describes an amount of money in terms of both a number of units and the currency (us dollars, euro, yen, etc.), and is part of the payment
request api.
... specifications specification status comment payment
request apithe definition of 'paymentcurrencyamount' in that specification.
PaymentDetailsUpdate.error - Web APIs
this happens if both of the following are true: the payment
request specifies using its
requestshipping property that shipping information is required.
... specifications specification status comment payment
request apithe definition of 'paymentdetailsupdate.error' in that specification.
PaymentDetailsUpdate.shippingAddressErrors - Web APIs
the paymentdetailsupdate dictionary's shippingaddresserrors property, if present, contains an addresserrors object whose contents provide error messages for one or more of the values in the paymentaddress specified as payment
request.shippingaddress.
... specifications specification status comment payment
request apithe definition of 'paymentdetailsupdate.shippingaddresserrors' in that specification.
PaymentItem - Web APIs
the paymentitem dictionary is used by the payment
request api to describe a single line item on a payment
request.
... specifications specification status comment payment
request apithe definition of 'paymentitem' in that specification.
PaymentResponse.methodName - Web APIs
example the following example extracts the method name from the paymentresponse object to the promise returned from payment
request.show().
... payment.show().then(paymentresponse => { var paymentdata = { // payment method string method: paymentresponse.methodname, // payment details as you
requested details: paymentresponse.details, // shipping address information address: todict(paymentresponse.shippingaddress) }; // send information to the server }); specifications specification status comment payment
request api candidate recommendation initial definition.
PayerResponse.payerPhone - Web APIs
this option is only present when the
requestpayerphone option is set to true in the paymentoptions object passed to the payment
request constructor.
... syntax var payerphone = paymentresponse.payerphone; specifications specification status comment payment
request api candidate recommendation initial definition.
PerformanceEntry.entryType - Web APIs
resource performanceresourcetiming url the resolved url of the
requested resource.
... this value doesn't change even if the
request is redirected.
PerformanceEntry.name - Web APIs
url performanceresourcetiming resource the resolved url of the
requested resource.
... this value doesn't change even if the
request is redirected.
PerformanceResourceTiming - Web APIs
an application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an xmlhttp
request, <svg>, image, or script.
... performanceresourcetiming.
requeststartread only a domhighrestimestamp immediately before the browser starts
requesting the resource from the server.
PermissionStatus - Web APIs
properties permissionstatus.state read only returns the state of a
requested permission; one of 'granted', 'denied', or 'prompt'.
... permissionstatus.statusread only returns the state of a
requested permission; one of 'granted', 'denied', or 'prompt'.
Permissions.revoke() - Web APIs
returns a promise that calls its fulfillment handler with a permissionstatus object indicating the result of the
request.
... example this function can be used by an app to
request that its own geolocation api permission be revoked.
PublicKeyCredential.getClientExtensionResults() - Web APIs
during the creation or fetching of a publickeycredential (respectively via navigator.credentials.create() and navigator.credentials.get()), it is possible to have "custom" processing by the client for different extensions which are respectively given by publickeycredentialcreationoptions.extensions and publickeycredential
requestoptions.extensions.
...as of march 2019, only appid (used during creation with publickeycredential
requestoptions.extensions) is supported by chrome and edge.
PushManager.hasPermission() - Web APIs
the pushmanager.haspermission() method of the pushmanager interface returns a promise that resolves to the pushpermissionstatus of the
requesting webapp, which will be one of granted, denied, or default.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
PushManager.registrations() - Web APIs
syntax var
request = navigator.push.registrations(); return a dom
request object to handle the success or failure of the method call.
... if the method call is successful, the
request's result will be an array of pushregistration objects.
PushRegistrationManager - Web APIs
pushregistrationmanager.haspermission() returns a promise that resolves to the pushpermissionstatus of the
requesting webapp.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
Web Push API Notifications best practices - Web APIs
sometimes news sites
request push notifications so they can essentially say "look at me!
...for example, safari 12.1 now requires—and other browsers either already do, or are planning[1] to do so—that the user interact with the page in some way before the page can
request permission to perform push notifications.
Push API - Web APIs
see the following articles for more information: cross-site
request forgery (csrf) prevention cheat sheet preventing csrf and xsrf attacks for an app to receive push messages, it has to have an active service worker.
... pushmanager provides a way to receive notifications from third-party servers, as well as
request urls for push notifications.
RTCIceCandidate.tcpType - Web APIs
"active" the transport will try to open an outbound connection but won't receive inoming connection
requests.
... "passive" the transport will receive incoming connection
requests but won't try to open an outbound connection.
RTCIceCandidatePairStats.currentRoundTripTime - Web APIs
this value is computed by observing the time that elapsed between the most recent stun
request being sent to the remote peer and the response to that
request arriving.
... this information may come from ongoing stun connectivity checks as well as from consent
requests made when the connection was initially being opened.
RTCIceCandidatePairStats.responsesSent - Web APIs
syntax responsessent = rtcicecandidatepairstats.responsessent; value an integer value indicating the number of times a repsonse has been sent to a stun connectivity check
request.
... note: since it isn't possible to tell the difference between connectivity check
requests and consent
requests, this value includes both.
RTCIceCandidatePairStats.writable - Web APIs
syntax iswritable = rtcicecandidatepairstats.writable; value a boolean value which is true if the connection described by this candidate pair has received acknowledgement of receipt (ack) for at least one ice
request and that stun consent hasn't expired.
... note: this property was removed from the specification in early 2017 because you can determine whether or not an incoming ice
request is available to read by checking to see if responsesreceived is greater than 0 and that the time specified by consentexpiredtimestamp has not passed: if (icpstats.responsesreceived > 0 && icpstats.consentexpiredtimestamp < performance.now()) { /* at least one ice response has been received */ } ...
RTCIceTcpCandidateType - Web APIs
values "active" the transport will try to open an outbound connection but won't receive inoming connection
requests.
... "passive" the transport will receive incoming connection
requests but won't try to open an outbound connection.
RTCIceTransportState - Web APIs
"closed" the transport has shut down and is no longer responding to stun
requests.
... stun
requests being sent to the remote device have gone unanswered repeatedly.
RTCPeerConnection.createAnswer() - Web APIs
failurecallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the
request to create an answer failed.
... options optional an optional rtcofferoptions object providing options
requested for the answer.
RTCRtpSender.getStats() - Web APIs
the rtcrtpsender method getstats() asynchronously
requests an rtcstatsreport object which provides statistics about outgoing traffic on the rtcpeerconnection which owns the sender, returning a promise which is fulfilled when the results are available.
... example this simple example obtains the statistics for an rtcrtpsender and updates an element's innertext to display the current round trip time for
requests on the sender.
ReadableStreamBYOBReader.releaseLock() - Web APIs
a reader’s lock cannot be released while it still has a pending read
request, i.e., if a promise returned by the reader’s readablestreambyobreader.read() method has not finished.
... exceptions typeerror the source object is not a readablestreambyobreader, or a read
request is pending.
ReadableStreamDefaultReader.releaseLock() - Web APIs
a reader’s lock cannot be released while it still has a pending read
request, i.e., if a promise returned by the reader’s readablestreamdefaultreader.read() method has not finished.
... exceptions typeerror the source object is not a readablestreamdefaultreader, or a read
request is pending.
Reporting API - Web APIs
you can then retrieve reports by making a
request to those urls.
... intervention report indicates that a
request made by the website has been denied by the browser, e.g.
Response - Web APIs
the response interface of the fetch api represents the response to a
request.
... you'll notice that since we are
requesting an image, we need to run body.blob (response implements body) to give the response its correct mime type.
Streams API concepts - Web APIs
pull sources require you to explicitly
request data from them once connected to.
... you can make use of ready-made readable streams via mechanisms like a response.body from a fetch
request, or roll your own streams using the readablestream() constructor.
SubtleCrypto.deriveBits() - Web APIs
exceptions the promise is rejected when one of the following exceptions are encountered: invalidaccesserror raised when the base key is not a key for the
requested derivation algorithm or if the cryptokey.usages value of that key doesn't contain derivekey.
... notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for derivation, or if the algorithm
requested for the derived key doesn't define a key length.
SubtleCrypto.deriveKey() - Web APIs
exceptions the promise is rejected when one of the following exceptions are encountered: invalidaccesserror raised when the master key is not a key for the
requested derivation algorithm or if the cryptokey.usages value of that key doesn't contain derivekey.
... notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for derivation, or if the algorithm
requested for the derived key doesn't define a key length.
USB.getDevices() - Web APIs
for information on pairing devices, see usb.
requestdevice().
...for information on pairing devices, see usb.
requestdevice().
USBInTransferResult - Web APIs
it represents the result from
requesting a transfer of data from the usb device to the usb host.
... usbintransferresult.statusread only returns the status of the transfer
request, one of: "ok" - the transfer was successful.
USBIsochronousInTransferPacket - Web APIs
it represents the status of an individual packet from a
request to transfer data from the usb device to the usb host over an isochronous endpoint.
... usbisochronousintransferpacket.statusread only read only returns the status of the transfer
request, one of: "ok" - the transfer was successful.
USBIsochronousInTransferResult - Web APIs
it represents the result from
requesting a transfer of data from the usb device to the usb host.
... usbisochronousintransferresult.packetsread only returns an array of usbisochronousintransferpacket objects containing the result of each
request to receive a packet from the device.
USBIsochronousOutTransferPacket - Web APIs
it represents the status of an individual packet from a
request to transfer data from the usb host to the usb device over an isochronous endpoint.
... usbisochronousouttransferpacket.statusread only returns the status of the transfer
request, one of: "ok" - the transfer was successful.
USBIsochronousOutTransferResult - Web APIs
it represents the result from
requesting a transfer of data from the usb host to the usb device.
... properties usbisochronousouttransferresult.packetsread only returns an array of usbisochronousouttransferpacket objects containing the result of each
request to send a packet to the device.
Animating objects with WebGL - Web APIs
we can do that by creating a new variable to track the time at which we last animated (let's call it then), then adding the following code to the end of the main function var then = 0; // draw the scene repeatedly function render(now) { now *= 0.001; // convert to seconds const deltatime = now - then; then = now; drawscene(gl, programinfo, buffers, deltatime);
requestanimationframe(render); }
requestanimationframe(render); this code uses
requestanimationframe to ask the browser to call the function "render" on each frame.
...
requestanimationframe passes us the time in milliseconds since the page loaded.
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
remote peer on the remote peer, when we receive an sdp offer with the directionality set to "sendonly", we handle it using the hold
requested() method, which accepts as input an sdp offer string.
... async function hold
requested(offer) { try { await peerconnection.setremotedescription(offer); await audiotransceiver.sender.replacetrack(null); audiotransceiver.direction = "recvonly"; await sendanswer(); } catch(err) { /* handle the error */ } } the steps taken here are: set the remote description to the specified offer by calling rtcpeerconnection.setremotedescription().
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
signaler.send({ description: pc.localdescription }); }; pc.oniceconnectionstatechange = () => { if (pc.iceconnectionstate === "failed") { pc.onnegotiationneeded({ icerestart: true }); } }; this has a number of reliability issues and outright bugs (such as failing if the iceconnectionstatechange event fires when the signaling state isn't stable), but there was no way you could actually
request an ice restart other than by creating and sending an offer with the icerestart option set to true.
... sending the restart
request thus required directly invoking the negotiationneeded event's handler.
Introduction to WebRTC protocols - Web APIs
the client will send a
request to a stun server on the internet who will reply with the client’s public address and whether or not the client is accessible behind the router’s nat.
...
requests will be translated from the device’s private ip to the router’s public ip with a unique port.
Taking still photos with WebRTC - Web APIs
this function's job is to
request access to the user's webcam, initialize the output <img> to a default state, and to establish the event listeners needed to receive each frame of video from the camera and react when the button is clicked to capture an image.
....getelementbyid('startbutton'); get the media stream the next task is to get the media stream: navigator.mediadevices.getusermedia({ video: true, audio: false }) .then(function(stream) { video.srcobject = stream; video.play(); }) .catch(function(err) { console.log("an error occurred: " + err); }); here, we're calling mediadevices.getusermedia() and
requesting a video stream (without audio).
WebRTC API - Web APIs
rtcsessiondescriptioncallback the rtcsessiondescriptioncallback is passed into the rtcpeerconnection object when
requesting it to create offers or answers.
... rtcidentityprovider enables a user agent is able to
request that an identity assertion be generated or validated.
Writing WebSocket client applications - Web APIs
a custom protocol of "protocolone" is named in the
request for the socket in this example, though this can be omitted.
... establishing a websocket relies on the http upgrade mechanism, so the
request for the protocol upgrade is implicit when we address the web server as ws://www.example.com or wss://www.example.com.
Writing a WebSocket server in Java - Web APIs
inputstream in = client.getinputstream(); outputstream out = client.getoutputstream(); scanner s = new scanner(in, "utf-8"); handshaking when a client connects to a server, it sends a get
request to upgrade the connection to a websocket from a simple http
request.
... you must, obtain the value of sec-websocket-key
request header without any leading and trailing whitespace link it with "258eafa5-e914-47da-95ca-c5ab0dc85b11" compute sha-1 and base64 code of it write it back as value of sec-websocket-accept response header as part of a http response.
Inputs and input sources - Web APIs
function drawframe(time, frame) { applyexternalinputs(avatar); let pose = frame.getviewerpose(avatar.referencespace); animationframe
request = session.
requestanimationframe(drawframe); /* draw the frame here */ } the drawframe() function shown here is the callback invoked when it's time to draw the frame, as established by calling the the xrsession method
requestanimationframe().
... after that, everything proceeds as usual, getting the viewer's pose from the updated reference frame,
requesting the next frame callback through
requestanimationframe(), and then continuing to set up webgl and draw the scene.
WebXR Device API - Web APIs
to get an xrframe, call the session's
requestanimationframe() method, providing a callback which will be called with the xrframe once available.
...once an xrsession is obtained from navigator.xr.
requestsession(), the session can be used to check the position and orientation of the viewer, query the device for environment information, and present the virtual or augmented world to the user.
Using the Web Animations API - Web APIs
it is one of the most performant ways to animate on the web, letting the browser make its own internal optimizations without hacks, coercion, or window.
requestanimationframe().
...like windowtimers.settimeout() and window.
requestanimationframe(), the web animations api only takes milliseconds.
Advanced techniques: Creating and sequencing audio - Web APIs
if (lastnotedrawn != drawnote) { pads.foreach(function(el, i) { el.children[lastnotedrawn].style.bordercolor = 'hsla(0, 0%, 10%, 1)'; el.children[drawnote].style.bordercolor = 'hsla(49, 99%, 50%, 1)'; }); lastnotedrawn = drawnote; } // set up to draw again
requestanimationframe(draw); } putting it all together now all that's left to do is make sure we've loaded the sample before we are able to play the instrument.
...splaying; if (isplaying) { // start playing // check if context is in suspended state (autoplay policy) if (audioctx.state === 'suspended') { audioctx.resume(); } currentnote = 0; nextnotetime = audioctx.currenttime; scheduler(); // kick off scheduling
requestanimationframe(draw); // start the drawing loop.
Migrating from webkitAudioContext - Web APIs
the example below shows old code which downloads an audio file over the network, and then decoded it using createbuffer(): var xhr = new xmlhttp
request(); xhr.open("get", "/path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = function() { var decodedbuffer = context.createbuffer(xhr.response, false); if (decodedbuffer) { // decoding was successful, do something useful with the audio buffer } else { alert("decoding the audio buffer failed"); } }; converting this code to use decodeaudiodata() is r...
...elatively simple, as can be seen below: var xhr = new xmlhttp
request(); xhr.open("get", "/path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = function() { context.decodeaudiodata(xhr.response, function onsuccess(decodedbuffer) { // decoding was successful, do something useful with the audio buffer }, function onfailure() { alert("decoding the audio buffer failed"); }); }; note that the decodeaudiodata() method is asynchronous, which means that it will return immediately, and then when the decoding finishes, one of the success or failure callback functions will get called depending on whether the audio decoding was successful.
Web Workers API - Web APIs
in addition, workers may use xmlhttp
request for network i/o, with the exception that the responsexml and channel attributes on xmlhttp
request always return null.
...they are intended, among other things, to enable the creation of effective offline experiences, intercept network
requests and take appropriate action based on whether the network is available, and update assets residing on the server.
Window.screenLeft - Web APIs
in this example we are using screenleft/screentop plus window.
requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved.
...et topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); ctx.arc(leftupdate + (width/2), topupdate + (height/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.
requestanimationframe(positionelem); } window.
requestanimationframe(positionelem); also in the code we include a snippet that detects whether screenleft is supported, and if not, polyfills in screenleft/screentop using window.screenx/window.screeny.
Window.screenTop - Web APIs
in this example we are using screenleft/screentop plus window.
requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved.
...et topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); ctx.arc(leftupdate + (width/2), topupdate + (height/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.
requestanimationframe(positionelem); } window.
requestanimationframe(positionelem); also in the code we include a snippet that detects whether screenleft is supported, and if not, polyfills in screenleft/screentop using window.screenx/window.screeny.
Window.screenX - Web APIs
in this example we are using window.screenleft/window.screentop plus window.
requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved.
...et topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); ctx.arc(leftupdate + (width/2), topupdate + (height/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.
requestanimationframe(positionelem); } window.
requestanimationframe(positionelem); these work in exactly the same way as screenx/screeny.
Window.screenY - Web APIs
in this example we are using window.screenleft/window.screentop plus window.
requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved.
...et topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); ctx.arc(leftupdate + (width/2), topupdate + (height/2) + 35, 50, degtorad(0), degtorad(360), false); ctx.fill(); pelem.textcontent = 'window.screenleft: ' + window.screenleft + ', window.screentop: ' + window.screentop; window.
requestanimationframe(positionelem); } window.
requestanimationframe(positionelem); these work in exactly the same way as screenx/screeny.
WindowOrWorkerGlobalScope.setInterval() - Web APIs
for example, if using setinterval() to poll a remote server every 5 seconds, network latency, an unresponsive server, and a host of other issues could prevent the
request from completing in its allotted time.
... as such, you may find yourself with queued up xhr
requests that won't necessarily return in order.
WorkerNavigator.permissions - Web APIs
examples self.navigator.permissions.query({name:'notifications'}).then(function(result) { if (result.state === 'granted') { shownotification(); } else if (result.state === 'prompt') {
requestnotificationpermission() } }); specification specification status comment permissions working draft initial definition.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
Worklet.addModule() - Web APIs
options optional an object with any of the following options: credentials: a
requestcredentials value that indicates whether to send credentials (e.g.
...see also
request.credentials.
XMLDocument.load() - Web APIs
can be used with document.async to indicate whether the
request is synchronous or asynchronous (the default).
... as of at least gecko 1.9, this no longer supports cross-site loading of documents (use xmlhttp
request or fetch() instead).
XRFrame.getViewerPose() - Web APIs
exceptions invalidstateerror a domexception indicating that getviewerpose() was not called within the context of a callback to a session's xrsession.
requestanimationframe().
... examples in this callback function for
requestanimationframe(), the xrviewerpose describing the viewer's viewpoint on the world is obtained by calling getviewerpose() on the xrframe passed into the callback.
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
xrsession.
requestreferencespace("local") .then((refspace) => { xrreferencespace = refspace; xrreferencespace = xrreferencespace.getoffsetreferencespace( new xrrigidtransform(startposition, {x:0, y:0, z:1.0, w: 1.0})); xrsession.
requestanimationframe(drawframe); }); in this code, we obtain a local reference space, then use getoffsetreferencespace() to create a new space whose origin is adjusted to a ...
...then the first animation frame is
requested using xrsession's
requestanimationframe().
XRReferenceSpaceType - Web APIs
this type is used when calling the
requestreferencespace() method to obtain a reference space for an xrsession.
... values the reference space returned by xrsession.
requestreferencespace() is either xrreferencespace or xrboundedreferencespace.
XRSessionInit - Web APIs
the webxr device api dictionary xrsessioninit specifies required and/or optional features when
requesting a new xrsession by calling the navigator.xr.
requestsession() method.
... because immersive sessions are required to support the local reference space, any
request to open an immersive xrsession is required to obtain explicit or implicit user consent.
XRSystem: isSessionSupported() - Web APIs
if no session is already underway, we
request the vr session and, if successful, set up the session in a method called onsessionstarted(), not shown.
... if (navigator.xr) { navigator.xr.issessionsupported('immersive-vr') .then((issupported) => { if (issupported) { userbutton.addeventlistener('click', onbuttonclicked); userbutton.innerhtml = 'enter xr'; userbutton.disabled = false; } }); } function onbuttonclicked() { if (!xrsession) { navigator.xr.
requestsession('immersive-vr') .then((session) => { xrsession = session; // onsessionstarted() not shown for reasons of brevity and clarity.
XRViewport - Web APIs
these values may be passed directly into the webglrenderingcontext.viewport() method: let xrviewport = xrwebgllayer.getviewport(xrview); gl.viewport(xrviewport.x, xrviewport.y, xrviewport.width, xrviewport.height); example this example sets up an animation frame callback using
requestanimationframe().
... xrsession.
requestanimationframe((time, xrframe) => { let viewerpose = xrframe.getviewerpose(xrreferencespace); gl.bindframebuffer(xrwebgllayer.framebuffer); for (xrview of viewerpose.views) { let xrviewport = xrwebgllayer.getviewport(xrview); gl.viewport(xrviewport.x, xrviewport.y, xrviewport.width, xrviewport.height); // now we can use webgl to draw into a viewport matching // the viewer's needs } }); specifications specification status comment webxr device apithe definition of 'xrviewport' in that specification.
prefers-reduced-motion - CSS: Cascading Style Sheets
the prefers-reduced-motion css media feature is used to detect if the user has
requested that the system minimize the amount of non-essential motion it uses.
... user preferences for firefox, the reduce
request is honoured if: in gtk/gnome: gnome tweaks > general tab (or appearance, depending on version) > animations is turned off.
@media - CSS: Cascading Style Sheets
prefers-contrast detects if the user has
requested the system increase or decrease the amount of contrast between adjacent colors added in media queries level 5.
...for example, prefers-reduced-motion to detect if the user has
requested that the system minimize the amount of animation or motion it uses.
Implementing image sprites in CSS - CSS: Cascading Style Sheets
rather than include each image as a separate image file, it is much more memory- and bandwidth-friendly to send them as a single image; using background position as a way to distinguish between individual images in the same image file, so the number of http
requests is reduced.
... note: when using http/2, it may in fact be more bandwidth-friendly to use multiple small
requests.
animation-delay - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
animation-direction - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
background-position-x - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
background-position-y - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
background-position - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
background-size - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
border-bottom-width - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
border-left-style - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
border-left - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
border-right-style - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
border-right - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
border-top - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
border - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
caption-side - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
clear - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
column-count - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
cursor - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
... not-allowed the
requested action will not be carried out.
direction - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
empty-cells - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
font-style - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
... in general, for a
requested angle of 14 degrees or greater, larger angles are prefered; otherwise, smaller angles are preferred (see the spec's font matching section for the precise algorithm).
font-variant-caps - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
font-variant - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
letter-spacing - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
max-height - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
max-width - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
min-width - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
mix-blend-mode - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
object-fit - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
object-position - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
outline-color - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
outline-offset - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
pointer-events - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
position - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
quotes - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
right - CSS: Cascading Style Sheets
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
text-rendering - CSS: Cascading Style Sheets
in svg, when text is scaled up or down, browsers calculate the final size of the text (which is determined by the specified font size and the applied scale) and
request a font of that computed size from the platform's font system.
... but if you
request a font size of, say, 9 with a scale of 140%, the resulting font size of 12.6 doesn't explicitly exist in the font system, so the browser rounds the font size to 12 instead.
WAI ARIA Live Regions/API Support - Developer guides
e the offsets and removed text) text inserted text_changed::insert ia2_event_text_inserted (use iaccessibletext::get_newtext to retrieve the offsets and inserted text) text replaced text_changed::delete followed immediately by text_changed::insert ia2_event_text_removed followed immediately by ia2_event_text_inserted * we do not use msaa's create/destroy at the
request of screen reader vendors, who avoid those events because they cause crashes on some important system -- show/hide are the equivalent of those events.
... key presses yes mouse clicks yes mouse hovers no page load events no everything else, including focus changes, timer callbacks, xmlhttp
request callbacks, etc.
Live streaming web audio and video - Developer guides
rtmp comes in various flavours including rtmpe (encrypted), rtmps (secure over ssl/tls) and rtmpt (encapsulated within http
requests).
...so for example, if we detect that the network is slow, we can start
requesting lower quality (smaller) chunks for the next segment.
Audio and Video Delivery - Developer guides
web audio api var context; var
request; var source; try { context = new audiocontext();
request = new xmlhttp
request();
request.open("get","http://jplayer.org/audio/mp3/riomez-01-sleep_together.mp3",true);
request.responsetype = "arraybuffer";
request.onload = function() { context.decodeaudiodata(
request.response, function(buffer) { source = context.createbuffersource(); source.buffer = ...
...buffer; source.connect(context.destination); // auto play source.start(0); // start was previously noteon }); };
request.send(); } catch(e) { alert('web audio api not supported'); } in this example we retrieve an mp3 file via xhr, load it into a source and play it (try it for yourself).
DOM onevent handlers - Developer guides
non-element objects event handlers can also be set with properties on non-element objects that generate events, like window, document, xmlhttp
request, and others.
... for example, for the progress event on instances of xmlhttp
request: const xhr = new xmlhttp
request(); xhr.onprogress = function() { … }; html onevent attributes html elements have attributes named onevent which can be used to register a handler for an event directly within the html code.
Overview of events and handlers - Developer guides
the displayed page remains unchanged until the browser
requests a new page.
...ds based on the object emitting the event including: the window object, such as due to resizing the browser, the window.screen object, such as due to changes in device orientation, the document object, including the loading, modification, user interaction, and unloading of the page, the objects in the dom (document object model) tree including user interactions or modifications, the xmlhttp
request objects used for network
requests, and the media objects such as audio and video, when the media stream players change state.
<a>: The Anchor element - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...when the link is followed, the browser will send post
requests with the body ping to the urls.
<area> - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
... ping contains a space-separated list of urls to which, when the hyperlink is followed, post
requests with the body ping will be sent by the browser (in the background).
<button>: The Button element - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...possible values: post: the data from the form are included in the body of the http
request when sent to the server.
<input type="button"> - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...mousedown = function() { pressed = true; }; canvas.onmouseup = function() { pressed = false; } clearbtn.onclick = function() { ctx.fillstyle = 'rgb(0,0,0)'; ctx.fillrect(0,0,width,height); } function draw() { if(pressed) { ctx.fillstyle = colorpicker.value; ctx.beginpath(); ctx.arc(curx, cury-85, sizepicker.value, degtorad(0), degtorad(360), false); ctx.fill(); }
requestanimationframe(draw); } draw(); specifications specification status comments html living standardthe definition of '<input type="button">' in that specification.
<input type="hidden"> - HTML: Hypertext Markup Language
the basic idea is that if a user is filling in a sensitive form, such as a form on their banking website to transfer some money to another account, the secret they would be provided with would prove that they are who they say they are, and that they are using the correct form to submit the transfer
request.
...this kind of attack is called a cross site
request forgery (csrf); pretty much any reputable server-side framework uses hidden secrets to prevent such attacks.
<input type="url"> - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...this simple regular expression
requests a string that has any number of characters, followed by a dot, followed by "myco", followed by a dot, followed by any number of characters.
<script>: The Script element - HTML: Hypertext Markup Language
same-origin: a referrer will be sent for same origin, but cross-origin
requests will contain no referrer information.
... strict-origin-when-cross-origin: send a full url when performing a same-origin
request, but only send the origin when the protocol security level stays the same (e.g.https→https), and send no header to a less secure destination (e.g.
<textarea> - HTML: Hypertext Markup Language
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
HTML: Hypertext Markup Language
cors settings attributes some html elements that provide support for cors, such as <img> or <video>, have a crossorigin attribute (crossorigin property), which lets you configure the cors
requests for the element's fetched data.
... preloading content with rel="preload" the preload value of the <link> element's rel attribute allows you to write declarative fetch
requests in your html <head>, specifying resources that your pages will need very soon after loading, which you therefore want to start preloading early in the lifecycle of a page load, before the browser's main rendering machinery kicks in.
MIME types (IANA media types) - HTTP
value="test.txt"></label> <button>send the file</button> </form> will send this message: post / http/1.1 host: localhost:8000 user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate connection: keep-alive upgrade-insecure-
requests: 1 content-type: multipart/form-data; boundary=---------------------------8721656041911415653955004498 content-length: 465 -----------------------------8721656041911415653955004498 content-disposition: form-data; name="mytextfield" test -----------------------------8721656041911415653955004498 content-disposition: form-data; name="mycheckbox" on -----------------------------872165604191141565...
... when the 206 partial content status code is sent, this mime type indicates that the document is composed of several parts, one for each of the
requested ranges.
Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz' - HTTP
simply put, the origin making the
request does not match any of the origins permitted by the access-control-allow-origin header.
... if the service your code is accessing using a cors
request is under your control, make sure that it's configured to include your origin in its access-control-allow-origin header, and that only one such header is included in responses.
Reason: CORS disabled - HTTP
a
request that needs to use cors was attempted, but cors is disabled in the user's browser.
...setting this to true disables cors, so whenever that's the case, cors
requests will always fail with this error.
Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Headers’ - HTTP
the response to the cors
request that was sent by the server includes an access-control-allow-headers header which includes at least one invalid header name.
... the access-control-allow-headers header is sent by the server in response to a preflight
request; it lets the client know which http headers are permitted in cors
requests.
Content Security Policy (CSP) - HTTP
example 4 a web site administrator for an online banking site wants to ensure that all its content is loaded using tls, in order to prevent attackers from eavesdropping on
requests.
...a browser capable of enforcing csp would send the following violation report as a post
request to http://example.com/_/csp-reports, when the document is visited: { "csp-report": { "document-uri": "http://example.com/signup.html", "referrer": "", "blocked-uri": "http://example.com/css/style.css", "violated-directive": "style-src cdn.example.com", "original-policy": "default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports" } } as you can see, the re...
Feature Policy - HTTP
the features include: layout-inducing animations legacy image formats oversized images synchronous scripts synchronous xmlhttp
request unoptimized images unsized media granular control over certain features the web provides functionality and apis that may have privacy or security risks if abused.
... the features include (see features list): accelerometer ambient light sensor autoplay camera encrypted media fullscreen geolocation gyroscope magnetometer microphone midi payment
request picture-in-picture usb vr / xr examples using feature policy see feature policy demos for example usage of many policies.
Accept-CH-Lifetime - HTTP
the accept-ch-lifetime header is set by the server to specify the persistence of accept-ch header value that specifies for which client hints headers client should include in subsequent
requests.
...accept-ch and accept-ch-lifetime headers should be persisted for all secure
requests to ensure client hints are sent reliably.
Accept-CH - HTTP
the accept-ch header is set by the server to specify which client hints headers a client should include in subsequent
requests.
...accept-ch and accept-ch-lifetime headers should be persisted for all secure
requests to ensure client hints are sent reliably.
Accept-Encoding - HTTP
the accept-encoding
request http header advertises which content encoding, usually a compression algorithm, the client is able to understand.
... header type
request header forbidden header name yes syntax accept-encoding: gzip accept-encoding: compress accept-encoding: deflate accept-encoding: br accept-encoding: identity accept-encoding: * // multiple algorithms, weighted with the quality value syntax: accept-encoding: deflate, gzip;q=1.0, *;q=0.5 directives gzip a compression format using the lempel-ziv coding (lz77), with a 32-bi...
Accept-Language - HTTP
the accept-language
request http header advertises which languages the client is able to understand, and which locale variant is preferred.
... header type
request header forbidden header name no cors-safelisted
request header yes, with the additional restriction that values can only be 0-9, a-z, a-z, space or *,-.;=.
Accept-Patch - HTTP
accept-patch in response to any method means that patch is allowed on the resource identified by the
request-uri.
... two common cases lead to this: a server receiving a patch
request with an unsupported media type could reply with 415 unsupported media type and an accept-patch header referencing one or more supported media types.
Accept-Ranges - HTTP
the accept-ranges response http header is a marker used by the server to advertise its support of partial
requests.
... examples accept-ranges: bytes specifications specification title rfc 7233, section 2.3: accept-ranges hypertext transfer protocol (http/1.1): range
requests ...
Access-Control-Max-Age - HTTP
the access-control-max-age response header indicates how long the results of a preflight
request (that is the information contained in the access-control-allow-methods and access-control-allow-headers headers) can be cached.
... examples cache results of a preflight
request for 10 minutes: access-control-max-age: 600 specifications specification status comment fetchthe definition of 'access-control-max-age' in that specification.
Authorization - HTTP
the http authorization
request header contains the credentials to authenticate a user agent with a server, usually, but not necessarily, after the server has responded with a 401 unauthorized status and the www-authenticate header.
... header type
request header forbidden header name no syntax authorization: <type> <credentials> directives <type> authentication type.
CSP: block-all-mixed-content - HTTP
all mixed content resource
requests are blocked, including both active and passive mixed content.
... the upgrade-insecure-
requests directive is evaluated before block-all-mixed-content.
CSP: connect-src - HTTP
the apis that are restricted are: <a> ping, fetch, xmlhttp
request, websocket, eventsource, and navigator.sendbeacon().
... examples violation cases given this csp header: content-security-policy: connect-src https://example.com/ the following connections are blocked and won't load: <a ping="https://not-example.com"> <script> var xhr = new xmlhttp
request(); xhr.open('get', 'https://not-example.com/'); xhr.send(); var ws = new websocket("https://not-example.com/"); var es = new eventsource("https://not-example.com/"); navigator.sendbeacon("https://not-example.com/", { ...
CSP: sandbox - HTTP
the http content-security-policy (csp) sandbox directive enables a sandbox for the
requested resource similar to the <iframe> sandbox attribute.
... allow-storage-access-by-user-activation lets the resource
request access to the parent's storage capabilities with the storage access api.
Content-Security-Policy-Report-Only - HTTP
these violation reports consist of json documents sent via an http post
request to the specified uri.
...a browser capable of enforcing csp will send the following violation report as a post
request to http://example.com/_/csp-reports, when the document is visited: { "csp-report": { "document-uri": "http://example.com/signup.html", "referrer": "", "blocked-uri": "http://example.com/css/style.css", "violated-directive": "style-src cdn.example.com", "original-policy": "default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports", "disposition": "report" ...
Cookie - HTTP
the cookie http
request header contains stored http cookies previously sent by the server with the set-cookie header.
... header type
request header forbidden header name yes syntax cookie: <cookie-list> cookie: name=value cookie: name=value; name2=value2; name3=value3 <cookie-list> a list of name-value pairs in the form of <cookie-name>=<cookie-value>.
Cookie2 - HTTP
the obsolete cookie2 http
request header used to advise the server that the user agent understands "new-style" cookies, but nowadays user agents will use the cookie header instead, not this one.
... header type
request header forbidden header name yes examples cookie2: $version="1" specifications specification title rfc 2965: cookie2 historic specification of http state management mechanism, obsoleted by rfc 6265 ...
Cross-Origin-Resource-Policy - HTTP
the http cross-origin-resource-policy response header conveys a desire that the browser blocks no-cors cross-origin/cross-site
requests to the given resource.
... header type response header forbidden header name no syntax cross-origin-resource-policy: same-site | same-origin | cross-origin examples the response header below will cause compatible user agents to disallow cross-origin no-cors
requests: cross-origin-resource-policy: same-origin for more examples, see https://resourcepolicy.fyi/.
DPR - HTTP
header type
request header forbidden header name ?
... accept-ch: dpr accept-ch-lifetime: 86400 then on subsequent
requests the client might send dpr header back: dpr: 1.0 ...
Device-Memory - HTTP
header type
request header forbidden header name ?
... accept-ch: device-memory accept-ch-lifetime: 86400 then on subsequent
requests the client might send device-memory header back: device-memory: 1 specifications specification status comment device memory 1the definition of 'device-memory' in that specification.
Digest - HTTP
the digest response http header provides a digest of the
requested resource.
...the representation itself may be: fully contained in the response message body not at all contained in the message body (for example, in a response to a head
request) partially contained in the message body (for example, in a response to a range
request).
Feature-Policy: fullscreen - HTTP
the http feature-policy header fullscreen directive controls whether the current document is allowed to use element.
requestfullscreen().
... by default, top-level documents and their same-origin child frames can
request and enter fullscreen mode.
Feature-Policy: sync-xhr - HTTP
the http feature-policy header sync-xhr directive controls whether the current document is allowed to make synchronous xmlhttp
request requests.
... default policy by default the policy is set to *, which means synchronous
requests are allowed in all frames.
Large-Allocation - HTTP
a large-allocation header was ignored due to the load being triggered by a non-get
request.
... when a post
request is used to load a document, that load cannot currently be redirected into a new process.
Last-Modified - HTTP
conditional
requests containing if-modified-since or if-unmodified-since headers make use of this field.
... examples last-modified: wed, 21 oct 2015 07:28:00 gmt specifications specification title rfc 7232, section 2.2: last-modified hypertext transfer protocol (http/1.1): conditional
requests ...
Location - HTTP
in cases of redirection, the http method used to make the new
request to fetch the page pointed to by location depends of the original method and of the kind of redirection: if 303 (see also) responses always lead to the use of a get method, 307 (temporary redirect) and 308 (permanent redirect) don't change the method used in the original
request; 301 (permanent redirect) and 302 (found) doesn't change the method most of the time, though older user-agents may (so you basically don't know).
... header type response header forbidden header name no syntax location: <url> directives <url> a relative (to the
request url) or absolute url.
Proxy-Authorization - HTTP
the http proxy-authorization
request header contains the credentials to authenticate a user agent to a proxy server, usually after the server has responded with a 407 proxy authentication required status and the proxy-authenticate header.
... header type
request header forbidden header name no syntax proxy-authorization: <type> <credentials> directives <type> authentication type.
Save-Data - HTTP
the save-data header field is a boolean which, in
requests, indicates the client's preference for reduced data usage.
... with save-data: on
request: get /image.jpg http/1.0 host: example.com save-data: on response: http/1.0 200 ok content-length: 102832 vary: accept-encoding, save-data cache-control: public, max-age=31536000 content-type: image/jpeg [...] without save-data
request: get /image.jpg http/1.0 host: example.com response: http/1.0 200 ok content-length: 481770 vary: accept-encoding, save-data cache-control: public, max-...
Sec-Fetch-Mode - HTTP
the sec-fetch-mode fetch metadata header indicates the
request's mode.
... header type fetch metadata
request header forbidden header name yes, since it has prefix sec- cors-safelisted
request header syntax sec-fetch-mode: cors sec-fetch-mode: navigate sec-fetch-mode: nested-navigate sec-fetch-mode: no-cors sec-fetch-mode: same-origin sec-fetch-mode: websocket values cors navigate nested-navigate no-cors same-origin websocket examples todo specifications specification title fetch metadata
request headers the sec-fetch-mode http
request header ...
Server - HTTP
the server header describes the software used by the origin server that handled the
request — that is, the server that generated the response.
... header type response header forbidden header name no syntax server: <product> directives <product> the name of the software or product that handled the
request.
Strict-Transport-Security - HTTP
the http strict transport security header informs the browser that it should never load a site using http and should automatically convert all attempts to access the site using http to https
requests instead.
...unfortunately, the access point you're using is actually a hacker's laptop, and they're intercepting your original http
request and redirecting you to a clone of your bank's site instead of the real thing.
TE - HTTP
the te
request header specifies the transfer encodings the user agent is willing to accept.
... header type
request header forbidden header name yes syntax te: compress te: deflate te: gzip te: trailers // multiple directives, weighted with the quality value syntax: te: trailers, deflate;q=0.5 directives compress a format using the lempel-ziv-welch (lzw) algorithm is accepted as a transfer coding name.
Trailer - HTTP
the te
request header needs to be set to "trailers" to allow trailer fields.
...these header fields are disallowed: message framing headers (e.g., transfer-encoding and content-length), routing headers (e.g., host),
request modifiers (e.g., controls and conditionals, like cache-control, max-forwards, or te), authentication headers (e.g., authorization or set-cookie), or content-encoding, content-type, content-range, and trailer itself.
Transfer-Encoding - HTTP
when present on a response to a head
request that has no body, it indicates the value that would have applied to the corresponding get message.
... examples chunked encoding chunked encoding is useful when larger amounts of data are sent to the client and the total size of the response may not be known until the
request has been fully processed.
User-Agent - HTTP
the user-agent
request header is a characteristic string that lets servers and network peers identify the application, operating system, vendor, and/or version of the
requesting user agent.
... header type
request header forbidden header name no syntax user-agent: <product> / <product-version> <comment> common format for web browsers: user-agent: mozilla/5.0 (<system-information>) <platform> (<platform-details>) <extensions> directives <product> a product identifier — its name or development codename.
Vary - HTTP
the vary http response header determines how to match future
request headers to decide whether a cached response can be used rather than
requesting a fresh one from the origin server.
... directives * each
request for a url is supposed to be treated as a unique and uncacheable
request.
Via - HTTP
the via general header is added by proxies, both forward and reverse proxies, and can appear in the
request headers and the response headers.
... it is used for tracking message forwards, avoiding
request loops, and identifying the protocol capabilities of senders along the
request/response chain.
X-Content-Type-Options - HTTP
note: x-content-type-options only apply
request-blocking due to nosniff for
request destinations of "script" and "style".
... header type response header forbidden header name no syntax x-content-type-options: nosniff directives nosniff blocks a
request if the
request destination is of type: "style" and the mime type is not text/css, or "script" and the mime type is not a javascript mime type enables cross-origin read blocking (corb) protection for the mime-types: text/html text/plain text/json, application/json or any other type with a json extension: */*+json text/xml, application/xml or any other type with an xml extension: */*+xml (excluding image/svg+xml) specifications specification status comment ...
X-DNS-Prefetch-Control - HTTP
description dns
requests are very small in terms of bandwidth, but latency can be quite high, especially on mobile networks.
...if the domain names for images can be resolved in advance of the images being
requested, pages that load many images can see an improvement of 5% or more in the time of loading images.
X-Forwarded-For - HTTP
to see the original ip address of the client, the x-forwarded-for
request header is used.
... header type
request header forbidden header name no syntax x-forwarded-for: <client>, <proxy1>, <proxy2> directives <client> the client ip address <proxy1>, <proxy2> if a
request goes through multiple proxies, the ip addresses of each successive proxy is listed.
X-Forwarded-Proto - HTTP
to determine the protocol used between the client and the load balancer, the x-forwarded-proto
request header can be used.
... header type
request header forbidden header name no syntax x-forwarded-proto: <protocol> directives <protocol> the forwarded protocol (http or https).
CONNECT - HTTP
the http connect method starts two-way communications with the
requested resource.
...
request has body no successful response has body yes safe no idempotent no cacheable no allowed in html forms no syntax connect www.example.com:443 http/1.1 example some proxy servers might need authority to create a tunnel.
DELETE - HTTP
the http delete
request method deletes the specified resource.
...
request has body may successful response has body may safe no idempotent yes cacheable no allowed in html forms no syntax delete /file.html http/1.1 example
request delete /file.html http/1.1 responses if a delete method is successfully applied, there are several response status codes possible: a 202 (accepted) status code if the action will likely succeed but has not yet been enacted.
HTTP Public Key Pinning (HPKP) - HTTP
the following commands will help you extract the base64 encoded information from a key file, a certificate signing
request, or a certificate.
... openssl rsa -in my-rsa-key-file.key -outform der -pubout | openssl dgst -sha256 -binary | openssl enc -base64 openssl ec -in my-ecc-key-file.key -outform der -pubout | openssl dgst -sha256 -binary | openssl enc -base64 openssl req -in my-signing-
request.csr -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 openssl x509 -in my-certificate.crt -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 the following command will extract the base64 encoded information for a website.
100 Continue - HTTP
the http 100 continue informational status response code indicates that everything so far is ok and that the client should continue with the
request or ignore it if it is already finished.
... to have a server check the
request's headers, a client must send expect: 100-continue as a header in its initial
request and receive a 100 continue status code in response before sending the body.
204 No Content - HTTP
the http 204 no content success status response code indicates that the
request has succeeded, but that the client doesn't need to go away from its current page.
... the common use case is to return 204 as a result of a put
request, updating a resource, without changing the current content of the page displayed to the user.
206 Partial Content - HTTP
the http 206 partial content success status response code indicates that the
request has succeeded and has the body contains the
requested ranges of data, as described in the range header of the
request.
...--string_separator content-type: application/pdf content-range: bytes 4590-7999/8000 ...the second range --string_separator-- specifications specification title rfc 7233, section 4.1: 206 partial content hypertext transfer protocol (http/1.1): range
requests ...
301 Moved Permanently - HTTP
the hypertext transfer protocol (http) 301 moved permanently redirect status response code indicates that the resource
requested has been definitively moved to the url given by the location headers.
... status 301 moved permanently example client
request get /index.php http/1.1 host: www.example.org server response http/1.1 301 moved permanently location: http://www.example.org/index.asp specifications specification title rfc 7231, section 6.4.2: 301 moved permanently hypertext transfer protocol (http/1.1): semantics and content ...
308 Permanent Redirect - HTTP
the hypertext transfer protocol (http) 308 permanent redirect redirect status response code indicates that the resource
requested has been definitively moved to the url given by the location headers.
... the
request method and the body will not be altered, whereas 301 may incorrectly sometimes be changed to a get method.
402 Payment Required - HTTP
sometimes, this code indicates that the
request can not be processed until the client makes a payment.
... originally it was created to enable digital cash or (micro) payment systems and would indicate that the
requested content is not available until the client makes a payment.
409 Conflict - HTTP
the http 409 conflict response status code indicates a
request conflict with current state of the server.
... conflicts are most likely to occur in response to a put
request.
414 URI Too Long - HTTP
the http 414 uri too long response status code indicates that the uri
requested by the client is longer than the server is willing to interpret.
... there are a few rare conditions when this might occur: when a client has improperly converted a post
request to a get
request with long query information, when the client has descended into a loop of redirection (for example, a redirected uri prefix that points to a suffix of itself), or when the server is under attack by a client attempting to exploit potential security holes.
415 Unsupported Media Type - HTTP
the http 415 unsupported media type client error response code indicates that the server refuses to accept the
request because the payload format is in an unsupported format.
... the format problem might be due to the
request's indicated content-type or content-encoding, or as a result of inspecting the data directly.
416 Range Not Satisfiable - HTTP
the hypertext transfer protocol (http) 416 range not satisfiable error response code indicates that a server cannot serve the
requested ranges.
... status 416 range not satisfiable specifications specification title rfc 7233, section 4.4: 416
request not satisfiable hypertext transfer protocol (http/1.1): range
requests ...
422 Unprocessable Entity - HTTP
the hypertext transfer protocol (http) 422 unprocessable entity response status code indicates that the server understands the content type of the
request entity, and the syntax of the
request entity is correct, but it was unable to process the contained instructions.
... important: the client should not repeat this
request without modification.
451 Unavailable For Legal Reasons - HTTP
the hypertext transfer protocol (http) 451 unavailable for legal reasons client error response code indicates that the user
requested a resource that is not available due to legal reasons, such as a web page for which a legal action has been issued.
... http/1.1 451 unavailable for legal reasons link: <https://spqr.example.org/legislatione>; rel="blocked-by" content-type: text/html <html> <head><title>unavailable for legal reasons</title></head> <body> <h1>unavailable for legal reasons</h1> <p>this
request may not be serviced in the roman province of judea due to the lex julia majestatis, which disallows access to resources hosted on servers deemed to be operated by the people's front of judea.</p> </body> </html> specifications specification title rfc 7725: 451 unavailable for legal reasons an http status code to report legal obsta...
500 Internal Server Error - HTTP
the hypertext transfer protocol (http) 500 internal server error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the
request.
...sometimes, server administrators log error responses like the 500 status code with more details about the
request to prevent the error from happening again in the future.
510 Not Extended - HTTP
in that specification a client may send a
request that contains an extension declaration, that describes the extension to be used.
... if the server receives such a
request, but any described extensions are not supported for the
request, then the server responds with the 510 status code.
Equality comparisons and sameness - JavaScript
object.defineproperty(number, 'negative_zero', { value: -0, writable: false, configurable: false, enumerable: false }); function attemptmutation(v) { object.defineproperty(number, 'negative_zero', { value: v }); } object.defineproperty will throw an exception when attempting to change an immutable property, but it does nothing if no actual change is
requested.
... if v is -0, no change has been
requested, and no error will be thrown.
Concurrency model and the event loop - JavaScript
in the example below, the message ''this is just a message'' will be written to the console before the message in the callback gets processed, because the delay is the minimum time required for the runtime to process the
request (not a guaranteed time).
...handling i/o is typically performed via events and callbacks, so when the application is waiting for an indexeddb query to return or an xhr
request to return, it can still process other things like user input.
Date.prototype.toLocaleDateString() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...string('fa-ir')); // → "۱۳۹۱/۹/۳۰" // arabic in most arabic speaking countries uses real arabic digits console.log(date.tolocaledatestring('ar-eg')); // → "٢٠/١٢/٢٠١٢" // for japanese, applications may want to use the japanese calendar, // where 2012 was the year 24 of the heisei era console.log(date.tolocaledatestring('ja-jp-u-ca-japanese')); // → "24/12/20" // when
requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(date.tolocaledatestring(['ban', 'id'])); // → "20/12/2012" using options the results provided by tolocaledatestring() can be customized using the options argument: var date = new date(date.utc(2012, 11, 20, 3, 0, 0)); //
request a weekday along with a long date var...
Date.prototype.toLocaleString() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...오후 12:00:00" // arabic in most arabic speaking countries uses real arabic digits console.log(date.tolocalestring('ar-eg')); // → "٢٠/١٢/٢٠١٢ ٥:٠٠:٠٠ ص" // for japanese, applications may want to use the japanese calendar, // where 2012 was the year 24 of the heisei era console.log(date.tolocalestring('ja-jp-u-ca-japanese')); // → "24/12/20 12:00:00" // when
requesting a language that may not be supported, such as // balinese, include a fallback language (in this case, indonesian) console.log(date.tolocalestring(['ban', 'id'])); // → "20/12/2012 11.00.00" using options the results provided by tolocalestring() can be customized using the options argument: let date = new date(date.utc(2012, 11, 20, 3, 0, 0)); //
request a weekday along with a long date ...
Date.prototype.toLocaleTimeString() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
... // → "7:00:00 pm" // british english uses 24-hour time without am/pm console.log(date.tolocaletimestring('en-gb')); // → "03:00:00" // korean uses 12-hour time with am/pm console.log(date.tolocaletimestring('ko-kr')); // → "오후 12:00:00" // arabic in most arabic speaking countries uses real arabic digits console.log(date.tolocaletimestring('ar-eg')); // → "٧:٠٠:٠٠ م" // when
requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(date.tolocaletimestring(['ban', 'id'])); // → "11.00.00" using options the results provided by tolocaletimestring() can be customized using the options argument: var date = new date(date.utc(2012, 11, 20, 3, 0, 0)); // an application may want to use utc and make th...
FinalizationRegistry - JavaScript
a finalizationregistry object lets you
request a callback when an object is garbage-collected.
... description finalizationregistry provides a way to
request that a cleanup callback get called at some point when an object registered with the registry has been reclaimed (garbage-collected).
Intl.DateTimeFormat() constructor - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...implementations are required to support at least the following subsets: weekday, year, month, day, hour, minute, second weekday, year, month, day year, month, day year, month month, day hour, minute, second hour, minute implementations may support other subsets, and
requests will be negotiated against all available subset-representation combinations to find the best match.
Intl.DateTimeFormat - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...19." // arabic in most arabic speaking countries uses real arabic digits console.log(new intl.datetimeformat('ar-eg').format(date)); // → "١٩/١٢/٢٠١٢" // for japanese, applications may want to use the japanese calendar, // where 2012 was the year 24 of the heisei era console.log(new intl.datetimeformat('ja-jp-u-ca-japanese').format(date)); // → "24/12/19" // when
requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(new intl.datetimeformat(['ban', 'id']).format(date)); // → "19/12/2012" using options the date and time formats can be customized using the options argument: var date = new date(date.utc(2012, 11, 20, 3, 0, 0, 200)); //
request a weekday along with a long date var ...
Number.prototype.toExponential() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
... if a number has more digits than
requested by the fractiondigits parameter, the number is rounded to the nearest number represented by fractiondigits digits.
Promise() constructor - JavaScript
if you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...reject) => { // do something asynchronous which eventually calls either: // // resolve(somevalue) // fulfilled // or // reject("failure reason") // rejected }); making functions return a promise to provide a function with promise functionality, have it return a promise: function myasyncfunction(url) { return new promise((resolve, reject) => { const xhr = new xmlhttp
request() xhr.open("get", url) xhr.onload = () => resolve(xhr.responsetext) xhr.onerror = () => reject(xhr.statustext) xhr.send() }); } specifications specification ecmascript (ecma-262)the definition of 'promise constructor' in that specification.
WebAssembly.Memory() constructor - JavaScript
however, the engine may ignore or clamp this reservation
request.
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
encodeURI() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull
request.
...codeuri(set2)); // -_.!~*'() console.log(encodeuri(set3)); // abc%20abc%20123 (the space gets encoded as %20) console.log(encodeuricomponent(set1)); // %3b%2c%2f%3f%3a%40%26%3d%2b%24%23 console.log(encodeuricomponent(set2)); // -_.!~*'() console.log(encodeuricomponent(set3)); // abc%20abc%20123 (the space gets encoded as %20) note that encodeuri() by itself cannot form proper http get and post
requests, such as for xmlhttp
request, because "&", "+", and "=" are not encoded, which are treated as special characters in get and post
requests.
import - JavaScript
let module = await import('/modules/my-module.js'); examples standard import the code below shows how to import from a secondary module to assist in processing an ajax json
request.
... the module: file.js function getjson(url, callback) { let xhr = new xmlhttp
request(); xhr.onload = function () { callback(this.responsetext) }; xhr.open('get', url, true); xhr.send(); } export function getusefulcontents(url, callback) { getjson(url, data => callback(json.parse(data))); } the main program: main.js import { getusefulcontents } from '/modules/file.js'; getusefulcontents('http://www.example.com', data => { dosomethinguseful(data); }); dynamic import this example shows how to load functionality on to a page based on a user action, in this case a button click, and then call a function within that module.
Recommended Web Performance Timings: How long is too long? - Web Performance
a second should be considered a rule in the maximum amount of time to indicate to a user that the
request for new content was made and will load, such as the browser displaying the page title and the background color of the page displaying.
... the first asset retrieved from a
request is usually an html document, which then makes calls for additional assets.
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
it provides waterfall charts for every asset served by the host and cdn as well as every third party asset and asset
requests generated by all third party scripts, such as ads and analytic services.
...generally, a third party script injects a script on each page to measure and report back on page load data for every
request made.
Privacy, permissions, and information security
keeping personal data safe managing site permissions bringing it all together <using feature policy with permissions and so forth; how to use them together, how they interact, etc> permission
requests in <iframe> elements things can get tricky when your web app uses the <iframe> element to embed content from another site inside your own, especially if the document you load into the frame has its own permission needs to consider.
...for example, in firefox 73, the user permission
requests were revised so that when an <iframe> uses the allow keyword to delegate permission to the embeded document, the browser asks the user to grant the parent document permission to use the resource, and that permission is then shared with the embedded content that
requested the resource to begin with.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
request permission to show a notification, we have to
request permission to do so first.
... instead of showing the notification immediately though, best practice dictates that we should show the popup when the user
requests it by clicking on a button: var button = document.getelementbyid("notifications"); button.addeventlistener('click', function(e) { notification.
requestpermission().then(function(result) { if(result === 'granted') { randomnotification(); } }); }); this shows a popup using the operating system’s own notifications service: when the user confirms to receive notifications, the app can then show them.
The building blocks of responsive design - Progressive web apps (PWAs)
some ideas follow, which also help to keep the number of http
requests down — another key factor in mobile app performance: you should try to use css3 features to programmatically generate graphical effects where possible, rather than relying on image files.
... using web fonts for displaying icons is an effective technique for keeping file size and http
requests down, and this is supported well across modern and older browsers.
Certificate Transparency - Web security
this can be accomplished via a number of different mechanisms: x.509v3 certificate extension which embeds signed certificate timestamps directly into the leaf certificate a tls extension of type signed_certificate_timestamp sent during the handshake ocsp stapling (that is, the status_
request tls extension) and providing a signedcertificatetimestamplist with one or more scts with the x.509 certificate extension, the included scts are decided by the issuing ca.
... the expect-ct header can be used to
request that a browser always enforces the requirement for certificate transparency (e.g.
Referer header: privacy and security concerns - Web security
the referrer problem the referer (sic) header contains the address of the previous web page from which a link to the currently
requested page was followed, which has lots of fairly innocent uses including analytics, logging, or optimized caching.
... security-conscious server-side frameworks tend to have built in mitigations for such problems, for example: security in django (especially see cross site
request forgery (csrf) protection).
Transport Layer Security - Web security
clients that reconnect to the server can send
requests immediately, eliminating the latency of the tls handshake entirely.
...some web servers use renegotiation to either ensure that client certificates are encrypted, or to
request client certificates only when certain resources are
requested.
Basic Example - XSLT: Extensible Stylesheet Language Transformations
t="@company" /> </b> </xsl:if> <br /> </xsl:template> <xsl:template match="myns:body"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> the example loads using synchronous xmlhttp
request both the .xsl (xslstylesheet) and the .xml (xmldoc) files into memory.
... figure 6 : example var xslstylesheet; var xsltprocessor = new xsltprocessor(); var mydom; var xmldoc; function init(){ // load the xslt file, example1.xsl var myxmlhttp
request = new xmlhttp
request(); myxmlhttp
request.open("get", "example1.xsl", false); myxmlhttp
request.send(null); xslstylesheet = myxmlhttp
request.responsexml; xsltprocessor.importstylesheet(xslstylesheet); // load the xml file, example1.xml myxmlhttp
request = new xmlhttp
request(); myxmlhttp
request.open("get", "example1.xml", false); myxmlhttp
request.send(null); xmldoc = myxmlhttpre...
JavaScript/XSLT Bindings - XSLT: Extensible Stylesheet Language Transformations
this can be done via xmlhttp
request or xmldocument.load().
... figure 1 : instantiating an xsltprocessor var xsltprocessor = new xsltprocessor(); // load the xsl file using synchronous (third param is set to false) xmlhttp
request var myxmlhttp
request = new xmlhttp
request(); myxmlhttp
request.open("get", "example.xsl", false); myxmlhttp
request.send(null); var xslref = myxmlhttp
request.responsexml; // finally import the .xsl xsltprocessor.importstylesheet(xslref); for the actual transformation, xsltprocessor requires an xml document, which is used in conjunction with the imported xsl file to produce the final result.
Testing the Add-on SDK - Archive of obsolete content
with travis if you merely make a pull
request for the mozilla/addon-sdk then all of the jpm tests mentioned above will be run on travis-ci automatically and you will see the pass/fail results with a link to the log in the github pull
request.
core/promise - Archive of obsolete content
lets see the implementation of readasync that we used in several of the examples above: const { defer } = require('sdk/core/promise'); function readasync(url) { var deferred = defer(); let xhr = new xmlhttp
request(); xhr.open("get", url, true); xhr.onload = function() { deferred.resolve(xhr.responsetext); }; xhr.onerror = function(event) { deferred.reject(event); }; xhr.send(); return deferred.promise; } so defer returns an object that contains a promise and two resolve, reject functions that can be used to resolve / reject that promise.
dev/panel - Archive of obsolete content
if an actor can send notifications, as in the
request/reply/notify pattern, then the corresponding volcan.js object emits an event, which you can listen for using addeventlistener.
system/events - Archive of obsolete content
var events = require("sdk/system/events"); var { ci } = require("chrome"); function listener(event) { var channel = event.subject.queryinterface(ci.nsihttpchannel); channel.set
requestheader("user-agent", "mybrowser/1.0", false); } events.on("http-on-modify-
request", listener); globals functions emit(type, event) send an event to observer service parameters type : string the event type.
Developing for Firefox Mobile - Archive of obsolete content
rd not supported context-menu not supported hotkeys supported indexed-db supported l10n supported notifications supported page-mod supported page-worker supported panel not supported passwords supported private-browsing not supported querystring supported
request supported selection not supported self supported simple-prefs supported simple-storage supported system supported tabs supported timers supported ui not supported url supported widget not supported windows supported low-level apis /loader suppo...
File I/O - Archive of obsolete content
var file = url.queryinterface(components.interfaces.nsifileurl).file; // file is a nsifile to load from file://, http://, chrome://, resource:// and other urls directly, use xmlhttp
request or netutil.asyncfetch().
Rosetta - Archive of obsolete content
"" : odicts[smimetype](oscript.text); obaton.parentnode.insertbefore(ocompiled, obaton); } function reqerror (oerror) { throw new urierror("the script " + oerror.target.src + " is not accessible."); } function reqsuccess () { createscript(this.refscript, this); } function getsource (oscript) { var oreq = new xmlhttp
request(); oreq.onload = reqsuccess; oreq.onerror = reqerror; oreq.refscript = oscript; oreq.open("get", oscript.src, true); oreq.send(null); } function parsescript (oscript) { if (oscript.hasattribute("type") && !rignoremimes.test(oscript.getattribute("type").tolowercase())) { oscript.hasattribute("src") ?
Sidebar - Archive of obsolete content
resizing the sidebar programmatically in case you need to change the width of the sidebar, use the following code: function setsidebarwidth(newwidth) { var mainwindow = window.queryinterface(components.interfaces.nsiinterface
requestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterface
requestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.document.getelementbyid("sidebar-box").width=newwidth; } or function setsidebarwidth(newwidth) { window.top.document.getelementbyid("si...
XML-related code snippets - Archive of obsolete content
how to create a dom tree using xmlhttp
request parsing and serializing xml using xpath jxon (lossless javascript xml object notation) xsl transforms xlink xinclude xml:id xml:base support in old browsers xpointer svg namespaces, or why http://www.mozilla.org/keymaster/gat...re.is.only.xul is at the top of every xul document.
Displaying web content in an extension without security issues - Archive of obsolete content
so in the simplest case you would have: <iframe type="content" src="data:text/html,%3chtml%3e%3cbody%3e%3c/body%3e%3c/html%3e"/> but usually you don’t want to start with an empty document, you would rather want to load some template into the frame: var
request = new xmlhttp
request();
request.open("get", "chrome://foo/content/template.html", false);
request.send(null); frame.setattribute("src", "data:text/html," + encodeuricomponent(
request.responsetext)); that way you can have the template in your extension but still strip it off all privileges when it is loaded in a frame.
AudioContextOptions - Web APIs
the user agent may or may not choose to meet this
request; check the value of audiocontext.baselatency to determine the true latency after creating the context.
AudioProcessingEvent - Web APIs
'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() {
request = new xmlhttp
request();
request.open('get', 'viper.ogg', true);
request.responsetype = 'arraybuffer';
request.onload = function() { var audiodata =
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); }
request.send(); } // give the node ...
AudioWorkletNode.port - Web APIs
examples to demonstrate bidirectional communication capabilities, we'll create an audioworkletprocessor, which will output silence and respond to ping
requests from its audioworkletnode.
AudioWorkletProcessor.port - Web APIs
examples to demonstrate bidirectional communication capabilities, we'll create an audioworkletprocessor, which will output silence and respond to ping
requests from its audioworkletnode.
AuthenticatorAssertionResponse - Web APIs
the authenticatorassertionresponse interface of the web authentication api is returned by credentialscontainer.get() when a publickeycredential is passed, and provides proof to a service that it has a key pair and that the authentication
request is valid and approved.
BaseAudioContext.createScriptProcessor() - Web APIs
'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() {
request = new xmlhttp
request();
request.open('get', 'viper.ogg', true);
request.responsetype = 'arraybuffer';
request.onload = function() { var audiodata =
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); }
request.send(); } // give the node ...
BaseAudioContext - Web APIs
in this case, the arraybuffer is usually loaded from an xmlhttp
request's response attribute after setting the responsetype to arraybuffer.
BeforeInstallPromptEvent.prompt() - Web APIs
example var istoosoon = true; window.addeventlistener("beforeinstallprompt", function(e) { if (istoosoon) { e.preventdefault(); // prevents prompt display // prompt later instead: settimeout(function() { istoosoon = false; e.prompt(); // throws if called more than once or default not prevented }, 10000); } // the event was re-dispatched in response to our
request // ...
BiquadFilterNode() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
BlobEvent.timecode - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
Bluetooth.getAvailability() - Web APIs
note: user might not allow use of web bluetooth api, even if getavailability() returned true (navigator.bluetooth.
requestdevice() might not resolve with a bluetoothdevice).
characteristic - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
FormData.append() - Web APIs
if the sent value is different than string or blob it will be automatically converted to string: formdata.append('name', true); formdata.append('name', 74); formdata.append('name', 'john'); formdata.getall('name'); // ["true", "74", "john"] specifications specification status comment xmlhttp
requestthe definition of 'append()' in that specification.
FormData.delete() - Web APIs
example the following line creates an empty formdata object and prepopulates it with key/value pairs from a form: var formdata = new formdata(myform); you can delete keys and their values using delete(): formdata.delete('username'); specifications specification status comment xmlhttp
requestthe definition of 'delete()' in that specification.
FormData.entries() - Web APIs
example // create a test formdata object var formdata = new formdata(); formdata.append('key1', 'value1'); formdata.append('key2', 'value2'); // display the key/value pairs for(var pair of formdata.entries()) { console.log(pair[0]+ ', '+ pair[1]); } the result is: key1, value1 key2, value2 specifications specification status comment xmlhttp
requestthe definition of 'entries() (as iterator<>)' in that specification.
FormData.get() - Web APIs
creates an empty formdata object: var formdata = new formdata(); if we add two username values using formdata.append: formdata.append('username', 'chris'); formdata.append('username', 'bob'); the following get() function will only return the first username value appended: formdata.get('username'); // returns "chris" specifications specification status comment xmlhttp
requestthe definition of 'get()' in that specification.
FormData.getAll() - Web APIs
n empty formdata object: var formdata = new formdata(); if we add two username values using formdata.append: formdata.append('username', 'chris'); formdata.append('username', 'bob'); the following getall() function will return both username values in an array: formdata.getall('username'); // returns ["chris", "bob"] specifications specification status comment xmlhttp
requestthe definition of 'getall()' in that specification.
FormData.has() - Web APIs
= new formdata(); the following snippet shows the results of testing for the existence of username in the formdata object, before and after appending a username value to it with formdata.append: formdata.has('username'); // returns false formdata.append('username', 'chris'); formdata.has('username'); // returns true specifications specification status comment xmlhttp
requestthe definition of 'has()' in that specification.
FormData.keys() - Web APIs
example // create a test formdata object var formdata = new formdata(); formdata.append('key1', 'value1'); formdata.append('key2', 'value2'); // display the keys for (var key of formdata.keys()) { console.log(key); } the result is: key1 key2 specifications specification status comment xmlhttp
requestthe definition of 'keys() (as iterator<>)' in that specification.
FormData.set() - Web APIs
urrently empty you can set key/value pairs on this using formdata.set: formdata.set('username', 'chris'); formdata.set('userpic', myfileinput.files[0], 'chris.jpg'); if the sent value is different than string or blob it will be automatically converted to string: formdata.set('name', 72); formdata.get('name'); // "72" specifications specification status comment xmlhttp
requestthe definition of 'set()' in that specification.
FormData.values() - Web APIs
example // create a test formdata object var formdata = new formdata(); formdata.append('key1', 'value1'); formdata.append('key2', 'value2'); // display the values for (var value of formdata.values()) { console.log(value); } the result is: value1 value2 specifications specification status comment xmlhttp
requestthe definition of 'values() (as iterator<>)' in that specification.
FormDataEvent.formData - Web APIs
ntdefault(); // construct a formdata object, which fires the formdata event new formdata(formelem); }); // formdata handler to retrieve data formelem.addeventlistener('formdata', (e) => { console.log('formdata fired'); // get the form data from the event object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit the data via xhr var
request = new xmlhttp
request();
request.open("post", "/formhandler");
request.send(data); }); specifications specification status comment html living standardthe definition of 'formdata' in that specification.
FullscreenOptions - Web APIs
the fullscreenoptions dictionary is used to provide configuration options when calling
requestfullscreen() on an element to place that element into full-screen mode.
GainNode() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
Geolocation - Web APIs
be aware that each browser has its own policies and methods for
requesting this permission.
Geolocation API - Web APIs
the user's operating system will prompt the user to allow location access the first time it is
requested.
GestureEvent - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
PaymentAddress.region - Web APIs
specifications specification status comment payment
request apithe definition of 'paymentaddress.region' in that specification.
PaymentCurrencyAmount.currency - Web APIs
let itemprice = { currency: "usd", value: "42.95" }; specifications specification status comment payment
request apithe definition of 'paymentcurrencyamount.currency' in that specification.
PerformanceNavigationTiming - Web APIs
performancenavigationtiming.
requeststart read only a domhighrestimestamp representing the time immediately before the user agent starts
requesting the resource from the server, or from relevant application caches or from local resources.
PerformanceResourceTiming.connectEnd - Web APIs
ource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "
requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceResourceTiming.connectStart - Web APIs
ar i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "
requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceResourceTiming.domainLookupEnd - Web APIs
ource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "
requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceResourceTiming.domainLookupStart - Web APIs
ar i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "
requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceResourceTiming.fetchStart - Web APIs
ar i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "
requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceResourceTiming.redirectEnd - Web APIs
ar i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "
requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceResourceTiming.redirectStart - Web APIs
ar i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "
requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceResourceTiming.responseEnd - Web APIs
ar i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "
requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceResourceTiming.responseStart - Web APIs
ar i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "
requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceResourceTiming.secureConnectionStart - Web APIs
ar i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "
requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceResourceTiming.workerStart - Web APIs
ar i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "
requeststart", "responsestart", "responseend", "secureconnectionstart", "workerstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceServerTiming - Web APIs
example given a server that sends the server-timing header, for example a node.js server like this: const http = require('http'); function
requesthandler(
request, response) { const headers = { 'server-timing': ` cache;desc="cache read";dur=23.2, db;dur=53, app;dur=47.2 `.replace(/\n/g, '') }; response.writehead(200, headers); response.write(''); return settimeout(_ => { response.end(); }, 1000) }; http.createserver(
requesthandler).listen(3000).on('error', console.error); the performanceservertiming ...
PerformanceTiming.connectStart - Web APIs
the legacy performancetiming.connectstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the
request to open a connection is sent to the network.
PerformanceTiming.fetchStart - Web APIs
the legacy performancetiming.fetchstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, the browser is ready to fetch the document using an http
request.
Permissions API - Web APIs
concepts and usage historically different apis handle their own permissions inconsistently — for example the notifications api allows for explicit checking of permission status and
requesting permission, whereas the geolocation api doesn't (which causes problems if the user denied the initial permission
request).
ScreenOrientation - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
ScriptProcessorNode.bufferSize - Web APIs
button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() {
request = new xmlhttp
request();
request.open('get', 'viper.ogg', true);
request.responsetype = 'arraybuffer';
request.onload = function() { var audiodata =
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); }
request.send(); } // give the node a f...
ScriptProcessorNode.onaudioprocess - Web APIs
'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() {
request = new xmlhttp
request();
request.open('get', 'viper.ogg', true);
request.responsetype = 'arraybuffer';
request.onload = function() { var audiodata =
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); }
request.send(); } // give the node ...
ScriptProcessorNode - Web APIs
button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() {
request = new xmlhttp
request();
request.open('get', 'viper.ogg', true);
request.responsetype = 'arraybuffer';
request.onload = function() { var audiodata =
request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); }
request.send(); } // give the node a f...
Selection.extend() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
Selection.toString() - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
Selection API - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull
request.
Server-sent events - Web APIs
traditionally, a web page has to send a
request to the server to receive new data; that is, the page
requests data from the server.