Search completed in 1.34 seconds.
JSNewResolveOp
jsnew
resolveop is the type of the jsclass.
resolve callback when the jsclass_new_
resolve bit is set in the jsclass.flags field.
... syntax typedef bool (* jsnew
resolveop)(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandleobject objp); name type description cx jscontext * pointer to the js context in which the property access is taking place.
...on success, the
resolve hook must set *objp to the object in which the property has been defined, or null if it was not defined.
...And 14 more matches
JSResolveOp
js
resolveop is the type of the jsclass.
resolve.
... syntax typedef bool (* js
resolveop)(jscontext *cx, js::handleobject obj, js::handleid id, bool *
resolvedp); // added in jsapi 36 typedef bool (* js
resolveop)(jscontext *cx, js::handleobject obj, js::handleid id); // obsolete since jsapi 36 name type description cx jscontext * pointer to the js context in which the property access is taking place.
... id js::handleid the name or index of the property being
resolved.
...And 11 more matches
JS_ResolveStandardClass
resolve a standard class in an object.
... syntax bool js_
resolvestandardclass(jscontext *cx, js::handleobject obj, js::handleid id, bool *
resolved); name type description cx jscontext * pointer to the executable script context for which to initialize js function and object classes.
... obj js::handleobject an object to
resolve id to a standard class.
...And 7 more matches
nsICharsetResolver
intl/chardet/public/nsicharset
resolver.idlscriptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 method overview void notify
resolvedcharset(in acstring charset, in nsisupports closure); acstring requestcharset(in nsiwebnavigation awebnavigation, in nsichannel achannel, out boolean awantcharset, out nsisupports aclosure); methods notify
resolvedcharset() some implementations may request that they be notified when the charset is actually detected.
... void notify
resolvedcharset( in acstring charset, in nsisupports closure ); parameters charset the detected charset.
...And 6 more matches
Document.createNSResolver() - Web APIs
creates an xpathns
resolver which
resolves namespaces with respect to the definitions in scope for a specified node.
... syntax ns
resolver = document.createns
resolver(node); parameters node is the node to be used as a context for namespace resolution.
... return value ns
resolver is an xpathns
resolver object.
...And 6 more matches
Promise.resolve() - JavaScript
the promise.
resolve() method returns a promise object that is
resolved with a given value.
...a promise that
resolves to a promise that
resolves to something) into a single layer.
... syntax promise.
resolve(value); parameters value argument to be
resolved by this promise.
...And 6 more matches
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
the intl.displaynames.prototype.
resolvedoptions() method returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current displaynames object.
... syntax displaynames.
resolvedoptions() return value an object with properties reflecting the locale and formatting options computed during the construction of the given displaynames object.
... description the object returned by
resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used.
...And 2 more matches
XPathEvaluator.createNSResolver() - Web APIs
this method adapts any dom node to
resolve namespaces so that an xpath expression can be easily evaluated relative to the context of the node where it appeared within the document.
... syntax xpathns
resolver xpathevaluator.createns
resolver(node
resolver); parameters node
resolver a node to be used as a context for namespace resolution.
... return value an xpathns
resolver object which
resolves namespaces with respect to the definitions in scope for a specified node.
... specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathevaluator.createns
resolver()' in that specification.
XPathNSResolver - Web APIs
the xpathns
resolver interface permits prefix strings in an xpath expression to be properly bound to namespace uri strings.
... the xpathevaluator interface can construct an implementation of xpathns
resolver from a node, or the interface may be implemented by any application.
... methods xpathns
resolver.lookupnamespaceuri() looks up the namespace uri associated to the given namespace prefix.
... specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathns
resolver' in that specification.
Intl.Collator.prototype.resolvedOptions() - JavaScript
the intl.collator.prototype.
resolvedoptions() method returns a new object with properties reflecting the locale and collation options computed during initialization of this collator object.
... syntax collator.
resolvedoptions() return value a new object with properties reflecting the locale and collation options computed during the initialization of the given collator object.
... examples using the
resolvedoptions method var de = new intl.collator('de', { sensitivity: 'base' }) var usedoptions = de.
resolvedoptions(); usedoptions.locale; // "de" usedoptions.usage; // "sort" usedoptions.sensitivity; // "base" usedoptions.ignorepunctuation; // false usedoptions.collation; // "default" usedoptions.numeric; // false specifications specificatio...
...n ecmascript internationalization api (ecma-402)the definition of 'intl.collator.prototype.
resolvedoptions' in that specification.
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
the intl.datetimeformat.prototype.
resolvedoptions() method returns a new object with properties reflecting the locale and date and time formatting options computed during initialization of this datetimeformat object.
... syntax datetimeformat.
resolvedoptions() return value a new object with properties reflecting the locale and date and time formatting options computed during the initialization of the given datetimeformat object.
... examples using the
resolvedoptions method var germanfakeregion = new intl.datetimeformat('de-xx', { timezone: 'utc' }); var usedoptions = germanfakeregion.
resolvedoptions(); usedoptions.locale; // "de" usedoptions.calendar; // "gregory" usedoptions.numberingsystem; // "latn" usedoptions.timezone; // "utc" usedoptions.month; // "numeric" specifications specification ec...
...mascript internationalization api (ecma-402)the definition of 'intl.datetimeformat.prototype.
resolvedoptions' in that specification.
Intl.ListFormat.prototype.resolvedOptions() - JavaScript
the intl.listformat.prototype.
resolvedoptions() method returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current listformat object.
... syntax listformat.
resolvedoptions() return value an object with properties reflecting the locale and formatting options computed during the construction of the given listformat object.
... description the object returned by
resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used.
... examples using
resolvedoptions const delistformatter = new intl.listformat("de-de", { style: "short" }); const usedoptions = de.
resolvedoptions(); console.log(usedoptions.locale); // "de-de" console.log(usedoptions.style); // "short" console.log(usedoptions.type); // "conjunction" (the default value) specifications specification intl.listformatthe definition of '
resolvedoptions()' in that ...
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
the intl.numberformat.prototype.
resolvedoptions() method returns a new object with properties reflecting the locale and number formatting options computed during initialization of this numberformat object.
... syntax numberformat.
resolvedoptions() return value a new object with properties reflecting the locale and number formatting options computed during the initialization of the given numberformat object.
... examples using the
resolvedoptions method var de = new intl.numberformat('de-de'); var usedoptions = de.
resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.numberingsystem; // "latn" usedoptions.notation; // "standard" usedoptions.signdisplay; // "auto" usedoption.style; // "decimal" usedoptions.minimumintegerdigits; // 1 usedoptions.minimumfractiond...
...igits; // 0 usedoptions.maximumfractiondigits; // 3 usedoptions.usegrouping; // true specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.numberformat.prototype.
resolvedoptions' in that specification.
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
the intl.pluralrules.prototype.
resolvedoptions() method returns a new object with properties reflecting the locale and plural formatting options computed during initialization of this pluralrules object.
... syntax pluralrule.
resolvedoptions() return value a new object with properties reflecting the locale and plural formatting options computed during the initialization of the given pluralrules object.
... examples using the
resolvedoptions method var de = new intl.pluralrules('de-de'); var usedoptions = de.
resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.maximumfractiondigits; // 3 usedoptions.minimumfractiondigits; // 0 usedoptions.minimumintegerdigits; // 1 usedoptions.pluralcategories; // array [ "one", "other" ] usedoptions.type; // "cardinal" specifications ...
... specification ecmascript internationalization api (ecma-402)the definition of 'intl.pluralrules.prototype.
resolvedoptions' in that specification.
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
the intl.relativetimeformat.prototype.
resolvedoptions() method returns a new object with properties reflecting the locale and relative time formatting options computed during initialization of this relativetimeformat object.
... syntax relativetimeformat.
resolvedoptions() return value a new object with properties reflecting the locale and number formatting options computed during the initialization of the given relativetimeformat object.
... examples using the
resolvedoptions method var de = new intl.relativetimeformat('de-de'); var usedoptions = de.
resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.style; // "long" usedoptions.numeric; // "always" usedoptions.numberingsystem; // "latn" specifications specification status comment ecmascript internationalization api (ecma-402)the definition of '...
...relativetimeformat.
resolvedoptions()' in that specification.
JS_EnumerateResolvedStandardClasses
enumerate any already-
resolved standard class ids.
... syntax jsidarray * js_enumerate
resolvedstandardclasses(jscontext *cx, jsobject *obj, jsidarray *ida); name type description description js_enumerate
resolvedstandardclasses enumerates any already-
resolved standard class ids into ida, or into a new jsidarray if ida is null.
... see also js_enumerate
resolvedstandardclasses bug 884410 ...
XPathNSResolver.lookupNamespaceURI() - Web APIs
syntax domstring xpathns
resolver.lookupnamespaceuri(prefix); parameters prefix a domstring representing the prefix to look for.
... specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathns
resolver.lookupnamespaceuri()' in that specification.
Resolved value - CSS: Cascading Style Sheets
the
resolved value of a css property is the value returned by getcomputedstyle().
... specifications specification status comment css object model (cssom)the definition of '
resolved value' in that specification.
Index - Web APIs
68 animation.finished api, animation, experimental, property, reference, web animations, finished, web animations api the animation.finished read-only property of the web animations api returns a promise which
resolves once the animation has finished playing.
... 77 animation.ready api, animation, experimental, property, ready, ready promise, reference, web animations, web animations api the read-only animation.ready property of the web animations api returns a promise which
resolves when the animation is ready to play.
...this will be un
resolved if the animation was idle at the time the event was generated.
...And 101 more matches
Introduction to using XPath in JavaScript - XPath
var xpathresult = document.evaluate( xpathexpression, contextnode, namespace
resolver, resulttype, result ); parameters the evaluate function takes a total of five parameters: xpathexpression: a string containing the xpath expression to be evaluated.
... namespace
resolver: a function that will be passed any namespace prefixes contained within xpathexpression which returns a string representing the namespace uri associated with that prefix.
...the function can be either: created by using the createns
resolver method of a xpathevaluator object.
...And 22 more matches
nsIProtocolProxyService
to access the service use: var pps = components.classes["@mozilla.org/network/protocol-proxy-service;1"] .getservice(components.interfaces.nsiprotocolproxyservice); method overview deprecated since gecko 18 nsiproxyinfo
resolve(in nsiuri auri, in unsigned long aflags); nsicancelable async
resolve(in nsiuri auri, in unsigned long aflags,in nsiprotocolproxycallback acallback); nsiproxyinfo newproxyinfo(in acstring atype, in autf8string ahost,in long aport, in unsigned long aflags, in unsigned long afailovertimeout, in nsiproxyinfo afailoverproxy); nsiproxyinfo getfailoverforproxy(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.
...so, calling
resolve without this flag may result in locking up the calling thread for a lengthy period of time.
...And 18 more matches
Promise - JavaScript
you will also hear the term
resolved used with promises — this means that the promise is settled or “locked in” to match the state of another promise.
...any termination other than a throw creates a "
resolved" state, while terminating with a throw creates a "rejected" state.
... static methods promise.all(iterable) wait for all promises to be
resolved, or for any to be rejected.
...And 17 more matches
core/promise - Archive of obsolete content
this object is a promise, both figuratively and by name, to eventually
resolve.
... propagation the then method of a promise returns a new promise that is
resolved with the return value of either handler.
...}); in this example bar is a promise and it's fulfilled by one of two handlers that are responsible for: if handler returns a value, bar will be
resolved with it.
...And 14 more matches
Promise.prototype.then() - JavaScript
if a handler function: returns a value, the promise returned by then gets
resolved with the returned value as its value.
... doesn't return anything, the promise returned by then gets
resolved with an undefined value.
...also, the
resolved value of the promise returned by then will be the same as the
resolved value of the promise returned by the handler.
...And 14 more matches
nsIDNSService
method overview nsicancelable async
resolve(in autf8string ahostname, in unsigned long aflags, in nsidnslistener alistener, in nsieventtarget alistenertarget); void init(); obsolete since gecko 1.8 nsidnsrecord
resolve(in autf8string ahostname, in unsigned long aflags); void shutdown(); obsolete since gecko 1.8 attributes attribute type description myhostname autf8string read o...
... constants
resolve flag constants various flags that may be ored together to form the aflags parameter passed to async
resolve() and
resolve().
... constant value description
resolve_bypass_cache (1 << 0) this flag suppresses the internal dns lookup cache.
...And 13 more matches
Using Service Workers - Web APIs
when the promise
resolves, the code inside then will be run, asynchronously.
... const imgload = (url) => { return new promise((
resolve, reject) => { var request = new xmlhttprequest(); 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 w...
...as 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 12 more matches
/loader - Archive of obsolete content
resolve: provide customized module resolution logic.
...there are lots of different possibilities, but the most common setup looks like this: let { loader } = require('toolkit/loader'); let loader = loader({ paths: { //
resolve all modules starting with `toolkit/` as follows: // toolkit/foo -> resource://gre/modules/commonjs/toolkit/foo.js // toolkit/foo/bar -> resource://gre/modules/commonjs/toolkit/foo/bar.js 'toolkit/': 'resource://gre/modules/commonjs/toolkit/', //
resolve all other non-relative module requirements as follows: // devtools/gcli -> resource:///modules/devtools/gcli.js ...
... // panel -> resource:///modules/panel.js '': 'resource:///modules/', } }) all relative url require() statements (those that start with ".") are first
resolved relative to the requirer module id and the result of it is then
resolved using the paths option.
...And 11 more matches
Graceful asynchronous programming with Promises - Learn web development
so instead of waiting for the user, getting the chosen devices enabled, and directly returning the mediastream for the stream created from the selected sources, getusermedia() returns a promise which is
resolved with the mediastream once it's available.
...we're able to chain multiple asynchronous actions to occur one after another this way because each .then() block returns a new promise that
resolves when the .then() block is done running.
... when a promise returns, it is said to be
resolved.
...And 11 more matches
USBDevice - Web APIs
methods usbdevice.claiminterface() returns a promise that
resolves when the requested interface is claimed for exclusive access.
... usbdevice.clearhalt() returns a promise that
resolves when a halt condition is cleared.
... usbdevice.controltransferin() returns a promise that
resolves with a usbtransferinresult when a command or status operation has been transmitted to the usb device.
...And 11 more matches
Promise.all() - JavaScript
the promise.all() method takes an iterable of promises as an input, and returns a single promise that
resolves to an array of the results of the input promises.
... this returned promise will
resolve when all of the input's promises have
resolved, or if the input iterable contains no promises.
... return value an already
resolved promise if the iterable passed is empty.
...And 11 more matches
async function - JavaScript
return value a promise which will be
resolved with the value returned by the async function, or rejected with an exception thrown from, or uncaught within, the async function.
...the
resolved value of the promise is treated as the return value of the await expression.
... for example, the following: async function foo() { return 1 } ...is equivalent to: function foo() { return promise.
resolve(1) } the body of an async function can be thought of as being split by zero or more await expressions.
...And 11 more matches
Download
calling this method when the download has been completed successfully has no effect, and the method returns a
resolved promise.
... promise
resolves to undefined when the download has finished successfully and you can access the target file.
... promise
resolves to undefined when the instruction to launch the file has been successfully given to the operating system.
...And 10 more matches
OS.File for the main thread
return promise.
resolve(true); // loop end.
...this example also shows the
resolve value of open (an instance of os.file, this is a file, so you can do any of the methods on it found here), write (a number indicating bytes written), and close (undefined, meaning there is no
resolve value).
... promise
resolves to an instance of os.file representing the expected file.
...And 10 more matches
Deferred
for example, the equivalent of var deferred = promise.defer(); dosomething(function cb(good) { if (good) deferred.
resolve(); else deferred.reject(); }); return deferred.promise; would be return new promise(function(
resolve, reject) { dosomething(function cb(good) { if (good)
resolve(); else reject(); }); }); method overview void
resolve([optional] avalue); void reject([optional] areason); properties attribute type ...
... methods
resolve() fulfills the associated promise with the specified value, or propagates the state of an existing promise.
... if the associated promise has already been
resolved, either to a value, a rejection, or another promise, this method does nothing.
...And 9 more matches
Bytecode Descriptions
if the current function is an async function or async generator, the frame's return value slot must contain the current frame's result promise, which must already be
resolved or rejected.
... asyncawait stack: value, gen ⇒ promise arrange for this async function to resume asynchronously when value becomes
resolved.
... async
resolve operands: (asyncfunction
resolvekind fulfillorreject) stack: valueorreason, gen ⇒ promise
resolve or reject the current async function's result promise with 'valueorreason'.
...And 9 more matches
What to do and what not to do in Bugzilla
resolving bugs some general rules: when you
resolve a bug, cc yourself so that you are informed when new facts come up.
... resolving bugs as worksforme you can
resolve a bug as worksforme (wfm) if it can't be reproduced on the reported hardware/os.
... you should not
resolve a bug as wfm if: the bug reporter uses a different hardware/operating system (e.g.
...And 8 more matches
nsIDOMXPathEvaluator
to create an instance, use: var domxpathevaluator = components.classes["@mozilla.org/dom/xpath-evaluator;1"] .createinstance(components.interfaces.nsidomxpathevaluator); method overview nsidomxpathexpression createexpression(in domstring expression, in nsidomxpathns
resolver
resolver) nsidomxpathns
resolver createns
resolver(in nsidomnode node
resolver); nsisupports evaluate(in domstring expression, in nsidomnode contextnode, in nsidomxpathns
resolver
resolver, in unsigned short type, in nsisupports result) methods createexpression() creates an nsidomxpathexpression which can then be used for (repeated) evaluations.
... nsidomxpathexpression createexpression( in domstring expression, in nsidomxpathns
resolver
resolver ); parameters expression a string representing the xpath to be created.
...
resolver a name space
resolver created by createns
resolver(), or a user defined name space
resolver.
...And 8 more matches
Sqlite.jsm
openconnection(options) returns a promise that
resolves to an opened connection instance or is rejected if an error occurred while opening the database.
... this function returns a promise that will be
resolved when the database has closed.
... this returns a promise that is
resolved when the operation completes.
...And 7 more matches
Mozilla DOM Hacking Guide
this is used in global
resolve functions, when xpconnect has to find the member function to call.
...for example, getproperty() is used when retrieving an attribute that was not defined in idl, and new
resolve() is used when resolving for the first time an attribute or method that was not previously
resolved.
... nsresult
resolveconstructor(jscontext *cx, jsobject *obj, jsobject **objp);: help me!
...And 7 more matches
Proxy Auto-Configuration (PAC) file - HTTP
(of course, the javascripts must be edited to reflect your site's domain name and/or subnets.) predefined functions and environment these functions can be used in building the pac file: hostname based conditions isplainhostname() dnsdomainis() localhostordomainis() isresolvable() isinnet() related utility functions dns
resolve() convert_addr() myipaddress() dnsdomainlevels() url/hostname based conditions shexpmatch() time based conditions weekdayrange() daterange() timerange() logging utility alert() there was one associative array (object) already defined, because at the time javascript code was unable to define it by itself: proxyconfig.bindings ...
... tries to
resolve the hostname.
...if a hostname is passed, it will be
resolved into an ip address by this function.
...And 7 more matches
Promise.any() - JavaScript
promise.any() takes an iterable of promise objects and, as soon as one of the promises in the iterable fulfils, returns a single promise that
resolves with the value from that promise.
... return value an already
resolved promise if the iterable passed is empty.
... an asynchronously
resolved promise if the iterable passed contains no promises.
...And 7 more matches
Style System Overview - Archive of obsolete content
[design flaw in frame/sc relationship] three functions for creating style contexts on nsistyleset, wrapped by similarly named ones on nsiprescontext:
resolvestylecontextfor: for elements.
...
resolvepseudostylecontextfor: for pseudo-elements (:first-letter, :before, etc.)
resolvestylecontextfornonelement: skips rule matching and uses root rule node (text frame optimization) managing style contexts style context resolving functions will walk the rule processors in stylesetimpl::filerules, find the correct rule node, and find a current child of the parent (“sibling sharing”) or create a new child.
... dynamic changes to content framemanager::re
resolvestylecontext destroys and recreates style contexts for existing frames (rule node pointer immutable).
...And 6 more matches
AsyncShutdown.jsm
phase profilebeforechange is guaranteed to not terminate until promise is either
resolved or rejected.
... if, for some reason, promise is never
resolved/rejected, firefox will crash during shutdown to avoid blocking system shutdown, preventing the user from restarting firefox or burning through a battery.
... in this case, a crash report is produced, with information on all the shutdown blockers that have not been
resolved, and all the additional debug information returned by calls to info().
...And 6 more matches
PromiseWorker.jsm
if any of the arguments is a promise, it is
resolved before posting the message.
...however with promiseworker objects this is no longer the case, simply return data or throw from your function depending if you want to
resolve or reject the promise.
... resolving the promise to
resolve the promise from the worker, simply return anything from the worker scope, and the main thread promise will be
resolved with the returned value.
...And 6 more matches
Recording a media element - Web APIs
function wait(delayinms) { return new promise(
resolve => settimeout(
resolve, delayinms)); } the wait() function returns a new promise which
resolves once the specified number of milliseconds have elapsed.
... starting media recording the startrecording() function handles starting the recording process: function startrecording(stream, lengthinms) { let recorder = new mediarecorder(stream); let data = []; recorder.ondataavailable = event => data.push(event.data); recorder.start(); log(recorder.state + " for " + (lengthinms/1000) + " seconds..."); let stopped = new promise((
resolve, reject) => { recorder.onstop =
resolve; recorder.onerror = event => reject(event.name); }); let recorded = wait(lengthinms).then( () => recorder.state == "recording" && recorder.stop() ); return promise.all([ stopped, recorded ]) .then(() => data); } startrecording() takes two input parameters: a mediastream to record from and the length in milliseconds of the...
... lines 9-12 creates a new promise, named stopped, which is
resolved when the mediarecorder's onstop event handler is called, and is rejected if its onerror event handler is called.
...And 6 more matches
Deferred
method overview void
resolve([optional] avalue); void reject([optional] areason); properties attribute type description promise read only promise a newly created promise, initially in the pending state.
... methods
resolve() fulfills the associated promise with the specified value, or propagates the state of an existing promise.
... if the associated promise has already been
resolved, either to a value, a rejection, or another promise, this method does nothing.
...And 5 more matches
JSClass
syntax struct jsclass { const char *name; uint32_t flags; /* optional since spidermonkey 37 */ jspropertyop addproperty; jsdeletepropertyop delproperty; jspropertyop getproperty; jsstrictpropertyop setproperty; jsenumerateop enumerate; js
resolveop
resolve; jsconvertop convert; /* obsolete since spidermonkey 44 */ /* optional since spidermonkey 25 */ jsfinalizeop finalize; /* optional */ jsclassinternal reserved0; /* obsolete since spidermonkey 13 */ jscheckaccessop checkaccess; /* obsolete since spidermonkey 29 */ jsnative call; jshasinstanceop hasi...
...
resolve js
resolveop hook for implementing lazy properties.
... see jsclass.
resolve for details.
...And 5 more matches
Fetching data from the server - Learn web development
fetch() returns a promise, which
resolves to the response sent back from the server — we use .then() to run some follow-up code after the promise
resolves, which is the function we've defined inside it.
... this function is automatically given the response from the server as a parameter when the fetch() promise
resolves.
... you'll see that text() also returns a promise, so we chain another .then() onto it, inside of which we define a function to receive the raw text that the text() promise
resolves to.
...And 4 more matches
IPDL Tutorial
the first overload will have a
resolve callback and reject callback as its final two parameters; the second overload will not have any additional parameters, but it will return a pprotocol{parent,child}::messagenamepromise, which is a mozpromise.
... the
resolve callback for the first overload as well as the success callback for the mozpromise's then() method each have a single parameter.
...otherfunction above) the parameter is, for both
resolve and success callbacks, the returns value itself (as a const reference); if the message returns multiple values (e.g.
...And 4 more matches
Examples
ason) { alert('mypromise was succesful and reason was = "' + asuccessreason + '"'); }, function(arejectreason) { alert('mypromise failed for reason = "' + uneval(arejectreason) + '"'); } ); function myuserdefinedpromise() { try { //var myvariscommented = 'hi'; // i commented this out s oit is undefined, this will cause rejected alert(myvariscommented); return promise.
resolve('yay success'); // this makes the success function trigger with asuccessreason being 'yay success' but because i commented out the var 2 lines above, it will error out on the alert(myvariscommented) and never get to this success line.
...on(asuccessreason) { alert('mypromise was succesful and reason was = "' + asuccessreason + '"'); }, function(arejectreason) { alert('mypromise failed for reason = "' + uneval(arejectreason) + '"'); } ); function myuserdefinedpromise() { try { var myvariscommented = 'hi'; alert(myvariscommented); throw new error('i feel like rejecting this promise'); return promise.
resolve('yay success'); // this makes the success function trigger with asuccessreason being 'yay success' but because i commented out the var 2 lines above, it will error out on the throw and never get to this success line becuase i throw an error on the line before this } catch(ex) { return promise.reject(ex); } } in this example even though the variable is defined, the proimse is rejected bec...
...asuccessreason) { alert('mypromise was succesful and reason was = "' + asuccessreason + '"'); }, function(arejectreason) { alert('mypromise failed for reason = "' + uneval(arejectreason) + '"'); } ); function myuserdefinedpromise() { try { var myvariscommented = 'hi'; alert(myvariscommented); // throw new error('i feel like rejecting this promise'); return promise.
resolve('yay success'); // this takes place } catch(ex) { return promise.reject(ex); } } you must return `promise.
resolve` in order to make the promise complete successfuly.
...And 4 more matches
Promise
new promise(executor); parameters executor this function is invoked immediately with the resolving functions as its two arguments: executor(
resolve, reject); the constructor will not return until the executor has completed.
... resolving functions
resolve() fulfills the associated promise with the specified value, or propagates the state of an existing promise.
... if the associated promise has already been
resolved, either to a value, a rejection, or another promise, this method does nothing.
...And 4 more matches
nsIXPCScriptable
vp); prbool setproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool enumerate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); prbool newenumerate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pruint32 enum_op, in jsvalptr statep, out jsid idp); prbool new
resolve(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in pruint32 flags, out jsobjectptr objp); prbool convert(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pruint32 type, in jsvalptr vp); void finalize(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); prbool checkaccess(in nsixpconnectwrapp...
... want_new
resolve 1 << 9 indicates that the object wants to have its new
resolve method called.
... want_call 1 << 13 want_construct 1 << 14 want_hasinstance 1 << 15 want_trace 1 << 16 use_jsstub_for_addproperty 1 << 17 use_jsstub_for_delproperty 1 << 18 use_jsstub_for_setproperty 1 << 19 dont_enum_static_props 1 << 20 dont_enum_query_interface 1 << 21 dont_ask_instance_for_scriptable 1 << 22 classinfo_interfaces_only 1 << 23 allow_prop_mods_during_
resolve 1 << 24 allow_prop_mods_to_prototype 1 << 25 dont_share_prototype 1 << 26 dont_reflect_interface_names 1 << 27 want_equality 1 << 28 want_outer_object 1 << 29 want_inner_object 1 << 30 reserved 1 << 31 the high order bit is reserved for consumers of these flags.
...And 4 more matches
Using Promises - JavaScript
read the following example: new promise((
resolve, reject) => { console.log('initial');
resolve(); }) .then(() => { throw new error('something failed'); console.log('do this'); }) .catch(() => { console.error('do that'); }) .then(() => { console.log('do this, no matter what happened before'); }); this will output the following text: initial do that do this, no matter what happened before note: the text do this is n...
...best practice is to wrap problematic functions at the lowest possible level, and then never call them directly again: const wait = ms => new promise(
resolve => settimeout(
resolve, ms)); wait(10*1000).then(() => saysomething("10 seconds")).catch(failurecallback); basically, the promise constructor takes an executor function that lets us
resolve or reject a promise manually.
... composition promise.
resolve() and promise.reject() are shortcuts to manually create an already
resolved or rejected promise respectively.
...And 4 more matches
XPath snippets - XPath
function evaluatexpath(anode, aexpr) { var xpe = new xpathevaluator(); var ns
resolver = xpe.createns
resolver(anode.ownerdocument == null ?
... anode.documentelement : anode.ownerdocument.documentelement); var result = xpe.evaluate(aexpr, anode, ns
resolver, 0, null); var found = []; var res; while (res = result.iteratenext()) found.push(res); return found; } this function uses the new xpathevaluator() constructor, which is supported in firefox, chrome, opera and safari, but not in edge or internet explorer.
... scripts in a web document which might be accessed by edge or internet explorer users should replace the call to new xpathevaluator() with the following fragment: // xpathevaluator is implemented on objects that implement document var xpe = anode.ownerdocument || anode; in that case the creation of the xpathns
resolver can be simplified as: var ns
resolver = xpe.createns
resolver(xpe.documentelement); note however that createns
resolver should only be used if you are sure the namespace prefixes in the xpath expression match those in the document you want to query (and that no default namespace is being used (though see document.createns
resolver for a workaround)).
...And 4 more matches
Modules - Archive of obsolete content
the require function has some extra features not provided by loadscript: it solves the problem of resolving relative urls (which we have left un
resolved), and provides a caching mechanism, so that when the same module is loaded twice, it returns the cached module object rather than triggering another download.
...for instance, the option paths is used to specify a list of paths to be used by the loader to
resolve relative urls: let loader = loader({ paths: ["./": "http://www.foo.com/"] }); commonjs also defines the notion of a main module.
...the way module ids are
resolved can be customized by passing a custom
resolve function as an option.
...And 3 more matches
Promises - Archive of obsolete content
let resp = yield new promise((
resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload =
resolve; xhr.onerror = reject; xhr.open("get", dataurl); xhr.responsetype = "json"; xhr.send(); }); let data = resp.target.response; // use the response to construct form data object for the // second request.
... resp = yield new promise((
resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload =
resolve; xhr.onerror = reject; xhr.open("post", updateurl); xhr.send(form); }); // use the response of the second request.
...the constructor returns a promise which
resolves when the file’s contents have been loaded.
...And 3 more matches
Merging TraceMonkey Repo - Archive of obsolete content
conflicting files can be listed via hg
resolve -l.
...for each un
resolved file (with a u next to it), open the file and find the conflict markers that look like <<<<<<.
... inspecting the files at those two changesets can be helpful: hg cat -c changeset filename once all the conflict markers are removed, you've performed the manual resolution, which you tell to mercurial by running hg
resolve -m filename.
...And 3 more matches
JavaScript-DOM Prototypes in Mozilla
once the registration is done, the nsdomclassinfo code uses the registry every time a named property is
resolved on a global object (because of this, the nsscriptnamespacemanager needs to be pretty fast at looking things up in its registry; that's why it is a hash table).
... when a property is
resolved on the global object, the nsdomclassinfo code will ask the nsscriptnamespacemanager if the name is a known name (in nswindowsh::global
resolve()), and if the name is known, the code will look at the type of the name and act accordingly.
... if a class constructor or class prototype name is
resolved, the class info code will define the constructor for that class, and also define the prototype property of that constructor (i.e.
...And 3 more matches
Promise.jsm
if you need a deferred, because you want to create a promise and manually
resolve or reject it, consider using promiseutils.jsm instead.
... method overview deferred defer(); obsolete since gecko 30 promise
resolve([optional] avalue); promise reject([optional] areason); methods defer() creates a new pending promise and provides methods to
resolve or reject it.
... return value a new object, containing the new promise in the promise property, and the methods to change its state in the
resolve and reject properties.
...And 3 more matches
Task.jsm
every time the task yields a promise, it waits until the promise is
resolved.
... task.spawn() returns a promise that is
resolved when the task completes successfully, or is rejected if an exception occurs.
... you can use the yield operator inside the generator function to wait on a promise, spawn another task, or propagate a value: let resolutionvalue = yield (promise/generator/iterator/value); if you specify a promise, the yield operator returns its resolution value as soon as the promise is
resolved.
...And 3 more matches
Index
127 jsnew
resolveop jsapi reference, obsolete, spidermonkey like js
resolveop, but flags provide contextual information about the property access.
... 150 jsreserveslotsop jsapi reference, obsolete, reference, référence(2), spidermonkey jsclass offers the following hook: 151 js
resolveop jsapi reference, reference, référence(2), spidermonkey js
resolveop callback is a hook which is called when a property is not found on an object.
... 258 js_enumerate
resolvedstandardclasses jsapi reference, obsolete, reference, référence(2), spidermonkey js_enumerate
resolvedstandardclasses enumerates any already-
resolved standard class ids into ida, or into a new jsidarray if ida is null.
...And 3 more matches
JS_LookupProperty
(the javascript engine simply passes these flags through to the object when it calls the object's jsclass.
resolve callback, so objects of a custom jsclass may interpret these flags however they like.) if flags is 0, js_lookuppropertywithflags uses the default lookup rules, the ones used by js_lookupproperty.
... otherwise, flags must be the logical or of one or more of the following bits: js
resolve_qualified behave as though the property name appeared to the right of a dot, as in alert(obj.name).
... js
resolve_assigning behave as though the property name appeared on the left-hand side of an assignment.
...And 3 more matches
CacheStorage - Web APIs
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.
... cachestorage.has() returns a promise that
resolves to true if a cache object matching the cachename exists.
... cachestorage.open() returns a promise that
resolves to the cache object matching the cachename (a new cache is created if it doesn't already exist.) cachestorage.delete() finds the cache object matching the cachename, and if found, deletes the cache object and returns a promise that
resolves to true.
...And 3 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.
... conditions for granting storage access storage access is granted based on a series of checks described here: if the document already has been granted access,
resolve.
... if the document's frame is the main frame,
resolve.
...And 3 more matches
RTCPeerConnection - Web APIs
if it has not yet been set, this is null.peeridentity read only the read-only rtcpeerconnection property peeridentity returns a javascript promise that
resolves to an rtcidentityassertion which contains a domstring identifying the remote peer.pendinglocaldescription read only the read-only property rtcpeerconnection.pendinglocaldescription returns an rtcsessiondescription object describing a pending configuration change for the local end of the connection.
...each rtp receiver manages the reception and decoding of data for a mediastreamtrack on an rtcpeerconnectiongetsenders()the rtcpeerconnection method getsenders() returns an array of rtcrtpsender objects, each of which represents the rtp sender responsible for transmitting one track's data.getstats()the rtcpeerconnection method getstats() returns a promise which
resolves with data providing statistics about either the overall connection or about the specified mediastreamtrack.getstreambyid() the rtcpeerconnection.getstreambyid() method returns the mediastream with the given id that is associated with local or remote end of the connection.
...now, you should instead wait for a the promise returned by peeridentity to
resolve with an identity.
...And 3 more matches
Request - Web APIs
request implements body, so it also has the following methods available to it: body.arraybuffer() returns a promise that
resolves with an arraybuffer representation of the request body.
... body.blob() returns a promise that
resolves with a blob representation of the request body.
... body.formdata() returns a promise that
resolves with a formdata representation of the request body.
...And 3 more matches
Response - Web APIs
it returns a promise that
resolves with an arraybuffer.
...it returns a promise that
resolves with a blob.
...it returns a promise that
resolves with a formdata object.
...And 3 more matches
HTTP logging
press the enter key after each one.: for 64-bit windows: set moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,nshost
resolver:5,cookie:5 set moz_log_file=%temp%\log.txt "c:\program files\mozilla firefox\firefox.exe" for 32-bit windows: set moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,nshost
resolver:5,cookie:5 set moz_log_file=%temp%\log.txt "c:\program files (x86)\mozilla firefox\firefox.exe" (these instructions assume that you installed firefox to the default location, and that drive c: i...
... export moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,nshost
resolver:5,cookie:5 export moz_log_file=/tmp/log.txt cd /path/to/firefox ./firefox reproduce the problem you're debugging.
... export moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,nshost
resolver:5,cookie:5 export moz_log_file=~/desktop/log.txt cd /applications/firefox.app/contents/macos ./firefox-bin (the instructions assume that you've installed firefox directly into your startup disk's applications folder.
...And 2 more matches
Eclipse CDT
this "parse once" strategy can also cause "un
resolved inclusion" errors in headers if the first time eclipse sees the header is while indexing a file for which it doesn't have any build output parser data.
... fixing eclipse bug 381601 would considerably reduce the impact of the "un
resolved inclusion" issue.
... if you are trying to dig into a particular parser errors to figure out what it's about, here are a few things you can try: select your project in the project explorer, then from the context menu select "index > search for un
resolved includes".
...And 2 more matches
DeferredTask.jsm
if the task is running and the timer is armed, then one last execution from start to finish will happen again, immediately after the current execution terminates; then the returned promise will be
resolved.
... if the task is running and the timer is not armed, the returned promise will be
resolved when the current execution terminates.
... if the task is not running and the timer is armed, then the task is started immediately, and the returned promise
resolves when the new execution terminates.
...And 2 more matches
DownloadList
promise
resolves to an array of download objects.
... promise
resolves to undefined when the download has been added.
... promise
resolves to undefined when the download has been removed.
...And 2 more matches
Rhino serialization
upon deserialization the initial object and the objects it refers to are all created and the references between the objects are
resolved.
...we want to be able to serialize a javascript object and then deserialize it into a new scope and have all of the references from the deserialized object to prototypes and parent scopes
resolved correctly to refer to objects in the new scope.
...if in the process of serialization it encounters a reference to the scope it will serialize a marker that will be
resolved to the new scope upon deserialization.
...And 2 more matches
nsICommandLine
method overview long findflag(in astring aflag, in boolean acasesensitive); astring getargument(in long aindex); boolean handleflag(in astring aflag, in boolean acasesensitive); astring handleflagwithparam(in astring aflag, in boolean acasesensitive); void removearguments(in long astart, in long aend); nsifile
resolvefile(in astring aargument); nsiuri
resolveuri(in astring aargument); attributes attribute type description length long number of arguments in the command line.
...
resolvefile()
resolves a file-path argument into an nsifile object.
...nsifile
resolvefile( in astring aargument ); parameters aargument the command-line argument to
resolve.
...And 2 more matches
nsIProtocolProxyCallback
netwerk/base/public/nsiprotocolproxycallback.idlscriptable this interface serves as a closure for nsiprotocolproxyservice.async
resolve().
...void onproxyavailable( in nsicancelable arequest, in nsiuri auri, in nsiproxyinfo aproxyinfo, in nsresult astatus ); parameters arequest the value returned from async
resolve.
... auri the uri passed to async
resolve.
...And 2 more matches
WebIDL bindings
[need
resolve] used to flag interfaces which have a custom
resolve hook.
... this annotation will cause the do
resolve method to be called on the underlying c++ class when a property lookup happens on the object.
... the signature of this method is: bool do
resolve(jscontext*, js::handle<jsobject*>, js::handle<jsid>, js::mutablehandle<js::value>).
...And 2 more matches
Body - Web APIs
it returns a promise that
resolves with an arraybuffer.
...it returns a promise that
resolves with a blob.
...it returns a promise that
resolves with a formdata object.
...And 2 more matches
Cache - Web APIs
methods cache.match(request, options) returns a promise that
resolves to the response associated with the first matching request in the cache object.
... cache.matchall(request, options) returns a promise that
resolves to an array of all matching requests in the cache object.
... cache.delete(request, options) finds the cache entry whose key is the request, returning a promise that
resolves to true if a matching cache entry is found and deleted.
...And 2 more matches
PaymentRequest.show() - Web APIs
the promise should
resolve with a paymentdetailsupdate object containing the updated information.
... return value a promise that eventually
resolves with a paymentresponse.
... the promise is
resolved when the user accepts the payment request (such as by clicking a "pay" button in the browser's payment sheet).
...And 2 more matches
PushManager - Web APIs
it returns a promise that
resolves to a pushsubscription object containing details of an existing subscription.
... if no existing subscription exists, this
resolves to a null value.
... pushmanager.permissionstate() returns a promise that
resolves to the permission state of the current pushmanager, which will be one of 'granted', 'denied', or 'prompt'.
...And 2 more matches
RTCPeerConnection.peerIdentity - Web APIs
the read-only rtcpeerconnection property peeridentity returns a javascript promise that
resolves to an rtcidentityassertion which contains a domstring identifying the remote peer.
... once this promise
resolves successfully, the resulting identity is the target peer identity and cannot change for the duration of the connection.
... syntax var identity = rtcpeerconnection.peeridentity; value a javascript promise which
resolves to an rtcidentityassertion that describes the remote peer's identity.
...And 2 more matches
XRSystem - Web APIs
methods in addition to inheriting methods from its parent interface, eventtarget, the xrsystem interface includes the following methods: issessionsupported() returns a promise which
resolves to true if the browser supports the given xrsessionmode.
...
resolves to false if the specified mode isn't supported.
... requestsession() returns a promise that
resolves to a new xrsession with the specified xrsessionmode.
...And 2 more matches
Promise() constructor - JavaScript
the side-effect is that the promiseobj becomes "
resolved." typically, it works like this: the operation within executor is asynchronous and provides a callback.
...the promise object will become "
resolved" when either of the functions resolutionfunc or rejectionfunc are invoked.
... note that if you call resolutionfunc or rejectionfunc and pass another promise object as an argument, you can say that it is "
resolved", but still cannot be said to be "settled".
...And 2 more matches
Promise.prototype.catch() - JavaScript
the promise returned by catch() is rejected if onrejected throws an error or returns a promise which is itself rejected; otherwise, it is
resolved.
... console.log('> > > > > > called .then on %o with arguments: %o', this, arguments); return originalthen.apply(this, arguments); }; promise.prototype.catch = function(){ console.error('> > > > > > called .catch on %o with arguments: %o', this, arguments); return originalcatch.apply(this, arguments); }; })(this.promise); // calling catch on an already
resolved promise promise.
resolve().catch(function xxx(){}); // logs: // > > > > > > called .catch on promise{} with arguments: arguments{1} [0: function xxx()] // > > > > > > called .then on promise{} with arguments: arguments{2} [0: undefined, 1: function xxx()] description the catch method is used for error handling in promise composition.
... examples using and chaining the catch method var p1 = new promise(function(
resolve, reject) {
resolve('success'); }); p1.then(function(value) { console.log(value); // "success!" throw new error('oh, no!'); }).catch(function(e) { console.error(e.message); // "oh, no!" }).then(function(){ console.log('after a catch the chain is restored'); }, function () { console.log('not fired due to the catch'); }); // the following behaves the same as above p1.then(function(value) { console.log(value); // "success!" return promise.reject('oh, no!'); }).catch(function(e) { console.error(e); // "oh, no!" }).then(function(){ console.log('after a catch the chain is restored'); }, function () { con...
...And 2 more matches
Promise.race() - JavaScript
if the iterable contains one or more non-promise value and/or an already settled promise, then promise.race will
resolve to the first of these values found in the iterable.
... examples asynchronicity of promise.race this following example demonstrates the asynchronicity of promise.race: // we are passing as argument an array of promises that are already
resolved, // to trigger promise.race as soon as possible var
resolvedpromisesarray = [promise.
resolve(33), promise.
resolve(44)]; var p = promise.race(
resolvedpromisesarray); // immediately logging the value of p console.log(p); // using settimeout we can execute code after the stack is empty settimeout(function(){ console.log('the stack is now empty'); console.log(p); }); // logs, in order: // promise { <state>: "pending" } // the stack is now empty // promise { <state>: "fulfilled", <value>: 33 } an empty iterable causes the returned promise to be forever pending: var foreverpendingpromise = promise.r...
...ace([]); console.log(foreverpendingpromise); settimeout(function(){ console.log('the stack is now empty'); console.log(foreverpendingpromise); }); // logs, in order: // promise { <state>: "pending" } // the stack is now empty // promise { <state>: "pending" } if the iterable contains one or more non-promise value and/or an already settled promise, then promise.race will
resolve to the first of these values found in the array: var foreverpendingpromise = promise.race([]); var alreadyfulfilledprom = promise.
resolve(100); var arr = [foreverpendingpromise, alreadyfulfilledprom, "non-promise value"]; var arr2 = [foreverpendingpromise, "non-promise value", promise.
resolve(100)]; var p = promise.race(arr); var p2 = promise.race(arr2); console.log(p); console.log(p2); settimeout(function(){...
...And 2 more matches
places/favicon - Archive of obsolete content
globals functions getfavicon(object, callback) takes an object that represents a page's url and returns a promise that
resolves with the favicon url for that page.
...unction (url) { console.log(url); // http://mozorg.cdn.mozilla.net/media/img/favicon.ico }); // tab example require("sdk/tabs").open({ url: "http://mozilla.org", onready: function (tab) { getfavicon(tab).then(function (url) { console.log(url); // http://mozorg.cdn.mozilla.net/media/img/favicon.ico }); } }); // an optional callback can be provided to handle // the promise's
resolve and reject states getfavicon("http://mozilla.org", function (url) { console.log(url); // http://mozorg.cdn.mozilla.net/media/img/favicon.ico }); parameters object : string|tab a value that represents the url of the page to get the favicon url from.
... callback : function an optional callback function that will be used in both
resolve and reject cases.
... returns promise : a promise that
resolves with the favicon url.
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.
... this causes the style system to apply all style rules that correspond to the element and results in a
resolved style context - the style data specific to that element.
...so far the general flow of layout looks like this: obtain a document's content model utilize the style system to
resolve the style of each element in the content model construct the frames that correspond to the content model, according to the
resolved style data.
...so really, this sequence of operations
resolve style, create frame, layout frame, gets repeated many times as the content becomes available.
Eclipse CDT Manual Setup
that object directory is needed to
resolve include paths to the various headers that the build process generates/copies there.
... once the indexer has finished (keep an eye on the progress tab), sanity check that everything went as it should have by right-clicking the project in the project explorer tab and selecting "index > search for un
resolved includes".
... if you get many more than 2000 un
resolved includes (as of may 2012), then things have gone pretty wrong.
... you should be able to use the list of un
resolved includes to help figure out what the problem is (see also the parser errors section for more troubleshooting tips).
Extending a Protocol
async echo(nscstring data) returns (nscstring aresult); - the "returns" here translates to a mozpromise, with a
resolver that will settle a promise with the expected value.
... mozilla::ipc::ipcresult recvecho(const nscstring& astring, echoparent::echo
resolver&& a
resolver); mozilla::ipc::ipcresult recv__delete__() override; void actordestroy(actordestroyreason awhy) override; private: ~echoparent() = default; bool mactoralive; }; } // end of namespace dom } // end of namespace mozilla #endif now, and add the echoparent.h to dom/ipc/moz.build, as part of the exports.mozilla.dom array.
... #include "echoparent.h" namespace mozilla { namespace dom { echoparent::echoparent() : mactoralive(true) {} mozilla::ipc::ipcresult echoparent::recvecho( const nscstring& astring, echoparent::echo
resolver&& a
resolver) { puts("[echoparent] recvecho() - yay!"); a
resolver(astring); // let's send it back!
... // we convert the string to utf8 echochild->sendecho(ns_convertutf16toutf8(astring)) ->then( getmainthreadserialeventtarget(), __func__, //
resolve lambda [echopromise](const nscstring& returnedstring) { puts("[navigator.cpp] yay, we got a message back!"); // send the string back out a utf16 echopromise->maybe
resolve(ns_convertutf8toutf16(returnedstring)); }, // reject lambda [echopromise](mozilla::ipc::responserejectreason&& areason) { puts("[navigator.c...
Downloads.jsm
promise
resolves to the newly created download object.
... promise
resolves to undefined when the download has finished successfully and you can access the target file.
... promise
resolves to the requested downloadlist object.
... promise
resolves to the requested downloadsummary object.
Property cache
it is crucial that jit and interpreter get the same answer; possible pitfalls include native getters and
resolve hooks.
...(informally: objects with the same shape have the same prototype, class, and layout.) prototype chain shadowing guarantee — if at t0 the object x has shape s and a property x.p of x is found along the prototype chain on object x' of shape s', where x !== x', and the lookup called no
resolve hooks or non-native lookup ops, and at t1 the object x has shape s, the object x' has shape s', and no shape-regenerating gc occurred, then at t1 the lookup for x.p still finds the same property on x'.
...nformally: if another property shadows x'.p, the shape of x' will change.) o---->o---->o---->o ^x ^x' ^object.prototype, perhaps (----> indicates the proto relation) scope chain shadowing guarantee — if at time t0 the object x has shape s and a name lookup for p starting at scope chain head x finds p on an object x' of shape s', where x !== x'; and the lookup called no
resolve hooks or non-native lookup ops; and each object examined along the parent chain, except possibly the one along whose prototype chain x' was found, had no prototype or was a block object; and at time t1 x has shape s and x' has shape s'; and no shape-regenerating gc occurred; then at t1 the lookup for p in x still finds the same property on x'.
...(informally: adding a shared or readonly property to a prototype changes rt->protohazardshape.) (at the moment, xml objects and
resolve hooks can trigger bugs in the implementation that break some of these guarantees.
JSClass.flags
jsclass_new_
resolve obsolete since jsapi 36 this class's
resolve hook is actually a jsnew
resolveop, not a js
resolveop.
... jsclass_new_
resolve_gets_start obsolete since jsapi 16 the
resolve hook expects to receive the starting object in the prototype chain passed in via the *objp in/out parameter.
... (this is meaningful only if the jsclass_new_
resolve flag is also set.) jsclass_construct_prototype obsolete since jsapi 11 instructs js_initclass to invoke the constructor when creating the class prototype.
... see also bug 527805 - removed jsclass_share_all_properties bug 571789 - removed jsclass_is_extended bug 638291 - removed jsclass_mark_is_trace bug 641025 - added jsclass_implements_barriers bug 702507 - removed jsclass_construct_prototype bug 758913 - removed jsclass_new_
resolve_gets_start bug 766447 - added jsclass_is_domjsclass bug 792108 - added jsclass_emulates_undefined bug 993026 - removed jsclass_new_
resolve bug 1097267 - removed jsclass_new_enumerate ...
Property attributes
added in spidermonkey 38 mxr id search for jsprop_redefine_nonconfigurable jsprop_resolving
resolve hooks and enumerate hooks must pass this flag when calling js_define* apis to reify lazily-defined properties.
...it tells the engine to skip the
resolve hook when performing the lookup at the beginning of property definition.
... this keeps the
resolve hook from accidentally triggering itself: unchecked recursion.
... for enumerate hooks, triggering the
resolve hook would be merely silly, not fatal, except in some cases involving non-configurable properties.
SpiderMonkey 1.8
in certain cases, the javascript engine no longer calls jsclass.
resolve callbacks repeatedly, as it did in previous versions.
... specifically, if a property lookup first calls a
resolve hook which does not define the property, then finds the property on a prototype, that result can be cached.
... future lookups for the same property on the same sort of object may bypass the
resolve hook.
... js_alreadyhasownproperty and friends are new functions for examining an object without triggering
resolve hooks.
Shell global objects
setmodule
resolvehook(function(module, specifier) {}) set the host
resolveimportedmodule hook to function.
... addpromisereactions(promise, on
resolve, onreject) calls the js::addpromisereactions jsapi function with the given arguments.
...this just marks the promise as
resolved with a value of undefined and causes the firing of any onpromisesettled hooks set on debugger instances that are observing the given promise's global as a debuggee.
...
resolvepromise(promise, resolution)
resolve a promise by calling the jsapi function js::
resolvepromise.
nsIFile
followlinks prbool determines whether or not the nsifile will automatically
resolve symbolic links.
... this method will not
resolve aliases/shortcuts during the copy.
...any nodes that have not been created or
resolved, will be.
... this method will not
resolve any symlinks.
nsISocketTransport
status_resolving may be skipped if the host does not need to be
resolved.
... status_
resolved 0x804b000b transport has
resolved the host.
...return value an prnetaddr containing the
resolved ip address.
...return value an prnetaddr containing the
resolved ip address.
nsIURI
epath path scheme userpass host port ref ftp :// username@password @ hostname : portnumber /pathname?query=value #ref method overview nsiuri clone(); nsiuri cloneignoringref(); boolean equals(in nsiuri other); boolean equalsexceptref(in nsiuri other); autf8string
resolve(in autf8string relativepath); boolean schemeis(in string scheme); attributes attribute type description asciihost acstring the uri host with an ascii compatible encoding.
...
resolve()
resolves a relative uri string, using this uri as the base.
... autf8string
resolve( in autf8string relativepath ); parameters relativepath the relative path to
resolve.
... return value the
resolved absolute uri string.
Animation.ready - Web APIs
the read-only animation.ready property of the web animations api returns a promise which
resolves when the animation is ready to play.
... since the same promise is used for both pending play and pending pause requests, authors are advised to check the state of the animation when the promise is
resolved.
... syntax var readypromise = animation.ready; value a promise which
resolves when the animation is ready to be played.
... you'll typically use a construct similar to this when using the ready promise: animation.ready.then(function() { // do whatever needs to be done when // the animation is ready to run }); example in the following example, the state of the animation will be running when the current ready promise is
resolved because the animation does not leave the pending play state in between the calls to pause and play and hence the current ready promise does not change.
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.
... if no match is found, the promise
resolves to undefined.
... return value a promise that
resolves to the first response that matches the request or to undefined if no match is found.
... note: cache.match() is basically identical to cache.matchall(), except that rather than resolving with an array of all matching responses, it
resolves with the first matching response only (that is, response[0]).
CacheStorage.match() - Web APIs
this method returns a promise for a response, or a promise which
resolves to undefined if no match is found.
... return value a promise that
resolves to the matching response.
... if no matching response to the specified request is found, the promise
resolves with undefined.
... self.addeventlistener('fetch', function(event) { event.respondwith(caches.match(event.request).then(function(response) { // caches.match() always
resolves // but in case of success response will have value if (response !== undefined) { return response; } else { return fetch(event.request).then(function (response) { // response may be used only once // we need to save clone to put one copy in cache // and serve second one let responseclone = response.clone(); caches.open('v1').then(fu...
Clipboard - Web APIs
all of the clipboard api methods operate asynchronously; they return a promise which is
resolved once the clipboard access has been completed.
...when the data has been retrieved, the promise is
resolved with a datatransfer object that provides the data.
... readtext() requests text from the system clipboard; returns a promise which is
resolved with a domstring containing the clipboard's text once it's available.
... writetext() writes text to the system clipboard, returning a promise which is
resolved once the text is fully copied into the clipboard.
CredentialsContainer.get() - Web APIs
if no match is found the promise will
resolve to null.
...calls to it within an <iframe> element will
resolve without effect.
... returns a promise that
resolves with a credential instance that matches the provided parameters.
... if a single credential cannot be unambigiously obtained, the promise will
resolve to null.
FetchEvent.respondWith() - Web APIs
specifying the final url of a resource from firefox 59 onwards, when a service worker provides a response to fetchevent.respondwith(), the response.url value will be propagated to the intercepted network request as the final
resolved url.
... this means, for example, if a service worker intercepts a stylesheet or worker script, then the provided response.url will be used to
resolve any relative @import or importscripts() subresource loads (bug 1222008).
... syntax fetchevent.respondwith( // promise that
resolves to a response.
... ); parameters a response or a promise that
resolves to a response.
Cross-global fetch usage - Web APIs
when a cross-origin fetch involving a relative url is initiated from an <iframe>, the relative url used to be
resolved against the current global location, rather than the iframe's location.
...frame.contentwindow.fetch() the url passed to fetch needs to be relative the problem in the past we would
resolve the relative url against the current global, for example: let absolute = new url(relative, window.location.href) this is not a problem as such.
... the solution in firefox 60 onwards, mozilla
resolves the relative url against the global that owns the fetch() function being used (see bug 1432272).
... so in the case described above, it is
resolved against the iframe's location: let absolute = new url(relative, frame.contentwindow.location.href) there is a lot of discussion in progress about getting new specs to align with this behavior change, to mitigate potential problems going forward.
Using Fetch - Web APIs
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.
...an accurate check for a successful fetch() would include checking that the promise
resolved, then checking that the response.ok property has a value of true.
... response objects as you have seen above, response instances are returned when fetch() promises are
resolved.
...these all return a promise that is eventually
resolved with the actual content.
HTMLMediaElement.play() - Web APIs
it returns a promise which is
resolved when playback has been successfully started.
... return value a promise which is
resolved when playback has been started, or is rejected if for any reason playback cannot be started.
...for example, a site should not present a user interface that assumes playback has begun automatically, but should instead update their ui based on whether the returned promise is
resolved or rejected.
... note: the play() method may cause the user to be asked to grant permission to play the media, resulting in a possible delay before the returned promise is
resolved.
LocalFileSystemSync - Web APIs
the global methods in the window object requestfilesystemsync() and
resolvelocalfilesystemsyncurl() methods are exposed to the worker's global scope.
... method overview filesystemsync requestfilesystemsync (in unsigned short type, in long long size) raises fileexception; entrysync
resolvelocalfilesystemsyncurl (in domstring url) raises fileexception; constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion.
...
resolvelocalfilesystemsyncurl() allows the user to look up the entry for a file or directory referred to by a local url.
... void
resolvelocalfilesystemurl( in domstring url ); parameter url the url of a local file in the file system.
PaymentResponse.retry() - Web APIs
return value a promise which is
resolved when the payment is successfully completed.
... see the example below for a thorough example, but the basic concept, in outline form, is: create a new paymentrequest (new paymentrequest()) display the payment request (paymentrequest.show() if show()
resolves, the returned paymentresponse describes the requested payment and the options chosen by the user.
...e); } if (errors.payer) { // "payerdetailchange" fired at response object const promise = fixfield(response, "payerdetailchange", payervalidator); promisestofixthings.push(promise); } await promise.all([response.retry(errors), ...promisestofixthings]); await recursivevalidate(request, response); } function fixfield(requestorresponse, event, validator) { return new promise(
resolve => { // browser keeps calling this until promise
resolves.
... event.removeeventlistener(event, listener);
resolve(); } }); }); } dopaymentrequest(); specifications specification status comment payment request apithe definition of 'retry()' in that specification.
PushRegistrationManager - Web APIs
methods pushregistrationmanager.register() returns a promise that
resolves to a pushregistration with details of a new registration.
... pushregistrationmanager.unregister() returns a promise that
resolves to a pushregistration with details of the unregistered registration.
... pushregistrationmanager.getregistration() returns a promise that
resolves the pushregistration associated with the current webapp.
... pushregistrationmanager.haspermission() returns a promise that
resolves to the pushpermissionstatus of the requesting webapp.
Storage Access API - Web APIs
in firefox, when the promise returned from requeststorageaccess() is
resolved, the embedded page will gain access to its entire first-party storage, not just cookies.
... storage access api methods the storage api methods are implemented on the document interface: document.hasstorageaccess() returns a promise that
resolves with a boolean value indicating whether the document has access to its first-party storage.
... document.requeststorageaccess() returns a promise that
resolves if the access to first-party storage was granted, and rejects if access was denied.
...for example, a caller could open a pop-up window from the
resolved promise without triggering firefox’s pop-up blocker.
Web Authentication API - Web APIs
this
resolves significant security problems related to phishing, data breaches, and attacks against sms texts or other second-factor authentication methods while at the same time significantly increasing ease of use (since users don't have to manage dozens of increasingly complicated passwords).
...the parameters received from the server will be passed to the create() call, typically with little or no modification and returns a promise that will
resolve to a publickeycredential containing an authenticatorattestationresponse.
... browser creates final data, application sends response to server - the create() promise
resolves to an publickeycredential, which has a publickeycredential.rawid that is the globally unique credential id along with a response that is the authenticatorattestationresponse containing the authenticatorresponse.clientdatajson and authenticatorattestationresponse.attestationobject.
... browser creates final data, application sends response to server - the browser
resolves the promise to a publickeycredential with a publickeycredential.response that contains the authenticatorassertionresponse.
X-DNS-Prefetch-Control - HTTP
this prefetching is performed in the background, so that the dns is likely to have been
resolved by the time the referenced items are needed.
...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.
... forcing lookup of specific hostnames you can force the lookup of specific hostnames without providing specific anchors using that hostname by using the rel attribute on the <link> element with a link type of dns-prefetch: <link rel="dns-prefetch" href="https://www.mozilla.org/contribute/"> in this example, the domain name "www.mozilla.org/contribute" will be pre-
resolved.
... similarly, the link element can be used to
resolve hostnames without providing a complete url, but only, by preceding the hostname with two slashes: <link rel="dns-prefetch" href="//www.mozilla.org/contribute/"> forced prefetching of hostnames might be useful, for example, on the homepage of a site to force pre-resolution of domain names that are referenced frequently throughout the site even though they are not used on the home page itself.
WebAssembly.instantiate() - JavaScript
the returned promise
resolves to both a compiled webassembly.module and its first webassembly.instance.
... the secondary overload takes an already-compiled webassembly.module and returns a promise that
resolves to an instance of that module.
... return value a promise that
resolves to a resultobject which contains two fields: module: a webassembly.module object representing the compiled webassembly module.
... return value a promise that
resolves to an webassembly.instance object.
await - JavaScript
if the value of the expression following the await operator is not a promise, it's converted to a
resolved promise.
... function
resolveafter2seconds(x) { return new promise(
resolve => { settimeout(() => {
resolve(x); }, 2000); }); } async function f1() { var x = await
resolveafter2seconds(10); console.log(x); // 10 } f1(); thenable objects thenable objects will be fulfilled just the same.
... async function f2() { const thenable = { then: function(
resolve, _reject) {
resolve('
resolved!') } }; console.log(await thenable); //
resolved!
... } f2(); conversion to promise if the value is not a promise, it converts the value to a
resolved promise, and waits for it.
test/utils - Archive of obsolete content
waituntil(predicate, interval) waituntil returns a promise that
resolves upon the predicate returning a truthy value, which is called every interval milliseconds.
... parameters predicate : function a function that gets called every interval milliseconds to determine if the promise should be
resolved.
... returns promise : waituntil returns a promise that becomes
resolved once the predicate returns a truthy value.
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
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 un
resolved real 0m40.771s user 0m9.284s sys 0m1.304s [root@b008-02 commsrc]# python client.py checkout executing command: ['hg', 'pull', '-r', './.', '-r', 'tip'] pulling from http://hg.mozilla.org/comm-central/ searching for changes no changes found executing command: ['hg', 'update', '-r', 'default', '-r', './.'] 0 files updated, 0 files merged, 0 files removed, 0 files un
resolved updated t...
...executing command: ['hg', 'update', '-r', 'default', '-r', './mozilla/extensions/inspector'] 0 files updated, 0 files merged, 0 files removed, 0 files un
resolved updated to revision 51c6d483a4c15a657df18540219bd0201896c6f2.
...updating working directory 163 files updated, 0 files merged, 0 files removed, 0 files un
resolved executing command: ['hg', 'update', '-r', 'default', '-r', './mozilla/extensions/venkman'] 0 files updated, 0 files merged, 0 files removed, 0 files un
resolved updated to revision 06ea5135b7f3c9a639c483183ceb9802abee621b.
Content states and the style system - Archive of obsolete content
generally, whenever a node's content state changes, style has to be re
resolved (recomputed) for that node and all of its descendants.
... this is an expensive operation, however, so the style system tries to minimize the number of style re
resolves it does.
...if that has happened, then the style could depend on the state that changed and we have to re
resolve style.
Complete - Archive of obsolete content
the dtd
resolves this into a text string in the appropriate language.
...to
resolve the differences, the extension uses firefox etc.
...to
resolve the conflict, this extension registers seamonkey's skins in a seamonkey subdirectory.
Making asynchronous programming easier with async and await - Learn web development
here is a trivial example: async function hello() { return greeting = await promise.
resolve("hello"); }; hello().then(alert); of course, the above example is not very useful, although it does serve to illustrate the syntax.
...both of them start off with a custom promise function that fakes an async process with a settimeout() call: function timeoutpromise(interval) { return new promise((
resolve, reject) => { settimeout(function(){
resolve("done"); }, interval); }); }; then each one includes a timetest() async function that awaits three timeoutpromise() calls: async function timetest() { ...
...take a look at the es class code we saw in our object-oriented javascript article, and then look at our modified version with an async method: class person { constructor(first, last, age, gender, interests) { this.name = { first, last }; this.age = age; this.gender = gender; this.interests = interests; } async greeting() { return await promise.
resolve(`hi!
Chrome registration
bug
resolved in mozilla 1.9; see bug 132183.
...in order to allow for this, the chrome registration manifest allows for "override" instructions: override chrome://package/type/original-uri.whatever new-
resolved-uri [flags] note: overrides are not recursive (so overriding chrome://foo/content/bar/ with file:///home/john/blah/ will not usually do what you want or expect it to do).
... note: there was a bug in gecko 1.8.1.5 (firefox 2.0.0.5) and earlier where you could not use a relative url for the new-
resolved-uri parameter.
DownloadSummary
promise
resolves to undefined when the view on the underlying list has been registered.
... promise
resolves to undefined when the view has been registered and the onsummarychanged notification has been sent.
... promise
resolves to undefined when the view has been removed.
JS_PropertyStub
js::mutablehandlevalue vp); bool js_strictpropertystub(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandlevalue vp, js::objectopresult &result); // added in spidermonkey 45 bool js_strictpropertystub(jscontext *cx, js::handleobject obj, js::handleid id, bool strict, js::mutablehandlevalue vp); // obsolete since jsapi 39 bool js_
resolvestub(jscontext *cx, js::handleobject obj, js::handleid id, bool *
resolvedp); // obsolete since jsapi 37 bool js_deletepropertystub(jscontext *cx, js::handleobject obj, js::handleid id, bool *succeeded); // obsolete since jsapi 37 bool js_enumeratestub(jscontext *cx, js::handleobject obj); // obsolete since jsapi 37 bool js_convertstub(jscontext *cx, js::hand...
... js_
resolvestub is a stub for jsclass.
resolve.
... see also mxr id search for js_propertystub mxr id search for js_strictpropertystub jspropertyop jsstrictpropertyop bug 1103152 - removed js_deletepropertystub, js_enumeratestub, js_
resolvestub, and js_convertstub bug 736978 - removed js_finalizestub bug 1113369 -- added result parameter ...
JSAPI reference
nversion js_getversion js_setversionforcompartment added in spidermonkey 31 js_stringtoversion js_versiontostring js_setversion obsolete since jsapi 25 js::currentglobalornull added in spidermonkey 31 js_getglobalforscopechain obsolete since jsapi 25 js_getglobalobject obsolete since jsapi 24 js_setglobalobject obsolete since jsapi 25 js_initclass js_initstandardclasses js_
resolvestandardclass js_enumeratestandardclasses js_enumerate
resolvedstandardclasses obsolete since jsapi 24 js_isrunning js_saveframechain js_restoreframechain js_isassigning obsolete since javascript 1.8.5 js_isconstructing obsolete since jsapi 26 js_isconstructing_possiblywithgiventhisobject obsolete since jsapi 17 js_getscopechain obsolete since javascript 1.8.7 compartments: ...
...ss can be customized using these flags: jsclass.flags jsclass_has_private jsclass_private_is_nsisupports jsclass_is_domjsclass added in spidermonkey 17 jsclass_implements_barriers added in spidermonkey 17 jsclass_emulates_undefined added in spidermonkey 24 jsclass_has_reserved_slots(n) jsclass_global_flags jsclass_new_enumerate obsolete since jsapi 37 jsclass_new_
resolve obsolete since jsapi 36 jsclass_share_all_properties obsolete since javascript 1.8.5 jsclass_new_
resolve_gets_start obsolete since jsapi 16 jsclass_construct_prototype obsolete since jsapi 11 jsclass_is_extended obsolete since jsapi 17 jsclass_mark_is_trace obsolete since jsapi 5 the behavior of a jsclass and its instances can be customized in many ways using callback functi...
... jsclass method types: jspropertyop jsstrictpropertyop added in spidermonkey 1.9.3 jsdeletepropertyop added in spidermonkey 24 jsenumerateop jsnewenumerateop js
resolveop jsconvertop jsfinalizeop jshasinstanceop jstraceop jscheckaccessop obsolete jsxdrobjectop obsolete since jsapi 13 jsnew
resolveop obsolete since jsapi 36 jsmarkop obsolete since jsapi 5 jsgetobjectops obsolete since javascript 1.8.5 jsreserveslotsop obsolete since javascript 1.8.5 these stub functions can be used when creating a custom jsclass: js_propertystub js_strictpropertystub added in spidermonkey 1.9.3 js_convertstub obsolete since jsapi 37 js_deletepropertystub obsolete since jsapi 37 js_enumeratestub obsolete since jsapi 37 js_finalizestub obsolete since jsapi 15 js_
resolvestub obso...
SpiderMonkey 1.8.8
the js
resolve_classname and js
resolve_with
resolve flags (passed to jsclass.
resolve when jsclass.flags contains jsclass_new_
resolve) have been removed.
... js_isscriptframe jsclass_new_
resolve_gets_start flag js_newnumbervalue api changes break out and discuss all api changes here...
...jsclass callback changes many of the jsclass callbacks such as js
resolveop, jsenumerateop and jspropertyop, have a type change on their arguments to jshandleobject, jshandleid, jshandlemutableobject etc.
SpiderMonkey 17
the js
resolve_classname and js
resolve_with
resolve flags (passed to jsclass.
resolve when jsclass.flags contains jsclass_new_
resolve) have been removed.
... js_isscriptframe jsclass_new_
resolve_gets_start flag js_newnumbervalue js_finalizestub js_clearnewbornroots jsclass_mark_is_trace flag js_setscriptstackquota api changes break out and discuss all api changes here...
...jsclass callback changes many of the jsclass callbacks such as js
resolveop, jsenumerateop and jspropertyop, have a type change on their arguments to jshandleobject, jshandleid, jshandlemutableobject etc.
Using the Places keywords API
fetching an entry by keyword the fetch() method acceps a keyword string (or an object having a keywords property) and might
resolve to a keyword entry with the following properties: keyword: string representing the keyword url: the url represeted by the keyword postdata: optional post data string.
... if no keyword exists, will
resolve to null.
...note that fetch() always
resolves to a single entry, to fetch all of the entries it's necessary to provide a callback function.
nsIFeedProcessor
uri the base uri against which any uris in the feed are
resolved.
... uri the base uri against which any uris in the feed are
resolved.
... uri the base uri against which any uris in the feed are
resolved.
nsILocalFileMac
if followlinks is false, returns the un
resolved alias file.
...if followlinks is false, returns the un
resolved alias file.
...if followlinks is false, returns the un
resolved alias file.
URLs - Plugins
for http urls, the browser
resolves npn_geturl as the http server method get, which requests url objects.
... for http urls only, the browser
resolves this method as the http server method post, which transmits data to the server.
... the browser
resolves this method as the http server method post, which transmits data to the server.
Debugger.Object - Firefox Developer Tools
this can return null if the promise was not
resolved by calling its
resolve or reject resolving functions from script.
... promisetimetoresolution if the referent is a promise, this is the number of milliseconds elapsed between when the promise was created and when it was
resolved.
... if the referent hasn’t been
resolved or is not a promise, throw a typeerror exception.
DevTools API - Firefox Developer Tools
return value: a promise that is
resolved once the toolbox is destroyed.
... return value: the method should return a promise that is
resolved with the toolpanel object once it's ready to be used.
...if the tool needs to perform asynchronous operations during destruction the method should return a promise that is
resolved once the process is complete.
Animation.finished - Web APIs
the animation.finished read-only property of the web animations api returns a promise which
resolves once the animation has finished playing.
...the new promise will
resolve once the new animation sequence has completed.
... syntax var animationspromise = animation.finished; value a promise object which will
resolve once the animation has finished running.
AudioContext.close() - Web APIs
the returned promise
resolves when all audiocontext-creation-blocking resources have been released.
...}); await audioctx.close(); returns a promise that
resolves with void.
...when the promise
resolves, the example is reset to its beginning state.
BluetoothRemoteGATTCharacteristic - Web APIs
methods bluetoothremotegattcharacteristic.getdescriptor() returns a promise that
resolves to the first bluetoothgattdescriptor for a given descriptor uuid.
... bluetoothremotegattcharacteristic.getdescriptors() returns a promise that
resolves to an array of all bluetoothgattdescriptor objects for a given descriptor uuid.
... bluetoothremotegattcharacteristic.readvalue() returns a promise that
resolves to an arraybuffer holding a duplicate of the value property if it is available and supported.
BudgetService - Web APIs
methods budgetservice.getcost() returns a promise that
resolves to a double, indicating the worst-case background operation cost of the provided background operation.
... budgetservice.getbudget() returns a promise that
resolves to an array of budgetstate objects, indicating the expected state of the budget at times in the future.
... budgetservice.reserve() returns a promise that
resolves to a boolean, indicating whether the requested budget operation can be reserved.
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.
... if no cache entry is found, it
resolves to false.
... return value a promise that
resolves to true if the cache entry is deleted, or false otherwise.
Cache.matchAll() - Web APIs
the matchall() method of the cache interface returns a promise that
resolves to an array of all matching responses in the cache object.
... return value a promise that
resolves to an array of all matching responses in the cache object.
... note: cache.match() is basically identical to cache.matchall(), except that rather than resolving with an array of all matching responses, it
resolves with the first matching response only (that is, response[0]).
CacheStorage.delete() - Web APIs
the delete() method of the cachestorage interface finds the cache object matching the cachename, and if found, deletes the cache object and returns a promise that
resolves to true.
... if no cache object is found, it
resolves to false.
... return value a promise that
resolves to true if the cache object is found and deleted, and false otherwise.
CacheStorage.open() - Web APIs
the open() method of the cachestorage interface returns a promise that
resolves to the cache object matching the cachename.
... note: if the specified cache does not exist, a new cache is created with that cachename and a promise that
resolves to this new cache object is returned.
... return value a promise that
resolves to the requested cache object.
CredentialsContainer.create() - Web APIs
the create() method of the credentialscontainer interface returns a promise that
resolves with a new credential instance based on the provided options, or null if no credential object can be created.
...calls to it within an <iframe> element will
resolve without effect.
... returns a promise that
resolves with a credential instance, such as passwordcredential, federatedcredential, or publickeycredential.
CustomElementRegistry.whenDefined() - Web APIs
the whendefined() method of the customelementregistry interface returns a promise that
resolves when the named element is defined.
... return value a promise that
resolves to undefined when the custom element is defined.
... if the custom element is already defined, the promise is
resolved immediately.
Document.evaluate() - Web APIs
syntax var xpathresult = document.evaluate( xpathexpression, contextnode, namespace
resolver, resulttype, result ); xpathexpression is a string representing the xpath to be evaluated.
... namespace
resolver is a function that will be passed any namespace prefixes and should return a string representing the namespace uri associated with that prefix.
... it will be used to
resolve prefixes within the xpath itself, so that they can be matched with the document.
Document.hasStorageAccess() - Web APIs
the hasstorageaccess() method of the document interface returns a promise that
resolves with a boolean value indicating whether the document has access to its first-party storage.
... return value a promise that
resolves with a boolean value indicating whether the document has access to its first-party storage.
... if the promise gets
resolved and a user gesture event was being processed when the function was originally called, the
resolve handler will run as if a user gesture was being processed, so it will be able to call apis that require user activation.
Document - Web APIs
document.hasstorageaccess() returns a promise that
resolves with a boolean value indicating whether the document has access to its first-party storage.
... document.requeststorageaccess() returns a promise that
resolves if the access to first-party storage was granted, and rejects if access was denied.
... document.createns
resolver() creates an xpathns
resolver object.
FetchEvent.preloadResponse - Web APIs
the preloadresponse read-only property of the fetchevent interface returns a promise that
resolves to the navigation preload response if navigation preload was triggered or undefined otherwise.
... syntax var expectedresponse = fetchevent.preloadresponse; value a promise that
resolves to a response or otherwise to undefined.
...this promise
resolves to the first matching url request in the cache object.
HTMLImageElement.decode() - Web APIs
the decode() method of the htmlimageelement interface returns a promise that
resolves when the image is decoded and it is safe to append the image to the dom.
... return value a promise which is
resolved once the image data is ready to be used.
... usage notes one potential use case for decode(): when loading very large images (for example, in an online photo album), you can present a low resolution thumbnail image initially and then replace that image with the full-resolution image by instantiating a new htmlimageelement, setting its source to the full-resolution image's url, then using decode() to get a promise which is
resolved once the full-resolution image is ready for use.
ImageCapture - Web APIs
imagecapture.takephoto() takes a single exposure using the video capture device sourcing a mediastreamtrack and returns a promise that
resolves with a blob containing the data.
... imagecapture.getphotocapabilities() returns a promise that
resolves with a photocapabilities object containing the ranges of available configuration options.
... imagecapture.getphotosettings() returns a promise that
resolves with a photosettings object containing the current photo configuration settings.
LocalFileSystem - Web APIs
window.requestfilesystem(window.persistent, 1024*1024,oninitfs,errorhandler); method overview void requestfilesystem (in unsigned short type, in unsigned long long size, in filesystemcallback successcallback, in optional errorcallback errorcallback); void
resolvelocalfilesystemurl (in domstring url, in entrycallback successcallback, in optional errorcallback errorcallback); constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion.
...
resolvelocalfilesystemurl() lets you look up the entry for a file or directory with a local url.
... void
resolvelocalfilesystemurl( in domstring url, in entrycallback successcallback, in optional errorcallback errorcallback ); parameters url the url of a local file in the file system.
MediaDevices.getUserMedia() - Web APIs
it returns a promise that
resolves to a mediastream object.
... 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.
...ermedia || navigator.mozgetusermedia; // some browsers just don't implement it - return a rejected promise with an error // to keep a consistent interface if (!getusermedia) { return promise.reject(new error('getusermedia is not implemented in this browser')); } // otherwise, wrap the call to the old navigator.getusermedia with a promise return new promise(function(
resolve, reject) { getusermedia.call(navigator, constraints,
resolve, reject); }); } } navigator.mediadevices.getusermedia({ audio: true, video: true }) .then(function(stream) { var video = document.queryselector('video'); // older browsers may not have srcobject if ("srcobject" in video) { video.srcobject = stream; } else { // avoid using this in new browsers, as it is going...
NavigationPreloadManager - Web APIs
methods navigationpreloadmanager.enable() enables navigation preloading and returns a promise that
resolves.
... navigationpreloadmanager.disable() disables navigation preloading and returns a promise that
resolves.
... navigationpreloadmanager.getstate() returns a promise that
resolves to an object with properties indicating whether preload is enabled and the contents of the service-worker-navigation-preload.
PaymentRequest.shippingAddress - Web APIs
var payment = new paymentrequest(supportedinstruments, details, options); payment.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(
resolve) { updatedetails(details, request.shippingaddress,
resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for brevity.
... }).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); function updatedetails(details, shippingaddress,
resolve) { if (shippingaddress.country === 'us') { var shippingoption = { id: '', label: '', amount: {currency: 'usd', value: '0.00'}, selected: true }; if (shippingaddress.region === 'mo') { shippingoption.id = 'mo'; shippingoption.label = 'free shipping in missouri'; details.total.amount.value = '55.00'; } else { shippingoption.id = 'us'; shippingoption.label = 'standard shipping in us'; shippingoption.amount.value = '5.00'; details.total.amount.value = '60.00'; } details.displayitems.splice(2, 1, shippingoption); details.shippingoptions = [shippingoption]; ...
... } else { delete details.shippingoptions; }
resolve(details); } specifications specification status comment payment request apithe definition of 'shippingaddress' in that specification.
PaymentResponse.shippingAddress - Web APIs
var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(
resolve) { updatedetails(details, request.shippingaddress,
resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of brevity.
... }).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); function updatedetails(details, shippingaddress,
resolve) { if (shippingaddress.country === 'us') { var shippingoption = { id: '', label: '', amount: {currency: 'usd', value: '0.00'}, selected: true }; if (shippingaddress.region === 'mo') { shippingoption.id = 'mo'; shippingoption.label = 'free shipping in missouri'; details.total.amount.value = '55.00'; } else { shippingoption.id = 'us'; shippingoption.label = 'standard shipping in us'; shippingoption.amount.value = '5.00'; details.total.amount.value = '60.00'; } details.displayitems.splice(2, 1, shippingoption); details.shippingoptions = [shippingoption]; ...
...} else { delete details.shippingoptions; }
resolve(details); } specifications specification status comment payment request api candidate recommendation initial definition.
PaymentResponse.shippingOption - Web APIs
var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingoptionchange', function(evt) { evt.updatewith(new promise(function(
resolve, reject) { updatedetails(details, request.shippingoption,
resolve, reject); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of brevity.
... }).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); function updatedetails(details, shippingoption,
resolve, reject) { var selectedshippingoption; var othershippingoption; if (shippingoption === 'standard') { selectedshippingoption = details.shippingoptions[0]; othershippingoption = details.shippingoptions[1]; details.total.amount.value = '55.00'; } else if (shippingoption === 'express') { selectedshippingoption = details.shippingoptions[1]; othershippingoption = details.shippingoptions[0]; details.total.amount.value = '67.00'; } else { reject('unknown shipping option \'' + shippingoption + '\''); return; } selectedshippingoption.selected = true; othershippingoption.selected = false; details.displayitems.s...
...plice(2, 1, selectedshippingoption);
resolve(details); } specifications specification status comment payment request api candidate recommendation initial definition.
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() - Web APIs
isuserverifyingplatformauthenticatoravailable() is a static method of the publickeycredential interface that returns a promise which
resolves to true if a user-verifying platform authenticator is available.
... at the time of this writing, this method's result only
resolves to true on windows when windows hello capabilities are available (on recent versions of this os).
... return value a promise which
resolves to a boolean indicating whether or a not a user-verifying platform authenticator is available.
PushManager.getSubscription() - Web APIs
it returns a promise that
resolves to a pushsubscription object containing details of an existing subscription.
... if no existing subscription exists, this
resolves to a null value.
... returns a promise that
resolves to a pushsubscription object or null.
RTCPeerConnection.getStats() - Web APIs
the rtcpeerconnection method getstats() returns a promise which
resolves with data providing statistics about either the overall connection or about the specified mediastreamtrack.
... return value a promise which
resolves with an rtcstatsreport object providing connection statistics.
... top above object.keys(report).foreach(statname => { if (statname !== "id" && statname !== "timestamp" && statname !== "type") { statsoutput += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; } }); }); document.queryselector(".stats-box").innerhtml = statsoutput; }); }, 1000); this works by calling getstats(), then, when the promise is
resolved, iterates over the rtcstats objects on the returned rtcstatsreport.
Using the Screen Capture API - Web APIs
capturing screen contents capturing screen contents as a live mediastream is initiated by calling navigator.mediadevices.getdisplaymedia(), which returns a promise that
resolves to a stream containing the live screen contents.
... using the captured stream the promise returned by getdisplaymedia()
resolves to a mediastream that contains at least one video stream that contains the screen or screen area, and which is adjusted or filtered based upon the constraints specifed when getdisplaymedia() was called.
...using await, the following line of code does not get executed until after the promise returned by getdisplaymedia()
resolves.
ServiceWorkerContainer - Web APIs
once that condition is met, it
resolves with the serviceworkerregistration.
... the method returns a promise that
resolves to a serviceworkerregistration or undefined.
... the method returns a promise that
resolves to an array of serviceworkerregistration.
StorageManager - Web APIs
methods storagemanager.estimate() secure context returns a promise that
resolves to a storageestimate object containing usage and quota numbers for your origin.
... storagemanager.persist() secure context returns a promise that
resolves to true if the user agent is able to persist your site's storage.
... storagemanager.persisted() secure context returns a promise that
resolves to true if persistence has already been granted for your site's storage.
SubtleCrypto.importKey() - Web APIs
takes an arraybuffer string containing the bytes, and returns a promise that will
resolve to a cryptokey representing the secret key.
...takes a string containing the pem encoded key, and returns a promise that will
resolve to a cryptokey representing the private key.
...takes a string containing the pem encoded key, and returns a promise that will
resolve to a cryptokey representing the private key.
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 actual data is in the usbintransferresult in the
resolved promise.
... return value promise that
resolves with a usbintransferresult.
USBDevice.transferIn() - Web APIs
the transferin() method of the usbdevice interface returns a promise that
resolves with a usbtransferinresult when bulk or interrupt data is received from the usb device.
...the actual data is in the usbintransferresult in the
resolved promise.
... return value a promise that
resolves with a usbtransferinresult.
Starting up and shutting down a WebXR session - Web APIs
this returns a promise which
resolves to true if the given type of session is available for use or false otherwise.
...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.
... preparing the new session for use once the requestsession() method's returned promise successfully
resolves, you know you have a usable webxr session in hand.
Web Locks API - Web APIs
the request() method itself returns a promise which
resolves once the lock has been released; within an async function, a script can await the call to make the asynchronous code flow linear.
... advanced use for more complicated cases, such as holding the lock for an arbitrary amount of time, the callback can return a promise explicitly
resolved by the script: // capture promise control functions: let
resolve, reject; const p = new promise((res, rej) => {
resolve = res; reject = rej; }); // request the lock: navigator.locks.request('my_resource', lock => { // lock is acquired.
... return p; // now lock will be held until either
resolve() or reject() is called.
WritableStream.WritableStream() - Web APIs
ter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((
resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded;
resolve(); }); }, close() { var lis...
... the defaultwriter.ready property returns a promise that
resolves when the sink (the first property of the writablestream constructor) is done writing data.
... the promise returned by the sink's write() method (line 40) tells the writablestream and its writer when to
resolve defaultwriter.ready.
WritableStream - Web APIs
ter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((
resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded;
resolve(); }); }, close() { var lis...
... the defaultwriter.ready property returns a promise that
resolves when the sink (the first property of the writablestream constructor) is done writing data.
... the promise returned by the sink's write() method (line 40) tells the writablestream and its writer when to
resolve defaultwriter.ready.
WritableStreamDefaultWriter - Web APIs
writablestreamdefaultwriter.readyread only returns a promise that
resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
... writablestreamdefaultwriter.write() writes a passed chunk of data to a writablestream and its underlying sink, then returns a promise that
resolves to indicate the success or failure of the write operation.
... }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((
resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded;
resolve(); }); }, close() {...
XPathEvaluator.createExpression() - Web APIs
syntax xpathexpression xpathevaluator.createexpression(expression,
resolver); parameters expression a domstring representing representing the xpath expression to be created.
...
resolver optional permits translation of all prefixes, including the xml namespace prefix, within the xpath expression into appropriate namespace uris.
... namespace_err if the expression contains namespace prefixes which cannot be
resolved by the specified xpathns
resolver, a domexception of type namespace_error is raised.
XPathEvaluator.evaluate() - Web APIs
syntax xpathresult xpathevaluator.evaluate(expression, contextnode,
resolver, type, result); parameters expression a domstring representing the xpath expression to be parsed and evaluated.
...
resolver optional permits translation of all prefixes, including the xml namespace prefix, within the xpath expression into appropriate namespace uris.
... namespace_err if the expression contains namespace prefixes which cannot be
resolved by the specified xpathns
resolver, a domexception of type namespace_error is raised.
XRSystem: isSessionSupported() - Web APIs
the xrsystem method issessionsupported() returns a promise which
resolves to true if the specified webxr session mode is supported by the user's webxr device.
... otherwise, the promise
resolves with false.
... return value a promise that
resolves to true if the specified session mode is supported; otherwise the promise
resolves to false.
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.
... return value a promise that
resolves with an xrsession object if the device and user agent support the requested mode and features.
...if the promise
resolves, it sets up a session and initiates the animation loop.
<basic-shape> - CSS: Cascading Style Sheets
all the lengths expressed in percentages are
resolved from the used dimensions of the reference box.
...a percentage value here is
resolved from the used width and height of the reference box as sqrt(width^2+height^2)/sqrt(2).
...percentage values here are
resolved against the used width (for the rx value) and the used height (for the ry value) of the reference box.
Promise.allSettled() - JavaScript
the promise.allsettled() method returns a promise that
resolves after all of the given promises have either fulfilled or rejected, with an array of objects that each describes the outcome of each promise.
... however, if and only if an empty iterable is passed as an argument, promise.allsettled() returns a promise object that has already been
resolved as an empty array.
... examples using promise.allsettled promise.allsettled([ promise.
resolve(33), new promise(
resolve => settimeout(() =>
resolve(66), 0)), 99, promise.reject(new error('an error')) ]) .then(values => console.log(values)); // [ // {status: "fulfilled", value: 33}, // {status: "fulfilled", value: 66}, // {status: "fulfilled", value: 99}, // {status: "rejected", reason: error: an error} // ] specifications specification ecmascript (ecma-262)the definition of 'promise.allsettled' in that specification.
for await...of - JavaScript
examples iterating over async iterables you can also iterate over an object that explicitly implements async iterable protocol: const asynciterable = { [symbol.asynciterator]() { return { i: 0, next() { if (this.i < 3) { return promise.
resolve({ value: this.i++, done: false }); } return promise.
resolve({ done: true }); } }; } }; (async function() { for await (let num of asynciterable) { console.log(num); } })(); // 0 // 1 // 2 iterating over async generators since the return values of async generators conform to the async iterable protocol, they can be looped using for await...of.
... function* generator() { yield 0; yield 1; yield promise.
resolve(2); yield promise.
resolve(3); yield 4; } (async function() { for await (let num of generator()) { console.log(num); } })(); // 0 // 1 // 2 // 3 // 4 // compare with for-of loop: for (let numorpromise of generator()) { console.log(numorpromise); } // 0 // 1 // promise { 2 } // promise { 3 } // 4 note: be aware of yielding rejected promises from sync generator.
... function* generatorwithrejectedpromises() { try { yield 0; yield 1; yield promise.
resolve(2); yield promise.reject(3); yield 4; throw 5; } finally { console.log('called finally') } } (async function() { try { for await (let num of generatorwithrejectedpromises()) { console.log(num); } } catch (e) { console.log('catched', e) } })(); // 0 // 1 // 2 // catched 3 // compare with for-of loop: try { for (let numorpromise of generatorwithrejectedpromises()) { console.log(numorpromise); } } catch (e) { console.log('catched', ...
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.
...this is because the ip behind your site’s domain will have already been
resolved by the time the browser sees the hint.
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.oldv...
...it
resolves with the stored compiled module, or rejects with an error.
... 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 operation to store a given wasm module in a given database.
url - Archive of obsolete content
base : string an optional string used to
resolve relative source urls into absolute ones.
...this function will automatically attempt to
resolve non-file protocols, such as the resource: protocol, to their place on the file system.
net/url - Archive of obsolete content
options : object optional options: name type sync boolean if this option is set to true, the promise returned will be
resolved synchronously.
... returns promise : the promise that will be
resolved with the content of the url given.
No Proxy For configuration - Archive of obsolete content
ut domain) hostname-only (see problems below) "localhost" also blocks any possible domains that start with the entry ("www.otherdomain.localhost") a hostname (with domain) domain name "www.mozilla.org" does not block hostnames or domains that end in the same string (other-www.mozilla.org) an ip address ip address "1.2.3.4" does not block hostnames that
resolve to the ip address ("127.0.0.1" does not block "localhost") a network network w/ cidr block "10.0.0.0/8" does not block hostnames that
resolve to the ip address range (10.0.0.0/8 is not "no proxy for intranet hostnames") optional - port-specific (optional) ":" + port number "<filter>:81" only black-lists port.
...filter comparison notable bugs bug 172083 - [meta] proxy: "no proxy for" items bug 80917 - proxy: "no proxy" w/ form based ui bug 91587 - proxy: "no proxy for" default domain filtering fails w/ non-fqdn (e.g., http://web/) bug 201685 - no proxy for: support ipv6 address literals bug 136789 - proxy: no proxy ip entries do not block dns
resolved ips bug 314712 - no proxy for: "hostname.domain.com" should block only "hostname.domain.com" bug 72444 - proxy: "bypass proxy server for local addresses" (ie pref) bug 260883 - "no proxy for" does not use fqdn wildcards "*" like ie bugzilla sources bug 17158 comment 21: the correct separator are spaces or commas.
Documentation for BiDi Mozilla - Archive of obsolete content
in a bidi-enabled document, the following things happen: during a reflow, nsbidipresutils::
resolve is called.
... implementation of the unicode bidi algorithm nsiubidiutils intl\unicharutil\public\nsiubidiutils.h intl\unicharutil\src\nsbidiutilsimp.cpp utilities for bidi processing, including: character classification symmetric swapping reordering shaping numeric translation conversion to/from presentation forms nsbidipresutils layout/base/nsbidipresutils.cpp utilities for the layout engine including:
resolve frames by bidi level split framesreorder frames format bidi text support for deletion and insertion of frames by editor nsbiditextframe layout/generic/nsbidiframes.cpp subclass of nsframe with additional method setoffsets, to adjust mcontentoffset and mcontentlength during bidi processing nsdirectionalframe layout/generic/nsbidiframes.cpp subclass of nsframethis is a special frame which re...
Application Update - Archive of obsolete content
pref("app.update.showinstalledui", false); // 0 = suppress prompting for incompatibilities if there are updates available // to newer versions of installed addons that
resolve them.
... // 1 = suppress prompting for incompatibilities only if there are versioninfo // updates available to installed addons that
resolve them, not newer // versions.
NSPR Release Engineering Guide - Archive of obsolete content
feature complete update ...pr/include/prinit.h with release numbers build all targets, debug and optimized on all platforms using local directories run the test suite on all targets verify release numbers show up in binaries
resolve testing anomalies tag the tree with nsprpub_release_x_y_z_beta beta release checkout a whole new tree using the tag from above build all targets, debug and optimized on all platforms using the command: gmake release mdist=<dir>/mdist build_number=vx.y.z [build_opt=1 | use_debug_rtl=1] copy the bits from mdist to /share/builds/components/nspr20/.vx.y.z 1 run explode.pl run the ...
...test suite on all targets, using binaries & headers from shipped bits
resolve testing anomalies tag the tree with nsprpub_release_x_y[_z] release candidate checkout a whole new tree using tag (including fixes) tag the treey with nsprpub_release_x_y_z build all targets, debug and optimized on all platforms using the command: gmake release mdist=<dir>/mdist build_number=vx.y.z [build_opt=1 | use_debug_rtl=1] copy the bits from mdist to /share/builds/components/nspr20/.vx.y.z in /share/builds/components/nspr20/ run the following scripts: explode.pl rename.sh symlink.sh rtm bits rename the .vx.y.z directory to vx.y.z (remove the hidden directory 'dot').
HTML forms in legacy browsers - Learn web development
<button> the <button> element suffered from two issues that are now
resolved: a bug in old versions of internet explorer sent the html content available between the starting and ending tag of the <button> element instead of the content of the value attribute when clicked.
...while
resolved in all modern browsers, it is still recommended to always set the type attribute on <button> elements.
Choosing the right approach - Learn web development
32firefox android full support 29opera android full support 19safari ios full support 8samsung internet android full support 2.0nodejs full support 0.12
resolve()chrome full support 32edge full support 12firefox full support 29ie no support noopera full support 19safari full support 8webvi...
...ch operation for resource "${url}": ` + e.message); }); } // call the fetchanddecode() method to fetch the images and the text, and store their promises in variables let coffee = fetchanddecode('coffee.jpg', 'blob'); let tea = fetchanddecode('tea.jpg', 'blob'); let description = fetchanddecode('description.txt', 'text'); // use promise.all() to run code only when all three function calls have
resolved promise.all([coffee, tea, description]).then(values => { console.log(values); // store each value returned from the promises in separate variables; create object urls from the blobs let objecturl1 = url.createobjecturl(values[0]); let objecturl2 = url.createobjecturl(values[1]); let desctext = values[2]; // display the images in <img> elements let image1 = document.createelement('...
Setting up your own test automation environment - Learn web development
e_test.js test for example, we included this block: driver.sleep(2000).then(function() { driver.gettitle().then(function(title) { if(title === 'webdriver - google search') { console.log('test passed'); } else { console.log('test failed'); } }); }); the sleep() method accepts a value that specifies the time to wait in milliseconds — the method returns a promise that
resolves at the end of that time, at which point the code inside the then() executes.
...this example uses a long chain of promises to run all the steps required in our test — the promise-based methods webdriver uses need to
resolve for it to work properly.
HTMLIFrameElement.executeScript()
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.result); // 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.
DownloadTarget
if the download is in progress or has been finalized, this method does nothing and returns a
resolved promise.
... promise
resolves to undefined when the state of the download has been updated.
PromiseUtils.jsm
to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/promiseutils.jsm"); method overview deferred defer(); methods defer() creates a new pending promise and provides methods to
resolve or reject this promise.
... return value a new object, containing the new promise in the promise property, and the methods to change its state in the
resolve and reject properties.
Uplifting a localization from Central to Aurora
there is one scenario where you don't want to have the conflicts
resolved outside of the actual merge: en-us on central changed, in a way that doesn't make sense on aurora.
...that's gonna conflict, and you need to
resolve that with your merge tool so that the resulting localized file doesn't have the string any more.
Mozilla Style System Documentation
these three types of style contexts correspond to the three ways of creating a style context: nsiprescontext::
resolvestylecontextfor, nsiprescontext::
resolvepseudostylecontextfor, and.nsiprescontext::
resolvestylecontextfornonelement there is also a fourth method, nsiprescontext::probepseudostylecontextfor, which creates a style context only if there are style rules that match the pseudo-element.
... dynamic changes describe nsframemanager::re
resolvestylecontext and nsiframe::getparentstylecontextframe ...</p> describe nscssframeconstructor::attributechanged hack for style attribute that avoids style context tree manipulation.
NSS 3.15.2 release notes
distribution information nss 3.15.2 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_2_rtm/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.15.2.
... a complete list of all bugs
resolved in this release can be obtained at https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&target_milestone=3.15.2&product=nss&list_id=7982238 compatibility nss 3.15.2 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.15.3.1 release notes
nss 3.15.3.1 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_3_1_rtm/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.15.3.1.
...bugs fixed in nss 3.15.3.1 bug 946351 - misissued google certificates from dcssi a complete list of all bugs
resolved in this release can be obtained at https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&target_milestone=3.15.3.1&product=nss compatibility nss 3.15.3.1 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.15.3 release notes
nss 3.15.3 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_3_rtm/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.15.3.
...bugs fixed in nss 3.15.3 bug 850478 - list rc4_128 cipher suites after aes_128 cipher suites bug 919677 - don't advertise tls 1.2-only ciphersuites in a tls 1.1 clienthello a complete list of all bugs
resolved in this release can be obtained at https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&target_milestone=3.15.3&product=nss compatibility nss 3.15.3 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.15.4 release notes
nss 3.15.4 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_4_rtm/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.15.4.
... bugs fixed in nss 3.15.4 a complete list of all bugs
resolved in this release can be obtained at https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&target_milestone=3.15.4&product=nss compatibility nss 3.15.4 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.19.2.1 release notes
nss 3.19.2.1 and nspr 4.10.10 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_19_2_1_rtm/src/ https://ftp.mozilla.org/pub/nspr/releases/v4.10.10/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.19.2.1.
... the following security-relevant bugs have been
resolved in nspr 4.10.10, which affect nss.
NSS 3.19.4 release notes
nss 3.19.4 and nspr 4.10.10 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_19_4_rtm/src/ https://ftp.mozilla.org/pub/nspr/releases/v4.10.10/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.19.4.
... the following security-relevant bugs have been
resolved in nspr 4.10.10, which affect nss.
NSS 3.20.1 release notes
nss 3.20.1 and nspr 4.10.10 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_20_1_rtm/src/ https://ftp.mozilla.org/pub/nspr/releases/v4.10.10/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.20.1.
... the following security-relevant bugs have been
resolved in nspr 4.10.10, which affect nss.
Proxies in Necko
nsiprotocolproxyservice the most important function on nsiprotocolproxyservice is
resolve.
...if this protocol handler does not support proxies,
resolve returns null.
How to embed the JavaScript engine
*/ static jsclass global_class = { "global", jsclass_global_flags, js_propertystub, js_deletepropertystub, 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 (jsautorequest, rootedobject), so they all go // out of scope before we js_destroycontext.
...*/ static jsclass global_class = { "global", jsclass_global_flags, js_propertystub, js_deletepropertystub, js_propertystub, js_strictpropertystub, js_enumeratestub, js_
resolvestub, 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 (j...
JSAPI User Guide
static jsclass globalclass = { "global", jsclass_global_flags, js_propertystub, js_deletepropertystub, js_propertystub, js_strictpropertystub, js_enumeratestub, js_
resolvestub, js_convertstub, nullptr, nullptr, nullptr, nullptr, js_globalobjecttracehook }; // the error reporter callback.
...*/ my_addproperty, my_delproperty, my_getproperty, my_setproperty, my_enumerate, my_
resolve, my_convert, my_finalize }; jsobject *obj; /* * define an object named in the global scope that can be enumerated by * for/in loops.
JS_AlreadyHasOwnProperty
the object's jsclass.
resolve hook is not called, so lazily defined properties are not found.
... (this is the only api that can directly detect that a lazily
resolved property has not yet been
resolved.) shared, permanent, delegated properties are not found.
JS_EnumerateStandardClasses
description the global object's class's enumerate op should call js_enumeratestandardclasses(cx, obj), to define eagerly during for...in loops any classes not yet
resolved lazily.
... see also mxr id search for js_enumeratestandardclasses js_
resolvestandardclass ...
SpiderMonkey 38
tringroot (bug 1107639) js::addvalueroot (bug 1107639) js::removeobjectroot (bug 1107639) js::removeobjectrootrt (bug 1107639) js::removescriptroot (bug 1107639) js::removescriptrootrt (bug 1107639) js::removestringroot (bug 1107639) js::removestringrootrt (bug 1107639) js::removevalueroot (bug 1107639) js::removevaluerootrt (bug 1107639) jsclass_new_enumerate (bug 1097267) jsclass_new_
resolve (bug 993026) jsid_is_object (bug 915482) jsnew
resolveop (bug 993026) jsval_is_boolean (bug 952650) jsval_is_double (bug 952650) jsval_is_gcthing (bug 952650) jsval_is_int (bug 952650) jsval_is_null (bug 952650) jsval_is_number (bug 952650) jsval_is_primitive (bug 952650) jsval_is_string (bug 952650) jsval_is_void (bug 952650) jsval_to_boolean (bug 952650) jsval_to_double (bug 952650)...
...9) js_getstringcharsandlength (bug 1037869) js_getstringcharsz (bug 1037869) js_getstringcharszandlength (bug 1037869) js_gettypename (bug 1037718) js_isabouttobefinalized (bug 650161) js_lookupelement (bug 1094176) js_lookupproperty (bug 1094176) js_lookuppropertybyid (bug 1094176) js_lookupucproperty (bug 1094176) js_newpropertyiterator (bug 1081660) js_nextproperty (bug 1081660) js_
resolvestub (bug 1103152) js_setfinalizecallback (bug 996785) js_setfunctioncallback (bug 1103269) jschar (bug 1063962) api changes jschar, a typedef for the standard c++ type char16_t, has been removed.
Split object
the window object split objects were introduced to
resolve a problem posed by the window object.
...the window object's jsclass.
resolve hook ensures that properties of the inner object are visible via the outer object, if the running code has the right principals to access them.
Feed content access API
) { doc.write("<i>no news is good news!</i>"); } else { var i; var theentry; var theurl; var info; for (i=0; i<numitems; i++) { theentry = itemarray.queryelementat(i, components.interfaces.nsifeedentry); if (theentry) { theurl = doc.write('<b><a href="' + theentry.link.
resolve("") + '">' + theentry.title.text + '</a></b><br>'); if (theentry.summary) { info = theentry.summary.text + "<p><hr><p>"; } else { info = theentry.content.text + "<p><hr><p>"; } doc.write("<blockquote>" + info); doc.write("</blockquote><p>"); } } } ...
...the full url of the link is retrieved using the link's
resolve() method.
Index
389 nsicharset
resolver interfaces, interfaces:scriptable, obsolete, xpcom, xpcom interface reference some implementations may request that they be notified when the charset is actually detected.
...the listener will passed to async
resolve will be notified immediately with a status code of ns_error_abort.
NS_NewLocalFile
afollowlinks [in] this attribute will determine if the nsilocalfile instance will automatically
resolve symbolic links.
...on windows, passing true causes shortcuts to be automatically
resolved, and on macos, passing true causes finder aliases to be automatically
resolved.
NS_NewNativeLocalFile
afollowlinks [in] this attribute will determine if the nsilocalfile instance will automatically
resolve symbolic links.
...on windows, passing true causes shortcuts to be automatically
resolved, and on macos, passing true causes finder aliases to be automatically
resolved.
mozIJSSubScriptLoader
this object will be searched for variables that cannot be
resolved in the subscript scope.
...this object will be searched for variables that cannot be
resolved in the subscript scope.
nsIDNSListener
void onlookupcomplete( in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus ); parameters arequest the value returned from async
resolve.
... arecord the dns record corresponding to the hostname that was
resolved.
nsIFaviconService
the moz-anno protocol handler's special case for "favicon" annotations will
resolve invalid icons to the default icon, although without caching.
...the moz-anno protocol handler's special case for "favicon" annotations will detect most invalid icons and it will
resolve to the default icon, although without caching.
nsINavHistoryQuery
long transitions); void setfolders([const,array, size_is(foldercount)] in long long folders, in unsigned long foldercount); void settransitions([const,array, size_is(count)] in unsigned long transitions, in unsigned long count); attributes attribute type description absolutebegintime prtime read only: retrieves the begin time value that the currently loaded reference points + offset
resolve to.
... absoluteendtime prtime read only: retrieves the end time value that the currently loaded reference points + offset
resolve to.
nsIProxyInfo
some special values for this attribute include (but are not limited to) the following: "http" - http proxy (or ssl connect for https) "socks" - socks v5 proxy "socks4" - socks v4 proxy "direct" - no proxy "unknown" - unknown proxy (see nsiprotocolproxyservice.
resolve()) a future version of this interface may define additional types.
... constant value description transparent_proxy_
resolves_host 1 << 0 this flag is set if the proxy is to perform name resolution itself.
nsITraceableChannel
holds chunks as they come, onstoprequest we join these junks to get the full source this.responsebody; // we'll set this to the this.responsestatuscode; this.deferreddone = { promise: null,
resolve: null, reject: null }; this.deferreddone.promise = new promise(function(
resolve, reject) { this.
resolve =
resolve; this.reject = reject; }.bind(this.deferreddone)); object.freeze(this.deferreddone); this.promisedone = this.deferreddone.promise; } tracinglistener.prototype = { ondataavailable: function(arequest, acontext, ainputstream, aoffset, acount) { var istream = new binaryinput...
...t, acount); }, onstartrequest: function(arequest, acontext) { this.originallistener.onstartrequest(arequest, acontext); }, onstoprequest: function(arequest, acontext, astatuscode) { this.responsebody = this.receivedchunks.join(""); delete this.receivedchunks; this.responsestatus = astatuscode; this.originallistener.onstoprequest(arequest, acontext, astatuscode); this.deferreddone.
resolve(); }, queryinterface: function(aiid) { if (aiid.equals(ci.nsistreamlistener) || aiid.equals(ci.nsisupports)) { return this; } throw cr.ns_nointerface; } }; var httpresponseobserver = { observe: function(asubject, atopic, adata) { var newlistener = new tracinglistener(); asubject.queryinterface(ci.nsitraceablechannel); newlistener.originallistener = asubject.setnewlistener(newl...
Animation.pause() - Web APIs
exceptions invalidstateerror the animation's currenttime is un
resolved (for example, if it's never been played or isn't currently playing) and the end time of the animation is positive infinity.
... throws an invalidstateerror if the animation's currenttime is un
resolved (perhaps it hasn't started playing yet) and the end time of the animation is positive infinity.
AudioContext.resume() - Web APIs
return value a promise that
resolves when the context has resumed.
...in each case, the text label of the button is updated as appropriate once the promise
resolves.
AudioContext.suspend() - Web APIs
}); returns a promise that
resolves with void.
...in each case, the text label of the button is updated as appropriate once the promise
resolves.
Blob.arrayBuffer() - Web APIs
the arraybuffer() method in the blob interface returns a promise that
resolves with the contents of the blob as binary data contained in an arraybuffer.
... returns a promise that
resolves with an arraybuffer that contains the blob's data in binary form.
Blob.text() - Web APIs
the text() method in the blob interface returns a promise that
resolves with a string containing the contents of the blob, interpreted as utf-8.
... returns a promise that
resolves with a usvstring which contains the blob's data as a text string.
Blob - Web APIs
instance methods blob.prototype.arraybuffer() returns a promise that
resolves with an arraybuffer containing the entire contents of the blob as binary data.
... blob.prototype.text() returns a promise that
resolves with a usvstring containing the entire contents of the blob interpreted as utf-8 text.
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).
... return value a promise that
resolves with boolean.
Bluetooth - Web APIs
methods bluetooth.getavailability() returns a promise that
resolved to a boolean indicating whether the user-agent has the ability to support bluetooth.
... 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().
connectGATT() - Web APIs
the bluetoothdevice.connectgatt() method returns a promise that
resolves to an instance of bluetoothgattremoteserver.
...}) returns a promise that
resolves to an instance of bluetoothgattremoteserver.
BluetoothDevice - Web APIs
methods bluetoothdevice.watchadvertisments() a promise that
resolves to undefined or is rejected with an error if advetisments can’t shown for any reason.
... bluetoothdevice.connectgatt() a promise that
resolves to an instance of bluetoothgattremoteserver.
BluetoothRemoteGATTCharacteristic.getDescriptors() - Web APIs
the bluetoothremotegattcharacteristic.getdescriptors() method returns a promise that
resolves to an array of all bluetoothgattdescriptor objects for a given descriptor uuid.
...}) returns a promise that
resolves to an array of bluetoothgattdescriptor objects.
BluetoothRemoteGATTCharacteristic.readValue() - Web APIs
the bluetoothremotegattcharacteristic.readvalue() method returns a promise that
resolves to a dataview holding a duplicate of the value property if it is available and supported.
...}) returns a promise that
resolves to an dataview.
readValue() - Web APIs
the bluetoothremotegattdescriptor.readvalue() method returns a promise that
resolves to an arraybuffer holding a duplicate of the value property if it is available and supported.
...}) returns a promise that
resolves to an arraybuffer.
Body.arrayBuffer() - Web APIs
it returns a promise that
resolves with an arraybuffer.
... return value a promise that
resolves with an arraybuffer.
Body.blob() - Web APIs
it returns a promise that
resolves with a blob.
... return value a promise that
resolves with a blob.
Body.formData() - Web APIs
it returns a promise that
resolves with a formdata object.
... return value a promise that
resolves with a formdata object.
Body.json() - Web APIs
it returns a promise that
resolves with the result of parsing the body text as json.
... return value a promise that
resolves to a javascript object.
Body.text() - Web APIs
it returns a promise that
resolves with a usvstring object (text).
... return value a promise that
resolves with a usvstring.
BudgetService.getBudget() - Web APIs
the getbudget() property of the budgetservice interface returns a promise that
resolves to an array of budgetstate objects indicating the expected state of the budget at times in the future.
... returns a promise that
resolves to an instance of budgetstate.
BudgetService.getCost() - Web APIs
the getcost() property of the budgetservice interface returns a promise that
resolves to a double indicating the worst-case background operation cost of the provided background operation.
... returns a promise that
resolves to a number.
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.
...}); parameters operation desc returns a promise that
resolves to a boolean.
Cache.keys() - Web APIs
the keys() method of the cache interface returns a promise that
resolves to an array of cache keys.
... return value a promise that
resolves to an array of cache keys.
CacheStorage.has() - Web APIs
the has() method of the cachestorage interface returns a promise that
resolves to true if a cache object matches the cachename.
... return value a promise that
resolves to true if the cache exists or false if not.
CacheStorage.keys() - Web APIs
the keys() method of the cachestorage interface returns a promise that will
resolve with an array containing strings corresponding to all of the named cache objects tracked by the cachestorage object in the order they were created.
... return value a promise that
resolves with an array of the cache names inside the cachestorage object.
Clipboard.read() - Web APIs
the read() method of the clipboard interface requests a copy of the clipboard's contents, delivering the data to the returned promise when the promise is
resolved.
... return value a promise that
resolves with a datatransfer object containing the clipboard's contents.
Clipboard.readText() - Web APIs
the clipboard interface's readtext() method returns a promise which
resolves with a copy of the textual contents of the system clipboard..
... return value a promise that
resolves with a domstring containing the textual contents of the clipboard.
ClipboardItem.getType() - Web APIs
the gettype() method of the clipboarditem interface returns a promise that
resolves with a blob of the requested mime type or an error if the mime type is not found.
... return value a promise that
resolves with a blob object.
ContentIndex.getAll() - Web APIs
the getall() method of the contentindex interface returns a promise that
resolves with an iterable list of content index entries.
... return value returns a promise that
resolves with an array of contentdescription items.
CredentialsContainer - Web APIs
methods credentialscontainer.create()secure context returns a promise that
resolves with a new credential instance based on the provided options, or null if no credential object can be created.
... credentialscontainer.get()secure context returns a promise that
resolves with the credential instance that matches the provided parameters.
DirectoryReaderSync - Web APIs
you can also use the filesystem: url to look up the entry with
resolvelocalfilesystemurl().
... window.
resolvelocalfilesystemurl = window.
resolvelocalfilesystemurl || window.webkit
resolvelocalfilesystemurl; // create web workers var worker = new worker('worker.js'); worker.onmessage = function(e) { var urls = e.data.entries; urls.foreach(function(url, i) { window.
resolvelocalfilesystemurl(url, function(fileentry) { // print out file's name.
Element.requestFullscreen() - Web APIs
if permission to enter full screen mode is granted, the returned promise will
resolve and the element will receive a fullscreenchange event to let it know that it's now in full screen mode.
... return value a promise which is
resolved with a value of undefined when the transition to full screen is complete.
ExtendableEvent - Web APIs
examples this code snippet is from the service worker prefetch sample (see prefetch example live.) the code calls extendableevent.waituntil() in serviceworkerglobalscope.oninstall, delaying treating the serviceworkerregistration.installing worker as installed until the passed promise
resolves successfully.
... the promise
resolves when all resources have been fetched and cached, or else when any exception occurs.
FetchEvent.navigationPreload - Web APIs
the navigationpreload read-only property of the fetchevent interface returns a promise that
resolves to the instance of navigationpreloadmanager associated with the current service worker registration.
... syntax var promise = fetchevent.navigationpreload value a promise that
resolves to the instance of navigationpreloadmanager.
Fetch API - Web APIs
it returns a promise that
resolves to the response to that request, whether it is successful or not.
...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.
File - Web APIs
it returns a promise that
resolves with a usvstring (text).
...it returns a promise that
resolves with an arraybuffer.
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().
FontFace.load - Web APIs
the load() method of the fontface interface loads a font based on current object's constructor-passed requirements, including a location or source buffer, and returns a promise that
resolves with the current fontface object.
... return value a promise that
resolves with a reference to the current fontface object when the font loads or rejects with a networkerror if the loading process fails.
FontFace.loaded - Web APIs
the loaded read-only property of the fontface interface returns a promise that
resolves with the current fontface object when the font specified in the object's constructor is done loading or rejects with a syntaxerror.
... syntax var apromise = fontface.loaded; value a promise that
resolves with the current fontface object.
FontFace - Web APIs
fontface.loaded read only returns a promise that
resolves with the current fontface object when the font specified in the object's constructor is done loading or rejects with a syntaxerror.
... fontface.load() loads a font based on current object's constructor-passed requirements, including a location or source buffer, and returns a promise that
resolves with the current fontface object.
FontFaceSet.ready - Web APIs
the ready readonly property of the fontfaceset interface returns a promise that
resolves to the given fontfaceset.
...}); returns a promise that
resolves to the given fontfaceset.
FontFaceSet - Web APIs
fontfaceset.ready read only promise which
resolves once font loading and layout operations have completed.
... fontfaceset.load() returns a promise which
resolves to a list of font-faces for a requested font.
Fullscreen API - Web APIs
returns a promise which is
resolved once full-screen mode has been completely shut off.
...returns a promise which is
resolved once full-screen mode has been activated.
HTMLMediaElement.setMediaKeys() - Web APIs
the setmediakeys() property of the htmlmediaelement interface returns a promise that
resolves to the passed mediakeys, which are those used to decrypt media during playback.
... returns a promise that
resolves to the passed instance of mediakeys.
ImageCapture.getPhotoCapabilities() - Web APIs
the getphotocapabilities() method of the imagecapture interface returns a promise that
resolves with a photocapabilities object containing the ranges of available configuration options.
... syntax const capabilitiespromise = imagecaptureobj.getphotocapabilities() return value a promise that
resolves with a photocapabilities object.
ImageCapture.getPhotoSettings() - Web APIs
the getphotosettings() method of the imagecapture interface returns a promise that
resolves with a photosettings object containing the current photo configuration settings.
... syntax const settingspromise = imagecapture.getphotosettings() return value a promise that
resolves with a photosettings object containing the following properties: filllightmode: the flash setting of the capture device, one of "auto", "off", or "on".
ImageCapture.grabFrame() - Web APIs
the grabframe() method of the imagecapture interface takes a snapshot of the live video in a mediastreamtrack and returns a promise that
resolves with a imagebitmap containing the snapshot.
... syntax const bitmappromise = imagecapture.grabframe() return value a promise that
resolves to an imagebitmap object.
ImageCapture.takePhoto() - Web APIs
the takephoto() method of the imagecapture interface takes a single exposure using the video capture device sourcing a mediastreamtrack and returns a promise that
resolves with a blob containing the data.
... return value a promise that
resolves with a blob.
InstallEvent - Web APIs
examples this code snippet is from the service worker prefetch sample (see prefetch running live.) the code calls extendableevent.waituntil() in serviceworkerglobalscope.oninstall and delays treating the serviceworkerregistration.installing worker as installed until the passed promise
resolves successfully.
... the promise
resolves when all resources have been fetched and cached, or when any exception occurs.
Keyboard.getLayoutMap() - Web APIs
the getlayoutmap() method of the keyboard interface returns a promise that
resolves with an instance of keyboardlayoutmap which is a map-like object with functions for retrieving the strings associated with specific physical keys.
... return value a promise that
resolves with an instance of keyboardlayoutmap.
LockManager.query() - Web APIs
the query() method of the lockmanager interface returns a promise which
resolves with an object containing information about held and pending locks.
... return value a promise that
resolves with a lockmanagersnapshot containing the following properties.
LockManager.request() - Web APIs
the requested lock is passed to a callback, while the function itself returns a promise that
resolves with undefined.
... callback … return value a promise that
resolves with undefined when the request is granted.
MediaDevices.getDisplayMedia() - Web APIs
return value a promise that
resolves to a mediastream containing a video track whose contents come from a user-selected screen area, as well as an optional audio track.
... 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.
load() - Web APIs
the mediakeysession.load() method returns a promise that
resolves to a boolean value after loading data for a specified session object.
... return value a promise that
resolves to a boolean indicating whether the load succeeded or failed.
MediaStreamTrack.applyConstraints() - Web APIs
this object represents the basic set of constraints that must apply for the promise to
resolve.
... return value a promise which
resolves when the constraints have been successfully applied.
Capabilities, constraints, and settings - Web APIs
ints, audio: audioconstraints }).then(function(stream) { let audiotracks = stream.getaudiotracks(); let videotracks = stream.getvideotracks(); videoelement.srcobject = stream; if (audiotracks.length) { audiotrack = audiotracks[0]; } if (videotracks.length) { videotrack = videotracks[0]; } }).then(function() { return new promise(function(
resolve) { videoelement.onloadedmetadata =
resolve; }); }).then(function() { getcurrentsettings(); }).catch(handleerror); } there are several steps here: it calls buildconstraints() to create the mediatrackconstraints objects for the two tracks from the code in the edit boxes.
... then we set up a promise which
resolves when the onloadedmetadata event occurs on the video element.
Navigator.getBattery() - Web APIs
it returns a battery promise, which is
resolved in a batterymanager object providing also some new events you can handle to monitor the battery status.
... syntax var batterypromise = navigator.getbattery(); return value a promise which, when
resolved, calls its fulfillment handler with a single parameter: a batterymanager object which you can use to get information about the battery's state.
PaymentResponse.complete() - Web APIs
this method must be called after the user accepts the payment request and the promise returned by the paymentrequest.show() method is
resolved.
... return value a promise which
resolves with no input value once the payment interface has been fully closed.
PaymentResponse.onpayerdetailchange - Web APIs
response.onpayerdetailchange = async ev => { const promisestovalidate = []; const { payername, payeremail, payerphone } = response; // validate each value which changed by calling a function // that validates each type of data, returning a promise which //
resolves if the data is valid.
...e !== payername) { promisestovalidate.push(validatename(payername)); oldpayername = payername; } if (oldpayeremail !== payeremail) { promisestovalidate.push(validateemail(payeremail)); oldpayeremail = payeremail; } if (oldpayerphone !== payerphone) { promisestovalidate.push(validatephone(payerphone)); oldpayerphone = payerphone; } // as each validation promise
resolves, add the results of the // validation to the errors list const errors = await promise.all(promisestovalidate).then(results => results.reduce((errors, result), object.assign(errors, result)) ); // if we found any errors, wait for them to be corrected if (object.getownpropertynames(errors).length) { await response.retry(errors); } else { // we have a good payment; send t...
PaymentResponse: payerdetailchange event - Web APIs
response.onpayerdetailchange = async ev => { const promisestovalidate = []; const { payername, payeremail, payerphone } = response; // validate each value which changed by calling a function // that validates each type of data, returning a promise which //
resolves if the data is valid.
...e !== payername) { promisestovalidate.push(validatename(payername)); oldpayername = payername; } if (oldpayeremail !== payeremail) { promisestovalidate.push(validateemail(payeremail)); oldpayeremail = payeremail; } if (oldpayerphone !== payerphone) { promisestovalidate.push(validatephone(payerphone)); oldpayerphone = payerphone; } // as each validation promise
resolves, add the results of the // validation to the errors list const errors = await promise.all(promisestovalidate).then(results => results.reduce((errors, result), object.assign(errors, result)) ); // if we found any errors, wait for them to be corrected if (object.getownpropertynames(errors).length) { await response.retry(errors); } else { // we have a good payment; send t...
Using the Permissions API - Web APIs
depending on the value of the state property of the permissionstatus object returned when the promise
resolves, it reacts differently: "granted" the "enable geolocation" button is hidden, as it isn't needed if geolocation is already active.
...this works in exactly the same way as the permissions.query() method, except that it causes an existing permission to be reverted back to its default state when the promise successfully
resolves (which is usually prompt).
PublicKeyCredential - Web APIs
publickeycredential.isuserverifyingplatformauthenticatoravailable()secure context a static method returning a promise which
resolves to true if an authenticator bound to the platform is capable of verifying the user.
... with the current state of implementation, this method only
resolves to true when windows hello is available on the system.
PushManager.permissionState() - Web APIs
the permissionstate() method of the pushmanager interface returns a promise that
resolves to a domstring indicating the permission state of the push manager.
... returns a promise that
resolves to a domstring with a value of 'prompt', 'denied', or 'granted'.
PushManager.subscribe() - Web APIs
it returns a promise that
resolves to a pushsubscription object containing details of a push subscription.
... returns a promise that
resolves to a pushsubscription object.
PushSubscription.unsubscribe() - Web APIs
the unsubscribe() method of the pushsubscription interface returns a promise that
resolves to a boolean when the current subscription is successfully unsubscribed.
... returns a promise that
resolves to a boolean when the current subscription is successfully unsubscribed.
RTCPeerConnection.iceConnectionState - Web APIs
this is a less stringent test than "failed" and may trigger intermittently and
resolve just as spontaneously on less reliable networks, or during temporary disconnections.
... when the problem
resolves, the connection may return to the "connected" state.
RTCPeerConnection: peeridentity event - Web APIs
instead of using this event to detect when an identity is available, simply wait for the promise returned by rtcpeerconnection.peeridentity to be
resolved.
... once
resolved, its value is the new identity.
SVGImageElement.decode - Web APIs
the decode() method of the svgimageelement interface initiates asynchronous decoding of an image, returning a promise that
resolves once the image data is ready for use.
... return value a promise which
resolves once the image data is ready to be used, such as by appending it to the dom, replacing an existing image, and so forth.
Screen Capture API - Web APIs
to start capturing video from the screen, you call getdisplaymedia() on the instance of media navigator.mediadevices: capturestream = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); the promise returned by getdisplaymedia()
resolves to a mediastream which streams the captured media.
...similar to getusermedia(), this method creates a promise that
resolves with a mediastream containing the display area selected by the user, in a format that matches the specified options.
ServiceWorkerContainer.ready - Web APIs
once that condition is met, it
resolves with the serviceworkerregistration.
...}); value a promise that will never reject, and which may eventually
resolve with a serviceworkerregistration.
ServiceWorkerGlobalScope - Web APIs
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.
ServiceWorkerRegistration.unregister() - Web APIs
the promise will
resolve to false if no registration was found, otherwise it
resolves to true irrespective of whether unregistration happened or not (it may not unregister if someone else just called serviceworkercontainer.register() with the same scope.) the service worker will finish any ongoing operations before it is unregistered.
... return value promise
resolves with a boolean indicating whether the service worker has unregistered or not.
ServiceWorkerState - Web APIs
during this state, extendableevent.waituntil() can be called inside the install event handler to extend the life of the installing worker until the passed promise
resolves successfully.
...during this state, extendableevent.waituntil() can be called inside the onactivate event handler to extend the life of the active worker until the passed promise
resolves successfully.
StorageManager.estimate() - Web APIs
this method operates asynchronously, so it returns a promise which
resolves once the information is available.
... return value a promise that
resolves to an object which conforms to the storageestimate dictionary.
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.
... return value a promise that
resolves to a boolean.
StorageManager.persisted() - Web APIs
the persisted() method of the storagemanager interface returns a promise that
resolves to true if box mode is persistent for your site's storage.
... returns a promise that
resolves to a boolean.
SubtleCrypto.unwrapKey() - Web APIs
takes an array containing the bytes, and returns a promise that will
resolve to a cryptokey representing the secret key.
...takes an array containing the bytes, and returns a promise that will
resolve to a cryptokey representing the private key.
SyncManager.register() - Web APIs
the syncmanager.register method of the syncmanager interface returns a promise that
resolves to a syncregistration instance.
...}) returns a promise that
resolves to an instance of syncregistration.
USB.getDevices() - Web APIs
the getdevices method of the usb interface returns a promise that
resolves with an array of usbdevice objects for paired attached devices.
... return value a promise that
resolves with an array of usbdevice objects.
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.
...each filter object can have the following properties: vendorid productid classcode subclasscode protocolcode serialnumber return value a promise that
resolves with an instance of usbdevice.
USB - Web APIs
methods usb.getdevices() returns a promise that
resolves with an array of usbdevice objects for paired attached devices.
... usb.requestdevice() returns a promise that
resolves with an instance of usbdevice if the specified device is found.
USBDevice.controlTransferOut() - Web APIs
the controltransferout() method of the usbdevice interface returns a promise that
resolves with a usbouttransferresult when a command or status operation has been transmitted to the usb device.
... return value a promise that
resolves with a usbouttransferresult.
USBDevice.isochronousTransferIn() - Web APIs
the isochronoustransferin() method of the usbdevice interface returns a promise that
resolves with a usbisochronousintransferresult when time sensitive information has been transmitted received from the usb device.
... return value a promise that
resolves with a usbisochronousintransferresult specifications specification status comment webusbthe definition of 'isochronoustransferin()' in that specification.
USBDevice.isochronousTransferOut() - Web APIs
the isochronoustransferout() method of the usbdevice interface returns a promise that
resolves with a usbisochronousouttransferresult when time sensitive information has been transmitted to the usb device.
... return value a promise that
resolves with a usbisochronousouttransferresult.
USBDevice.transferOut() - Web APIs
the transferout() method of the usbdevice interface returns a promise that
resolves with a usbtransferoutresult when bulk or interrupt data is sent to the usb device.
... return value a promise that
resolves with a usbtransferoutresult.
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.
... return value a promise that
resolves with a wakelocksentinel object.
WakeLockSentinel.release() - Web APIs
the release() method of the wakelocksentinel interface releases the wakelocksentinel, returning a promise that is
resolved once the sentinel has been successfully released.
... return value returns a promise that
resolves with undefined exceptions no exceptions are thrown.
WebGL best practices - Web APIs
non-blocking async data download/readback the approach in webgl 2 is analogous to the approach in opengl: https://jdashg.github.io/misc/async-gpu-downloads.html function clientwaitasync(gl, sync, flags, interval_ms) { return new promise((
resolve, reject) => { function test() { const res = gl.clientwaitsync(sync, flags, 0); if (res == gl.wait_failed) { reject(); return; } if (res == gl.timeout_expired) { settimeout(test, interval_ms); return; }
resolve(); } test()); }); } async function getbuffersubdataasync( gl, target, buffer, srcbyteoffset, dstbuffer...
...this can be used to build an async-but-accurate function: window.getdevicepixelsize = window.getdevicepixelsize || async function(elem) { await new promise(fn_
resolve => { const observer = new resizeobserver(entries => { for (const cur of entries) { const dev_size = cur.devicepixelcontentboxsize; const ret = { width: dev_size[0].inlinesize, height: dev_size[0].blocksize, }; fn_
resolve(ret); observer.disconnect(); return; } thro...
WindowClient.focus() - Web APIs
the focus() method of the windowclient interface gives user input focus to the current client and returns a promise that
resolves to the existing windowclient.
... return value a promise that
resolves to the existing windowclient.
WindowClient.navigate() - Web APIs
the navigate() method of the windowclient interface loads a specified url into a controlled client page then returns a promise that
resolves to the existing windowclient.
... return value a promise that
resolves to the existing windowclient.
self.createImageBitmap() - Web APIs
it accepts a variety of different image sources, and returns a promise which
resolves to an imagebitmap.
... return value a promise which
resolves to an imagebitmap object containing bitmap data from the given rectangle.
WindowOrWorkerGlobalScope.queueMicrotask() - Web APIs
it creates a microtask by using a promise that
resolves immediately.
... if (typeof window.queuemicrotask !== "function") { window.queuemicrotask = function (callback) { promise.
resolve() .then(callback) .catch(e => settimeout(() => { throw e; })); // report exceptions }; } specifications specification status comment html living standardthe definition of 'self.queuemicrotask()' in that specification.
WritableStreamDefaultWriter.write() - Web APIs
the write() property of the writablestreamdefaultwriter interface writes a passed chunk of data to a writablestream and its underlying sink, then returns a promise that
resolves to indicate the success or failure of the write operation.
...ter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((
resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded;
resolve(); }); }, close() { var lis...
XPathEvaluator - Web APIs
methods xpathevaluator.createexpression() creates a parsed xpath expression with
resolved namespaces.
... xpathevaluator.createns
resolver() adapts any dom node to
resolve namespaces allowing the xpath expression to be evaluated relative to the context of the node where it appeared within the document.
XRSession.end() - Web APIs
the end() method shuts down the xrsession on which it's called, returning a promise which
resolves once the session has fully shut down.
... return value a promise that
resolves without a value after any platform-specific steps related to shutting down the session have completed.
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.
... xrreferencespace return value a promise that
resolves with an xrreferencespace object.
XRSession - Web APIs
returns a promise which
resolves when the session has been shut down.
...returns a promise which
resolves with the xrreferencespace or xrboundedreferencespace which was requested, or throws a notsupportederror if the requested space type isn't supported by the device.
Network Error Logging - HTTP
error", "url": "https://example.com/previous-page", "body": { "elapsed_time": 338, "method": "post", "phase": "application", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "137.205.28.66", "status_code": 400, "type": "http.error", "url": "https://example.com/bad-request" } } dns name not
resolved note that the phase is set to dns in this report and no server_ip is available to include.
... { "age": 20, "type": "network-error", "url": "https://example.com/previous-page", "body": { "elapsed_time": 18, "method": "post", "phase": "dns", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "", "status_code": 0, "type": "dns.name_not_
resolved", "url": "https://example-host.com/" } } the type of the network error may be one of the following pre-defined values from the specification, but browsers can add and send their own error types: dns.unreachable the user's dns server is unreachable dns.name_not_
resolved the user's dns server responded but was unable to
resolve an ip address for the requested uri.
Expressions and operators - JavaScript
expressions an expression is any valid unit of code that
resolves to a value.
... every syntactically valid expression
resolves to some value but conceptually, there are two types of expressions: with side effects (for example: those that assign value to a variable) and those that in some sense evaluate and therefore
resolve to a value.
TypeError: "x" is not a constructor - JavaScript
to do this, you would write the following function: function car(make, model, year) { this.make = make; this.model = model; this.year = year; } now you can create an object called mycar as follows: var mycar = new car('eagle', 'talon tsi', 1993); in promises when returning an immediately-
resolved or immediately-rejected promise, you do not need to create a new promise(...) and act on it.
... this is not legal (the promise constructor is not being called correctly) and will throw a typeerror: this is not a constructor exception: return new promise.
resolve(true); instead, use the promise.
resolve() or promise.reject() static methods: // this is legal, but unnecessarily long: return new promise((
resolve, reject) => {
resolve(true); }) // instead, return the static method: return promise.
resolve(true); return promise.reject(false); ...
Array.prototype.reduce() - JavaScript
console.log(doubledpositivenumbers); // [12, 4] running promises in sequence /** * runs promises from array of functions that can return promises * in chained manner * * @param {array} arr - promise arr * @return {object} promise object */ function runpromiseinsequence(arr, input) { return arr.reduce( (promisechain, currentfunction) => promisechain.then(currentfunction), promise.
resolve(input) ) } // promise function 1 function p1(a) { return new promise((
resolve, reject) => {
resolve(a * 5) }) } // promise function 2 function p2(a) { return new promise((
resolve, reject) => {
resolve(a * 2) }) } // function 3 - will be wrapped in a
resolved promise by .then() function f3(a) { return a * 3 } // promise function 4 function p4(a) { return new promise((reso...
...lve, reject) => {
resolve(a * 4) }) } const promisearr = [p1, p2, f3, p4] runpromiseinsequence(promisearr, 10) .then(console.log) // 1200 function composition enabling piping // building-blocks to use for composition const double = x => x + x const triple = x => 3 * x const quadruple = x => 4 * x // function composition enabling pipe functionality const pipe = (...functions) => input => functions.reduce( (acc, fn) => fn(acc), input ) // composed functions for multiplication of specific values const multiply6 = pipe(double, triple) const multiply9 = pipe(triple, triple) const multiply16 = pipe(quadruple, quadruple) const multiply24 = pipe(double, triple, quadruple) // usage multiply6(6) // 36 multiply9(9) // 81 multiply16(16) // 256 multiply24(10) // 240 write map u...
Intl.DateTimeFormat - JavaScript
intl.datetimeformat.prototype.
resolvedoptions() returns a new object with properties reflecting the locale and formatting options computed during initialization of the object.
...od of the day options = {hour: "numeric", dayperiod: "short"}; console.log(new intl.datetimeformat('en-us', options).format(date)); // → 10 at night the used calendar and numbering formats can also be set independently via options arguments: var options = {calendar: 'chinese', numberingsystem: 'arab'}; var dateformat = new intl.datetimeformat('default', options); var usedoptions = dateformat.
resolvedoptions(); console.log(usedoptions.calendar); // → "chinese" console.log(usedoptions.numberingsystem); // → "arab" console.log(usedoptions.timezone); // → "america/new_york" (the users default timezone) specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.datetimeformat' in that specification.
async function expression - JavaScript
examples simple example function
resolveafter2seconds(x) { return new promise(
resolve => { settimeout(() => {
resolve(x); }, 2000); }); }; const add = async function(x) { // async function expression assigned to a variable let a = await
resolveafter2seconds(20); let b = await
resolveafter2seconds(30); return x + a + b; }; add(10).then(v => { console.log(v); // prints 60 after 4 seconds.
... }); (async function(x) { // async function expression used as an iife let p_a =
resolveafter2seconds(20); let p_b =
resolveafter2seconds(30); return x + await p_a + await p_b; })(10).then(v => { console.log(v); // prints 60 after 2 seconds.
var - JavaScript
when attempting to
resolve a name to a value, the scope chain is searched.
... bla = 2; var bla; // ...is implicitly understood as: var bla; bla = 2; for that reason, it is recommended to always declare variables at the top of their scope (the top of global code and the top of function code) so it's clear which variables are function scoped (local) and which are
resolved on the scope chain.
with - JavaScript
consider this example: function f(foo, values) { with (foo) { console.log(values); } } if you call f([1,2,3], obj) in an ecmascript 5 environment, then the values reference inside the with statement will
resolve to obj.
...so, in a javascript environment that supports ecmascript 2015, the values reference inside the with statement could
resolve to [1,2,3].values.
Autoplay guide for media and Web Audio APIs - Web media technologies
play() returns a promise which is
resolved once the media successfully begins to play, and is rejected when playback fails to begin (such as if autoplay is denied).
... if the promise returned by play() is
resolved without error, the then() clause is run and can begin whatever needs to be done when autoplay has begun.
dx - SVG: Scalable Vector Graphics
the unit used to
resolve the value of the attribute is set by the primitiveunits attribute of the <filter> element.
...the unit used to
resolve the value of the attribute is set by the primitiveunits attribute of the <filter> element.
dy - SVG: Scalable Vector Graphics
the unit used to
resolve the value of the attribute is set by the primitiveunits attribute of the <filter> element.
...the unit used to
resolve the value of the attribute is set by the primitiveunits attribute of the <filter> element.
viewBox - SVG: Scalable Vector Graphics
t:100% } svg:not(:root) { display: inline-block; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- with relative unit such as percentage, the visual size of the square looks unchanged regardless of the viewbox --> <rect x="0" y="0" width="100%" height="100%"/> <!-- with a large viewbox the circle looks small as it is using user units for the r attribute: 4
resolved against 100 as set in the viewbox --> <circle cx="50%" cy="50%" r="4" fill="white"/> </svg> <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <!-- with relative unit such as percentage, the visual size of the square looks unchanged regardless of the viewbox` --> <rect x="0" y="0" width="100%" height="100%"/> <!-- with a small viewbox the circle looks large as it ...
...is using user units for the r attribute: 4
resolved against 10 as set in the viewbox --> <circle cx="50%" cy="50%" r="4" fill="white"/> </svg> <svg viewbox="-5 -5 10 10" xmlns="http://www.w3.org/2000/svg"> <!-- the point of coordinate 0,0 is now in the center of the viewport, and 100% is still
resolve to a width or height of 10 user units so the rectangle looks shifted to the bottom/right corner of the viewport --> <rect x="0" y="0" width="100%" height="100%"/> <!-- with the point of coordinate 0,0 in the center of the viewport the value 50% is
resolve to 5 which means the center of the circle is in the bottom/right corner of the viewport.
content/symbiont - Archive of obsolete content
var { symbiont } = require('sdk/content/content'); var thing = symbiont.
resolve({ constructor: '_init' }).compose({ constructor: function thing(options) { // `getmyframe` returns the host application frame in which // the page is loaded.
places/bookmarks - Archive of obsolete content
options : object optional options: name type
resolve function a resolution function that is invoked during an attempt to save a bookmark item that is not derived from the latest state from the platform.
jpm - Archive of obsolete content
you can supply a path to a specific binary: jpm run -b /path/to/firefox/nightly as a shorthand for this, you can pass "nightly", "firefoxdeveloperedition", "aurora", "beta", or "firefox" and jpm will look in the default location for these firefox versions [note: as of firefox 48, the shorthands "firefox" and "beta" will
resolve to versions of firefox which will not run your add-on.
xml:base support in old browsers - Archive of obsolete content
path separator ('/') after protocol if (att2 !== -1) { att = att.substring(0, att2 - 1); // don't want any trailing slash, as the absolute path to be added already has one } } else if (!att.match(/\/$/)) { // if no trailing slash, add one, since it is being attached to a relative path att += '/'; } xmlbase = att + xmlbase; // if previous path was not absolute,
resolve against the full uri here' break; } else if (att.indexof('/') === 0) { // if absolute (/), need to prepare for next time to strip out after slash xmlbase = att + xmlbase; abs = true; // once the protocol is found on the next round, make sure any extra path is ignored } else { // if relative, just add it xmlbase = att + xmlbase; } } thisitem = thisitem.parentnode...
XPath - Archive of obsolete content
notes and sample code for xpath and ajax (the following was moved from document.evaluate) obj.evaluate(xpathexpression,contextnode,namespace
resolver,resulttype,result); //obj and contextnode should be the same object, if context is a ajax xml object (example: returnedxml) this should be used as : returnedxml.evaluate(xpathexpression,returnedxml,namespace
resolver,returntype,result); //contextnode should be used in the one in which it was created //add by mooring 2008-11-15 16:00 china var xhr = new ajax('post','demo.xml',parsexml,'xml'); //ajax is a class written by javascript which return responsexml object to parsexml function function parsexml(obj)//obj is the returnxml object now { if(!obj.documentelement) { alert("your browser does't support this script!"); return; }...
Block and Line Layout Cheat Sheet - Archive of obsolete content
mcomputedwidth mcomputedheight mcomputedmargin mcomputedborderpadding mcomputedpadding mcomputedoffsets mcomputedminwidth mcomputedmaxwidth mcomputedminheight mcomputedmaxheight given the current container frame and the style applied to the child, these values are the
resolved values for the child frame's box.
URIs and URLs - Archive of obsolete content
also the handling of query segments is different from the examples given in rfc 2396: within an object with a well-defined base uri of http://a/b/c/d;p?q the relative uri would be
resolved as follows: ...
Providing Command-Line Options - Archive of obsolete content
queryinterface: xpcomutils.generateqi([ ci.nsicommandlinehandler ]), /* nsicommandlinehandler */ handle : function clh_handle(cmdline) { try { // changeme: change "viewapp" to your command line flag that takes an argument var uristr = cmdline.handleflagwithparam("viewapp", false); if (uristr) { // convert uristr to an nsiuri var uri = cmdline.
resolveuri(uristr); openwindow(chrome_uri, uri); cmdline.preventdefault = true; } } catch (e) { components.utils.reporterror("incorrect parameter passed to -viewapp on the command line."); } // changeme: change "myapp" to your command line flag (no argument) if (cmdline.handleflag("myapp", false)) { openwindow(chrome_uri, null); cmdline.prevent...
XUL Parser in Python/source - Archive of obsolete content
import sys, glob, xmllib import os, re el_list = {} w = open('res.html', 'w') # unfortunately, i had to put this hack in here to suppress the printing out of the
resolved namespace: # "xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul window", etc.
2006-11-10 - Archive of obsolete content
xit status gmake[3]: *** [testtarray] error 1 gmake[3]: leaving directory `/usr/mozilla2/src/mozilla/xpcom/tests' gmake[2]: *** [libs] error 2 gmake[2]: leaving directory `/usr/mozilla2/src/mozilla/xpcom' gmake[1]: *** [tier_2] error 2 gmake[1]: leaving directory `/usr/mozilla2/src/mozilla' make: *** [default] error 2 he is not sure what is wrong with his build, and is asking for help on how to
resolve the build error.
2006-12- 08 - Archive of obsolete content
david baron is planning to make an additional change to the computesize api onthe reflow branch to
resolve a number of float-related bugs (359135,360093), and some others.
2006-09-06 - Archive of obsolete content
how to build xpcom component on mac os x a tutorial on how to build xpcom component on mac os x firefox crashes when calling a function provided by a .so library a solution to the problem loading a shared library when using xpcom firefoxes crashes while getting url in xpcom solutions to
resolve the problem of the firefox crash when trying to get the path and the prepath of the url of the current page in xpcom meetings none during this week.
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.
Boolean - MDN Web Docs Glossary: Definitions of Web-related terms
/* javascript if statement */ if (boolean conditional) { // code to execute if the conditional is true } if (boolean conditional) { console.log("boolean conditional
resolved to true"); } else { console.log("boolean conditional
resolved to false"); } /* javascript for loop */ for (control variable; boolean conditional; counter) { // code to execute repeatedly if the conditional is true } for (var i=0; i < 4; i++) { console.log("i print only when the boolean conditional is true"); } the boolean value is named after english mathematician george boole, who pi...
Prefetch - MDN Web Docs Glossary: Definitions of Web-related terms
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.
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
should become: var href = getxmlbaselink (/* xlink sans xml:base */ xinclude.getattribute('href'), /* element to query from */ xinclude); function
resolvexincludes(docu) { // http://www.w3.org/tr/xinclude/#xml-included-items var xincludes = docu.getelementsbytagnamens('http://www.w3.org/2001/xinclude', 'include'); if (xincludes) { for (i=0; i < xincludes.length; i++) { var xinclude = xincludes[i]; var href = xinclude.getattribute('href'); var parse = xinclude.getattribute('parse'); ...
Cascade and inheritance - Learn web development
overview: building blocks next the aim of this lesson is to develop your understanding of some of the most fundamental concepts of css — the cascade, specificity, and inheritance — which control how css is applied to html and how conflicts are
resolved.
CSS building blocks - Learn web development
cascade and inheritance the aim of this lesson is to develop your understanding of some of the most fundamental concepts of css — the cascade, specificity, and inheritance — which control how css is applied to html and how conflicts are
resolved.
CSS FAQ - Learn web development
</div> if the same property is declared in both rules, the conflict is
resolved first through specificity, then according to the order of the css declarations.
Index - Learn web development
115 cascade and inheritance beginner, css, cascade, inheritance, learn, rules, source order, specificity the aim of this lesson is to develop your understanding of some of the most fundamental concepts of css — the cascade, specificity, and inheritance — which control how css is applied to html and how conflicts are
resolved.
Multiprocess on Windows
prerequisite reading since so much of this design
resolves around microsoft com and its concept of the apartment, readers of this document should have a solid understanding of what apartments are.
Creating a Language Pack
$ hg update -r 237dccbcb967 3 files updated, 0 files merged, 0 files removed, 0 files un
resolved the source code has been updated to the revision the binary was built from.
Gecko Logging
you can set an overall logging level, though it could be quite verbose: set rust_log="debug" you can also target individual modules by path: set rust_log="style::style_
resolver=debug" for linux/macos users, you need to use export rather than set.
HTMLIFrameElement.getMuted()
promise version: a promise that
resolves with the muted value — a boolean where true means muted, and false means unmuted.
mozbrowsererror
possible values are: fatal(crash) unknownprotocolfound filenotfound dnsnotfound connectionfailure netinterrupt nettimeout cspblocked phishingblocked malwareblocked unwantedblocked offline malformeduri redirectloop unknownsockettype netreset notcached isprinting deniedportaccess proxy
resolvefailure proxyconnectfailure contentencodingfailure remotexul unsafecontenttype corruptedcontenterror certerror other example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsererror", function( event ) { console.log("an error occurred:" + event.detail); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu moz...
Embedding Tips
_contractid); if (!catman) return ns_error_failure; nsxpidlcstring previous; catman->addcategoryentry(javascript_global_property_category, "my_prop_name", "my_prop_contract_id", pr_true, pr_true, getter_copies(previous)); this will cause a component with the contract id my_prop_contract_id to be lazily created when the my_prop_name is
resolved in any javascript window scope.
Gecko SDK
ompile idl files on os x, it's likely that you will receive a strange error when running the tool that looks something along the lines of this: dyld: library not loaded: /opt/local/lib/libintl.3.dylib referenced from: /users/varmaa/xulrunner-sdk/bin/./xpidl reason: image not found trace/bpt trap unfortunately, this is caused by a problem with the sdk build process which cannot currently be
resolved (see bugzilla bug #430274).
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.
Introduction to Layout in Mozilla
notifications passes these to the style set object, who in turn passes to the frame constructor frame constructor creates frames constructframeinternal recursively walks content tree,
resolves style and creates frames either created by tag (<select>) or by display type (<p>) frame manager maintains mapping from content to frame style resolution compute stylistic information based on the style rules that apply for the frame’s content node style data broken into different structures display, visibility, font, color, background, … inherit vs.
Assert.jsm
returns a promise that
resolves when the promise either
resolves or rejects.
Localizing with Koala
application\firefox c:\mozilla\l10n\application\firefox> rmdir 3.6 c:\mozilla\l10n\application\firefox> hg clone http://hg.mozilla.org/releases/mozilla-1.9.2 3.6 requesting all changes adding changesets adding manifests adding file changes added 33099 changesets with 158636 changes to 50664 files (+9 heads) updating working directory 40357 files updated, 0 files merged, 0 files removed, 0 files un
resolved configure the locale locale id: x-testing (put your locale's code) version: 3.6 location: choose the folder where you want to keep the localized files or leave empty for now check "mercurial" if you wish to use mercurial to keep the revision history of your files (very recommended) existing localizations: url: if you're editing an existing localization or you already have a repository set ...
Release phase
tory, 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 un
resolved the default push url is the same as the default pull url (i.e., ssh://hg.mozilla.org/releases/l10n-central/x-testing).
Mozilla Development Strategies
this puts the bug on the radar of our documentation team to ensure that once the bug is
resolved, the documentation will be updated appropriately.
Investigating CSS Performance
two counts are collected which allow for an estimation of the amount of work being done during restyle:
resolvestyleforcount this is incremented everytime that we do style resolution on an element contentenumfunccount this is incremented roughly for every rule that we test against time during restyle can be spent in a bunch of places.
McCoy
we hope to
resolve this for the next release - or around the year 2100.
Dynamic Library Linking
this section describes nspr's programming interface to load, unload and
resolve symbols in dynamic libraries.
PR_FindSymbol
name a textual representation of the symbol to
resolve.
JSS 4.4.0 Release Notes
bugs fixed in jss 4.4.0 this bugzilla query returns all the bugs fixed in nss 4.4.0: https://bugzilla.mozilla.org/buglist.cgi?product=jss&target_milestone=4.4&target_milestone=4.4&bug_status=
resolved&resolution=fixed documentation build instructions for jss at https://hg.mozilla.org/projects/jss/file/tip/readme platform information you can check out the source from mercurial via hg clone -r 055aa3ce8a61 https://hg.mozilla.org/projects/jss jss 4.4.0 works with openjdk versions 1.7 or higher we suggest the latest - openjdk 1.8.
NSS 3.12.4 release notes
bug 488550: crash in certutil or pp when printing cert with empty subject name bug 488992: fix lib/freebl/win_rand.c warnings bug 489010: stop exporting mktemp and dbopen (again) bug 489287:
resolve a few remaining issues with nss's new revocation flags bug 489710: byteswap optimize for msvc++ bug 490154: cryptokey framework requires module to implement generatekey when they support keypairgeneration bug 491044: remove support for vms (a.k.a., openvms) from nss bug 491174: cert_pkixverifycert reports wrong error code when ee cert is expired bug 491919: cert.h doesn't have valid functions pro...
NSS 3.14.1 release notes
bugs fixed in nss 3.14.1 the following bugzilla query returns all of the bugs fixed in nss 3.14.1: https://bugzilla.mozilla.org/buglist.cgi?list_id=5216669;resolution=fixed;query_format=advanced;bug_status=
resolved;bug_status=verified;target_milestone=3.14.1;product=nss compatability nss 3.14.1 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.14.4 release notes
nss 3.14.4 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_4_rtm/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.14.4.
NSS 3.14.5 release notes
nss 3.14.5 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_5_rtm/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.14.5.
NSS 3.15.5 release notes
bugs fixed in nss 3.15.5 a complete list of all bugs
resolved in this release can be obtained at https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&target_milestone=3.15.5&product=nss compatibility nss 3.15.5 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.16.2.1 release notes
nss 3.16.2.1 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_2_1_rtm/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.16.2.1.
NSS 3.16.5 release notes
nss 3.16.5 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_5_rtm/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.16.5.
NSS 3.17.1 release notes
nss 3.17.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_17_1_rtm/src/ security advisories the following security-relevant bugs have been
resolved in nss 3.17.1.
SpiderMonkey Internals
jshash
resolves collisions via chaining, so each entry burns a malloc and can fragment the heap.
JIT Optimization Outcomes
this can happen if the operation sees many different types of objects, and so the type of the input to the operation cannot be
resolved to a single type.
JSEnumerateOp
jsclass hooks jsclass offers following hook: the jsclass.enumerate hook is for classes that implement lazy properties using jsclass.
resolve.
JSExtendedClass.wrappedObject
wrapper objects typically have no prototype, do not allow setting __proto__, and inherit properties from the wrapped object rather than the prototype chain (see jsnew
resolveop).
JS_SetPrototype
take care not to create a circularly-linked list of prototypes using this function, because such a set of prototypes cannot be
resolved by the javascript engine and can easily lead to an infinite loop.
SpiderMonkey 1.8.5
property accessors js_propertystub, js_
resolvestub, and user-defined functions of type jspropertyop (e.g.
SpiderMonkey 1.8.7
property accessors js_propertystub, js_
resolvestub, and user-defined functions of type jspropertyop (e.g.
SpiderMonkey 24
deleted apis js_get_class (use js_getclass instead) js_enumerate
resolvedstandardclasses js_getglobalobject js_setcstringsareutf8 ...list other deleted apis...
SpiderMonkey 45
js_setcurrentembeddertimefunction (bug 1159507) js_getcurrentembeddertime (bug 1159507) js_may
resolvestandardclass (bug 1155946) js_getiteratorprototype (bug 1225392) js_globallexicalscope (bug 1202902) js_hasextensiblelexicalscope (bug 1202902) js_extensiblelexicalscope (bug 1202902) js_initreflectparse (bug 987514) js::toprimitive (bug 1206168) js::getfirstargumentastypehint (bug 1054756) js::objecttocompletepropertydescriptor (bug 1144366) js_setimmutableprototype (bug 1211607) js_ge...
Web Replay
we
resolve this slop by minimizing the tolerated non-determinism: the replaying process must be just non-deterministic enough that the ipc and debugger components work.
Handling Mozilla Security Bugs
it is our hope that any disputes that arise over membership, disclosure, or any other issue addressed by this policy can be
resolved by consensus among the mozilla security module owner, the module owner's peers, and other security bug group members through discussions on the private security bug group mailing list.
Generating GUIDs
remember, these are identifiers, not e-mail addresses, and they're never
resolved.
mozIRegistry
this issue needs to be
resolved in order to enable alternative moziregistry implementations or to permit other service implementations to be bound at runtime.
nsIChromeRegistry
convertchromeurl()
resolves a chrome url to an loadable uri using the information in the registry.
nsIDNSRecord
since a dns query may return more than one
resolved ip address, the record acts like an enumerator, allowing the caller to easily step through the list of ip addresses.
nsIDNSRequest
the listener will passed to async
resolve will be notified immediately with a status code of ns_error_abort.
nsIDirectoryIterator
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void init(in nsifilespec parent, in boolean
resolvesymlink); boolean exist(); void next(); attributes attribute type description currentspec nsifilespec init() void init( in nsifilespec parent, in boolean
resolvesymlink ); parameters parent
resolvesymlink exist() boolean exists(); next() void next(); ...
nsIFeedTextConstruct
method overview nsidomdocumentfragment createdocumentfragment(in nsidomelement element); astring plaintext(); attributes attribute type description base nsiuri if the text construct contains html or xhtml, relative references in the content should be
resolved against this base uri.
nsIInstallLocation
itemlocations nsidirectoryenumerator an enumeration of nsifiles for: locations that contain items potential dropped-in xpis note: this enumeration
resolves text links to the directories they refer to.
nsILocalFile
followlinks prbool determines whether or not the nsilocalfile will automatically
resolve symbolic links.
nsINavHistoryQueryOptions
resolvenullbookmarktitles boolean if a bookmark title is null (note, not empty), attempt to use the history title.
nsINavHistoryResultNode
it is not the actual uri of the favicon, but, rather, is something that will
resolve to the actual image.
nsIProtocolHandler
otherwise, aspec may be
resolved relative to abaseuri, depending on the protocol.
nsISocketProvider
constants constant value description proxy_
resolves_host 1 << 0 this flag is set if the proxy is to perform hostname resolution instead of the client.
nsIStandardURL
otherwise, aspec will be
resolved relative to abaseuri.
nsIXPConnect
if you do not pass init_js_standard_classes, then acomobj must implement nsixpcscriptable so it can
resolve the standard classes when asked by the js engine.
XPCOM Interface Reference
naryoutputstreamnsiblocklistpromptnsiblocklistservicensiboxobjectnsibrowserboxobjectnsibrowserhistorynsibrowsersearchservicensicrlinfonsicrlmanagernsicachensicachedeviceinfonsicacheentrydescriptornsicacheentryinfonsicachelistenernsicachemetadatavisitornsicacheservicensicachesessionnsicachevisitornsicachingchannelnsicancelablensicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsicharset
resolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardcommandsnsiclipboarddragdrophooklistnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsicommandcontrollernsicommandlinensicommandlinehandlernsicommandlinerunnernsicomponentmanagernsicomponentregistrarnsicompositionstringsynthesizernsiconsolelistenernsiconsolemessagensiconsoleservicensicontaine...
Waterfall - Firefox Developer Tools
for example, consider code like this: var timerbutton = document.getelementbyid("timer"); timerbutton.addeventlistener("click", handleclick, false); function handleclick() { console.time("timer"); runtimer(1000).then(timerfinished); } function timerfinished() { console.timeend("timer"); console.log("ready!"); } function runtimer(t) { return new promise(function(
resolve) { settimeout(
resolve, t); }); } the waterfall will display a marker for the period between time() and timeend(), and if you select it, you'll see the async stack in the sidebar: timestamp markers timestamps enable you to mark an instant in the recording.
Animation.playState - Web APIs
syntax var currentplaystate = animation.playstate; animation.playstate = newstate; value idle the current time of the animation is un
resolved and there are no pending tasks.
BasicCardRequest - Web APIs
} once the payment flow has been triggered using paymentrequest.show() and the promise
resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.billingAddress - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise
resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.cardNumber - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise
resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.cardSecurityCode - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise
resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.cardholderName - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise
resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.expiryMonth - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise
resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.expiryYear - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise
resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse - Web APIs
} once the payment flow has been triggered using paymentrequest.show() and the promise
resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BatteryManager - Web APIs
the navigator.getbattery() method returns a battery promise that is
resolved in a batterymanager interface which you can use to interact with the battery status api.
Battery Status API - Web APIs
the battery status api extends window.navigator with a navigator.getbattery() method returning a battery promise, which is
resolved in a batterymanager object providing also some new events you can handle to monitor the battery status.
BluetoothRemoteGATTDescriptor - Web APIs
methods bluetoothremotegattdescriptor.readvalue() returns a promise that
resolves to an arraybuffer holding a duplicate of the value property if it is available and supported.
Client.type - Web APIs
a document) function sendmessage(message) { return new promise(function(
resolve, reject) { // note that this is the serviceworker.postmessage version navigator.serviceworker.controller.postmessage(message); window.serviceworker.onmessage = function(e) {
resolve(e.data); }; }); } // controlling service worker self.addeventlistener("message", function(e) { // e.source is a client object e.source.postmessage("hello!
Clients.openWindow() - Web APIs
return value a promise that
resolves to a windowclient object if the url is from the same origin as the service worker or a null value otherwise.
ClipboardItem - Web APIs
gettype() returns a promise that
resolves with a blob of the requested mime type, or an error if the mime type is not found.
ContentIndex.add() - Web APIs
return value returns a promise that
resolves with undefined exceptions typeerror if the service worker's registration is not present or the service worker does not contain a fetchevent.
ContentIndex - Web APIs
contentindex.getall returns a promise that
resolves with an iterable list of content index entries.
CustomElementRegistry - Web APIs
customelementregistry.whendefined() returns an empty promise that
resolves when a custom element becomes defined with the given name.
FileSystemEntry.getParent() - Web APIs
you can, however, create a simple helper function to adapt it, like this: function getparentpromise(entry) { return new promise((
resolve, reject) => { entry.getparent(
resolve, reject); }); } a similar approach can be taken elsewhere in the file and directory entries api.
FullscreenOptions.navigationUI - Web APIs
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.complete - Web APIs
let lightboxelem = document.queryselector("#lightbox"); let lightboximgelem = lightboxelem.queryselector("img"); let lightboxcontrolselem = lightboxelem.queryselector(".toolbar"); async function loadimage(url, elem) { return new promise((
resolve, reject) => { elem.onload = () =>
resolve(elem); elem.onerror = reject; elem.src = url; }); } async function lightbox(url) { lightboxelem.style.display = "block"; await loadimage("https://somesite.net/huge-image.jpg", lightboximgelem); lightboxcontrolselem.disabled = false; } /* ...
HTMLImageElement - Web APIs
htmlimageelement.decode() returns a promise that
resolves when the image is decoded and it's safe to append the image to the dom.
HTMLMediaElement.load() - Web APIs
the process of aborting any ongoing activities will cause any outstanding promises returned by play() being
resolved or rejected as appropriate based on their status before the loading of new media can begin.
HTMLObjectElement - Web APIs
htmlobjectelement.codebase is a domstring that reflects the codebase html attribute, specifying the base path to use to
resolve relative uris.
Using microtasks in JavaScript with queueMicrotask() - Web APIs
while there have been tricks available that made it possible to enqueue microtasks in the past (such as by creating a promise that
resolves immediately), the addition of the queuemicrotask() method adds a standard way to introduce a microtask safely and without tricks.
databases - Web APIs
return value a promise that
resolves either to an error or a list of dictionaries, each with two elements, name and version.
IDBObjectStore.getAllKeys() - Web APIs
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.
Keyboard - Web APIs
methods keyboard.getlayoutmap() returns a promise that
resolves with an instance of keyboardlayoutmap which is a map-like object with functions for retrieving the strings associated with specific physical keys.
Keyboard API - Web APIs
keyboard provides the keyboard.getlayoutmap method, which returns a promise that
resolves with a keyboardlayoutmap object that contains members for converting codes to keys.
KeyframeEffect.iterationComposite - Web APIs
the iterationcomposite property of a keyframeeffect
resolves how the animation's property value changes accumulate or override each other upon each of the animation's iterations.
LockManager - Web APIs
lockmanager.query() returns a promise that
resolves with a lockmanagersnapshot which contains information about held and pending locks.
remove() - Web APIs
return value a promise that
resolves to a boolean indicating whether the load succeeded or failed.
MediaKeySession - Web APIs
mediakeysession.load() returns a promise that
resolves to a boolean value after loading data for a specified session object.
MerchantValidationEvent.complete() - Web APIs
syntax merchantvalidationevent.complete(validationdata); merchantvalidationevent.complete(merchantsessionpromise); parameters validationdata or merchantsessionpromise an object containing the data needed to complete the merchant validation process, or a promise which
resolves to the validation data.
NDEFReader.scan() - Web APIs
return value a promise that
resolves with undefined immediatelly after scheduling read operations for the nfc adapter.
Node.baseURI - Web APIs
the base url is used to
resolve relative urls when the browser needs to obtain an absolute url, for example when processing the html <img> element's src attribute or xml xlink:href attribute.
OfflineAudioContext - Web APIs
when the startrendering() promise
resolves, rendering has completed and the output audiobuffer is returned out of the promise.
PaymentAddress - Web APIs
"success" : "failure"; await response.complete(result); } dopaymentrequest(); once the payment flow has been triggered using paymentrequest.show() and the promise
resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
PaymentRequest.canMakePayment() - Web APIs
}) canpay = await paymentrequest.canmakepayment(); returns a promise to a boolean that
resolves to true if the user agent supports any of the payment methods supplied when instantiating the request using the paymentrequest constructor.
PaymentRequest.onshippingaddresschange - Web APIs
var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(
resolve) { updatedetails(details, request.shippingaddress,
resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of clarity.
PaymentRequest.onshippingoptionchange - Web APIs
is supported } else if (addr.country === 'jp') { shippingoption.id = 'jp'; shippingoption.label = 'international shipping'; shippingoption.amount.value = '10.00'; details.total.amount.value = '65.00'; // shipping to elsewhere is unsupported } else { // empty array indicates rejection of the address details.shippingoptions = []; return promise.
resolve(details); console.log(details.error); } // hardcode for simplicity if (details.displayitems.length === 2) { details.displayitems[2] = shippingoption; } else { details.displayitems.push(shippingoption); } details.shippingoptions = [shippingoption]; return promise.
resolve(details); })(details, request.shippingaddress)); }); specifications ...
Payment processing concepts - Web APIs
by then delivering this data (or a promise which
resolves to the loaded data) to the payment handler by passing it into complete(), the payment handler can use the retrieved data and whatever algorithm and other data to support in order to verify that the merchant can use the payment handler.
Permissions API - Web APIs
once you have this object you can then perform permission-related tasks, for example querying a permission using the permissions.query() method to return a promise that
resolves with the permissionstatus for a specific api.
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.
PushSubscription - Web APIs
pushsubscription.unsubscribe() starts the asynchronous process of unsubscribing from the push service, returning a promise that
resolves to a boolean when the current subscription is successfully unregistered.
RTCDataChannel: error event - Web APIs
examples // strings for each of the sctp cause codes found in rfc // 4960, section 3.3.10: // https://tools.ietf.org/html/rfc4960#section-3.3.10 const sctpcausecodes = [ "no sctp error", "invalid stream identifier", "missing mandatory parameter", "stale cookie error", "sender is out of resource (i.e., memory)", "unable to
resolve address", "unrecognized sctp chunk type received", "invalid mandatory parameter", "unrecognized parameters", "no user data (sctp data chunk has no data)", "cookie received while shutting down", "restart of an association with new addresses", "user-initiated abort", "protocol violation" ]; dc.addeventlistener("error", ev => { const err = ev.error; console.error("webrtc error:...
RTCIceCandidateStats.address - Web APIs
otherwise, the address is presumed to be a fully-qualified domain name, which is
resolved first using an aaaa record (assuming ipv6 is available), then using an a record (if no result is found or the device onlu supports ipv4).
RTCIceTransport.state - Web APIs
a value of "disconnected" means that a transient issue has occurred that has broken the connection, but that should
resolve itself automatically without your code having to take any action.
RTCIceTransportState - Web APIs
a value of "disconnected" means that a transient issue has occurred that has broken the connection, but that should
resolve itself automatically without your code having to take any action.
ReadableStream.getReader() - Web APIs
function fetchstream() { const reader = stream.getreader(); let charsreceived = 0; // read() returns a promise that
resolves // when a value has been received reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data.
ReadableStream.tee() - Web APIs
function teestream() { const teedoff = stream.tee(); fetchstream(teedoff[0], list2); fetchstream(teedoff[1], list3); } function fetchstream(stream, list) { const reader = stream.getreader(); let charsreceived = 0; // read() returns a promise that
resolves // when a value has been received reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data.
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
function fetchstream() { const reader = stream.getreader(); let charsreceived = 0; // read() returns a promise that
resolves // when a value has been received reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data.
ReadableStreamDefaultReader.cancel() - Web APIs
function fetchstream() { const reader = stream.getreader(); let charsreceived = 0; // read() returns a promise that
resolves // when a value has been received reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data.
ReadableStreamDefaultReader.read() - Web APIs
function fetchstream() { const reader = stream.getreader(); let charsreceived = 0; // read() returns a promise that
resolves // when a value has been received reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data.
Response.clone() - Web APIs
when the fetch
resolves successfully, we clone it, extract a blob from both responses using two body.blob calls, create object urls out of the blobs using url.createobjecturl, and display them in two separate <img> elements.
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.
Storage API - Web APIs
to determine the estimated quota and usage values for a given origin, use the navigator.storage.estimate() method, which returns a promise that, when
resolved, receives a storageestimate that contains these figures.
Using readable streams - Web APIs
function readstream() { const reader = stream.getreader(); let charsreceived = 0; // read() returns a promise that
resolves // when a value has been received reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data.
Using writable streams - Web APIs
the constructor call in our example looks like this: const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((
resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded;
resolve(); }); }, close() { var lis...
SyncManager.getTags() - Web APIs
}) returns a promise that
resolves to an array of domstrings containing developer-defined identifiers for syncmanager registrations.
TransformStream - Web APIs
let responses = [ /* conjoined response tree */ ] let {readable, writable} = new transformstream responses.reduce( (a, res, i, arr) => a.then(() => res.pipeto(writable, {preventclose: (i+1) !== arr.length})), promise.
resolve() ) note that this is not resilient to other influences.
USBDevice.claimInterface() - Web APIs
the claiminterface() method of the usbdevice interface returns a promise that
resolves when the requested interface is claimed for exclusive access.
USBDevice.close() - Web APIs
the close() method of the usbdevice interface returns a promise that
resolves when all open interfaces are released and the device session has ended.
USBDevice.open() - Web APIs
the open() method of the usbdevice interface returns a promise that
resolves when a device session has started.
USBDevice.reset() - Web APIs
the reset() method of the usbdevice interface returns a promise that
resolves when the device is reset and all app operations canceled and their promises rejected.
WakeLock - Web APIs
methods request requests a wakelocksentinel object, which returns a promise that
resolves with a wakelocksentinel object.
WakeLockSentinel - Web APIs
methods release() releases the wakelocksentinel, returning a promise that is
resolved once the sentinel has been successfully released.
Signaling and video calling - Web APIs
the signaling server establishing a webrtc connection between two devices requires the use of a signaling server to
resolve how to connect them over the internet.
Using WebRTC data channels - Web APIs
in order to
resolve this issue, a new system of stream schedulers (usually referred to as the "sctp ndata specification") has been designed to make it possible to interleave messages sent on different streams, including streams used to implement webrtc data channels.
WebSocket.url - Web APIs
the websocket.url read-only property returns the absolute url of the websocket as
resolved by the constructor.
WebXR Device API - Web APIs
returns a promise which
resolves once the context has been prepared, or is rejected if the context cannot be configured for use by webxr.
Using the Web Animations API - Web APIs
nommingcake.onfinish = endgame; drinking.onfinish = endgame; // ...or alice reaches the end of her animation alicechange.onfinish = endgame; better still, the web animations api also provides a finish promise that will
resolve when the animation finishes, or reject if it is canceled.
Using Web Workers - Web APIs
also, the uris for subworkers are
resolved relative to the parent worker's location rather than that of the owning page.
Window.self - Web APIs
by using self, you can refer to the global scope in a way that will work not only in a window context (self will
resolve to window.self) but also in a worker context (self will then
resolve to workerglobalscope.self).
Window - Web APIs
windoworworkerglobalscope.createimagebitmap() accepts a variety of different image sources, and returns a promise which
resolves to an imagebitmap.
WindowOrWorkerGlobalScope - Web APIs
windoworworkerglobalscope.createimagebitmap() accepts a variety of different image sources, and returns a promise which
resolves to an imagebitmap.
WorkerGlobalScope - Web APIs
windoworworkerglobalscope.createimagebitmap() accepts a variety of different image sources, and returns a promise which
resolves to an imagebitmap.
WritableStream.getWriter() - Web APIs
ter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((
resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded;
resolve(); }); }, close() { var lis...
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
ter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((
resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded;
resolve(); }); }, close() { var lis...
WritableStreamDefaultWriter.close() - Web APIs
ter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((
resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded;
resolve(); }); }, close() { var lis...
WritableStreamDefaultWriter.ready - Web APIs
the ready read-only property of the writablestreamdefaultwriter interface returns a promise that
resolves when the desired size of the stream's internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure.
XPathExpression.evaluate() - Web APIs
namespace_err if the expression contains namespace prefixes which cannot be
resolved by the specified xpathns
resolver, a domexception of type namespace_error is raised.
XPathExpression - Web APIs
this is useful when an expression will be reused in an application, because it is just compiled once and all namespace prefixes which occur within the expression are pre
resolved.
XRRigidTransform() - Web APIs
let animationframerequestid = 0; xrsession.requestreferencespace("local-floor") .then((refspace) => { xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform(viewerposition, viewerorientation)); animationframerequestid = 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.
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
when the returned promise
resolves, we proceed by calling xrwebgllayer's getnativeframebufferscalefactor() static function to get the scale factor needed to reach the native resolution, and we then pass that into the webgllayer() constructor as the value of the framebufferscalefactor property in its layerinit dictionary, which is an xrwebgllayerinit object.
Web APIs
socket wheelevent window windowclient windoweventhandlers windoworworkerglobalscope worker workerglobalscope workerlocation workernavigator worklet writablestream writablestreamdefaultcontroller writablestreamdefaultwriter x xdomainrequest xmldocument xmlhttprequest xmlhttprequesteventtarget xmlhttprequestresponsetype xmlserializer xpathevaluator xpathexception xpathexpression xpathns
resolver xpathresult xrboundedreferencespace xrenvironmentblendmode xreye xrframe xrframerequestcallback xrhandedness xrinputsource xrinputsourcearray xrinputsourceevent xrinputsourceeventinit xrinputsourceschangeevent xrinputsourceschangeeventinit xrpermissiondescriptor xrpermissionstatus xrpose xrreferencespace xrreferencespaceevent xrreferencespaceeventinit xrreferencespacetype xrrenderstate xrren...
src - CSS: Cascading Style Sheets
as with other urls in css, the url may be relative, in which case it is
resolved relative to the location of the style sheet containing the @font-face rule.
Variable fonts guide - CSS: Cascading Style Sheets
this can generally be
resolved fairly easily, but does require an extra step in writing your css: font-weight: 375; font-variation-settings: 'wght' 375; the following live example's css can be edited to allow you to play with font weight values.
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
.box { border-end-start-radius: 1em; border-end-end-radius: 0; border-start-end-radius: 20px; border-start-start-radius: 40px; } indicating logical values for the 4-value shorthand syntax the specification makes a suggestion for the four-value shorthands such as the margin property, however the final decision on how this should be indicated is as yet un
resolved, and is discussed in this issue.
The stacking context - CSS: Cascading Style Sheets
the hierarchy of stacking contexts is organized as follows: root div #1 div #2 div #3 div #4 div #5 div #6 it is important to note that div #4, div #5 and div #6 are children of div #3, so stacking of those elements is completely
resolved within div#3.
CSS reference - CSS: Cascading Style Sheets
concepts syntax and semantics css syntax at-rules cascade comments descriptor inheritance shorthand properties specificity value definition syntax css unit and value types values actual value computed value initial value
resolved value specified value used value layout block formatting context box model containing block layout mode margin collapsing replaced elements stacking context visual formatting model dom-css / cssom major object types documentorshadowroot.stylesheets stylesheets[i].cssrules cssrules[i].csstext (selector & style) cssrules[i].selectortext htmlelement.style htmlelement.style.
Shorthand properties - CSS: Cascading Style Sheets
see also css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, and margin collapsing, or the initial, computed,
resolved, specified, used, and actual values.
Inheritance - CSS: Cascading Style Sheets
see also css values for controlling inheritance: inherit, initial, unset, and revert introducing the css cascade cascade and inheritance css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, and margin collapsing, or the initial, computed,
resolved, specified, used, and actual values.
<length-percentage> - CSS: Cascading Style Sheets
5%; height: 200px; margin: 3rem; padding: 1%; border-radius: 10px 10%; font-size: 250%; line-height: 1.5em; /* length examples */ text-shadow: 1px 1px 1px red; border: 5px solid red; letter-spacing: 3px; /* percentage example */ text-size-adjust: 20%; } result use in calc() where a <length-percentage> is specified as an allowable type, this means that the percentage
resolves to a length and therefore can be used in a calc() expression.
Block formatting context - Developer guides
see also float, clear css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, and margin collapsing, or the initial, computed,
resolved, specified, used, and actual values.
CORS errors - HTTP
in these pages, we'll look into some common cors error messages and how to
resolve them.
CSP: connect-src - HTTP
note: connect-src 'self' does not
resolve to websocket schemas in all browsers, more info: https://github.com/w3c/webappsec-csp/issues/7 csp version 1 directive type fetch directive default-src fallback yes.
Strict-Transport-Security - HTTP
strict transport security
resolves this problem; as long as you've accessed your bank's web site once using https, and the bank's web site uses strict transport security, your browser will know to automatically use only https, which prevents hackers from performing this sort of man-in-the-middle attack.
Proxy servers and tunneling - HTTP
the example below will work in an environment where the internal dns server is set up so that it can only
resolve internal host names, and the goal is to use a proxy only for hosts that aren't resolvable: function findproxyforurl(url, host) { if (isresolvable(host)) return "direct"; else return "proxy proxy.mydomain.com:8080"; } see proxy auto-configuration (pac) for more examples.
Closures - JavaScript
this is an example of lexical scoping, which describes how a parser
resolves variable names when functions are nested.
arguments.callee - JavaScript
cks that would not otherwise be necessary.) the other major issue is that the recursive call will get a different this value, e.g.: var global = this; var sillyfunction = function(recursed) { if (!recursed) { return arguments.callee(true); } if (this !== global) { alert('this is: ' + this); } else { alert('this is the global'); } } sillyfunction(); ecmascript 3
resolved these issues by allowing named function expressions.
Array.prototype.map() - JavaScript
t(element, 10) } ['1', '2', '3'].map(returnint); // [1, 2, 3] // actual result is an array of numbers (as expected) // same as above, but using the concise arrow function syntax ['1', '2', '3'].map( str => parseint(str) ) // a simpler way to achieve the above, while avoiding the "gotcha": ['1', '2', '3'].map(number) // [1, 2, 3] // but unlike parseint(), number() will also return a float or (
resolved) exponential notation: ['1.1', '2.2e2', '3e300'].map(number) // [1.1, 220, 3e+300] // for comparison, if we use parseint() on the array above: ['1.1', '2.2e2', '3e300'].map( str => parseint(str) ) // [1, 2, 3] one alternative output of the map method being called with parseint as a parameter runs as follows: let xs = ['10', '10', '10'] xs = xs.map(parseint) console.log(xs) // actual resul...
AsyncFunction - JavaScript
examples creating an async function from an asyncfunction() constructor function
resolveafter2seconds(x) { return new promise(
resolve => { settimeout(() => {
resolve(x); }, 2000); }); } let asyncfunction = object.getprototypeof(async function(){}).constructor let a = new asyncfunction('a', 'b', 'return await
resolveafter2seconds(a) + await
resolveafter2seconds(b);'); a(10, 20).then(v => { console.log(v); // pr...
Intl.Collator - JavaScript
intl.collator.prototype.
resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object.
Intl.DisplayNames - JavaScript
intl.displaynames.prototype.
resolvedoptions() returns a new object with properties reflecting the locale and formatting options computed during initialization of the object.
Intl.NumberFormat - JavaScript
intl.numberformat.prototype.
resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object.
Intl.PluralRules - JavaScript
instance methods intl.pluralrules.prototype.
resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object.
Intl.RelativeTimeFormat - JavaScript
intl.relativetimeformat.prototype.
resolvedoptions() returns a new object with properties reflecting the locale and formatting options computed during initialization of the object.
Promise.prototype.finally() - JavaScript
so for example: unlike promise.
resolve(2).then(() => {}, () => {}) (which will be
resolved with undefined), promise.
resolve(2).finally(() => {}) will be
resolved with 2.
Symbol.toStringTag - JavaScript
and more built-in tostringtag symbols object.prototype.tostring.call(new map()); // "[object map]" object.prototype.tostring.call(function* () {}); // "[object generatorfunction]" object.prototype.tostring.call(promise.
resolve()); // "[object promise]" // ...
let - JavaScript
so, the identifier n.a is
resolved to the property 'a' of the 'n' object located in the first part of the instruction itself (let n).
start_url - Web app manifests
examples absolute url "start_url": "https://example.com" relative url if the url is relative, the manifest url is used as the base url to
resolve it.
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.
stroke-dashoffset - SVG: Scalable Vector Graphics
stroke-dasharray="3 1" stroke-dashoffset="1" /> <!-- the following red lines highlight the offset of the dash array for each line --> <path d="m0,5 h-3 m0,7 h3 m0,9 h-1" stroke="rgba(255,0,0,.5)" /> </svg> usage notes value <percentage> | <length> default value 0 animatable yes the offset is usually expressed in user units
resolved against the pathlength but if a <percentage> is used, the value is
resolved as a percentage of the current viewport.