Search completed in 0.94 seconds.
NSS Tools cmsutil
-c encrypt a message. ...
... -c encrypt a message. ...
... -c encrypt a message. ...
...And 8 more matches
NSS tools : cmsutil
each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. ...
...each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. ...
...each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. ...
...And 8 more matches
NSS tools : cmsutil
name
cmsutil — performs basic cryptograpic operations, such as encryption and decryption, on cryptographic message syntax (
cms) messages. synopsis
cmsutil [options] arguments description the
cmsutil command-line uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (
cms) messages. to run
cmsutil, type the command
cmsutil option [arguments] where option and arguments are combinations of the options and arguments listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. option arguments modify an action. ...
...-c encrypt a message. -e envelope a message. -o create a certificates-only message. -s sign a message. arguments option arguments modify an action and are lowercase. -c content use this detached content (decode only). ...
....") -e envfile specify a file containing an enveloped message for a set of recipients to which you would like to send an encrypted message. if this is the first encrypted message for that set of recipients, a new enveloped message will be created that you can then use for future messages (encrypt only). -g include a signing time attribute (sign only). -h num generate email headers with info about
cms message (decode only). -i infile use infile as a source of data (default is stdin). -n nickname specify nickname of certificate to sign with (sign only). -n suppress output of contents (decode only). -o outfile use outfile as a destination of data (default is stdout). -p include an s/mime capabilities attribute. -p password use password as key database password. -r recipient1,recipient2, ... spe...
...And 4 more matches
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
this page needs to be updated to reflect current changes. (may 2019) e
cmascript next refers to new features of the e
cma-262 standard (commonly referred to as javascript) introduced after e
cmascript 2015. new versions of e
cmascript specifications are released yearly. so far, es2016, es2017, and es2018 have been released. this year, the es2019 specification will be released and es2020 is the current e
cmascript draft specification. you can see the latest proposals on the tc39/e
cma262 github repository. a channel for feedback on e
cmascript standards is es-discuss. below is a list of features in es2016+ and what version of firefox they were implemented in. ...
.... so far, es2016, es2017, and es2018 have been released. this year, the es2019 specification will be released and es2020 is the current e
cmascript draft specification. you can see the latest proposals on the tc39/e
cma262 github repository. a channel for feedback on e
cmascript standards is es-discuss. below is a list of features in es2016+ and what version of firefox they were implemented in. ...
...t draft specification. you can see the latest proposals on the tc39/e
cma262 github repository. a channel for feedback on e
cmascript standards is es-discuss. below is a list of features in es2016+ and what version of firefox they were implemented in. ...
...And 3 more matches
Cmdline tests - Archive of obsolete content
the
cmdline testsuite is located in test/
cmdline. the testsuite allows more flexibility by coding scripts in python allowing any executable to run, sending commands to stdin, and asserting output using regular expressions. see test/
cmdline/readme document for more information. ...
... the
cmdline testsuite is located in test/
cmdline. the testsuite allows more flexibility by coding scripts in python allowing any executable to run, sending commands to stdin, and asserting output using regular expressions. see test/
cmdline/readme document for more information. ...
... the
cmdline testsuite is located in test/
cmdline. the testsuite allows more flexibility by coding scripts in python allowing any executable to run, sending commands to stdin, and asserting output using regular expressions. see test/
cmdline/readme document for more information. ...
...And 2 more matches
EncDecMAC using token object - sample 3
2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...t file */ temp = pr_write(outfile, decbuf, decbuflen); if (temp != decbuflen) { pr_fprintf(pr_stderr, "write error\n"); rv = secfailure; break; } /* save last block of ciphertext */ memcpy(iv, decbuf, decbuflen); ivlen = decbuflen; blocknumber++; } if (rv != secsuccess) { goto cleanup; } rv = macfinal(ctxmac, newmac, &newmaclen, sizeof(newmac)); if (rv != secsuccess) { goto cleanup; } if (port_mem
cmp(macitem->data, newmac, newmaclen) == 0) { rv = secsuccess; } else { pr_fprintf(pr_stderr, "check mac : failure\n"); pr_fprintf(pr_stderr, "extracted : "); printashex(pr_stderr, macitem->data, macitem->len); pr_fprintf(pr_stderr, "computed : "); printashex(pr_stderr, newmac, newmaclen); rv = secfailure; } cleanup: if (ctxmac) { pk11_destroycontext(ctxmac, pr_true); } if (ctxenc) { pk11_destroycon...
...ermediate header file. * reads the intermediate headerfile for cka_ids and encrypted * contents and decrypts into output file. ...
...And 2 more matches
nsISyncMessageSender
/nsimessagemanager.idl inherits from: nsimessagelistenermanager message "senders" have a single "other side" to which messages are sent. for example, a child-process message manager will send messages that are only delivered to its one parent-process message manager. see message manager interfaces for more details on the distinction between message senders and message broadcasters. ...
...l inherits from: nsimessagelistenermanager message "senders" have a single "other side" to which messages are sent. for example, a child-process message manager will send messages that are only delivered to its one parent-process message manager. see message manager interfaces for more details on the distinction between message senders and message broadcasters. ...
...that are only delivered to its one parent-process message manager. see message manager interfaces for more details on the distinction between message senders and message broadcasters. both sendsyn
cmessage() and sendrp
cmessage() will block until a reply is received, but they may be temporarily interrupted to process an urgent incoming message (such as a cpow request). ...
...And 2 more matches
Date.prototype.setUTCMinutes() - JavaScript
secondsvalue optional. an integer between 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the milliseconds. ...
... secondsvalue optional. an integer between 0 and 59, representing the seconds. if you specify the secondsvalue parameter, you must also specify the minutesvalue. msvalue optional. a number between 0 and 999, representing the milliseconds. ...
...svalue optional. a number between 0 and 999, representing the milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. ...
...And 2 more matches
ECMAScript 5 support in Mozilla - Archive of obsolete content
see new in javascript 1.8.5. added in javascript 1.8.1 (gecko 1.9.1, firefox 3.5) native json support object.getprototypeof() method. string.trim() method, which trims whitespace from both ends of the string. ...
...see new in javascript 1.8.5. added in javascript 1.8.1 (gecko 1.9.1, firefox 3.5) native json support object.getprototypeof() method. string.trim() method, which trims whitespace from both ends of the string. ...
...vascript is based, was approved in june 2011. the javascript runtime used in the latest versions of mozilla projects including both firefox and thunderbird has full support for e
cmascript 5.1 features. this article covers the features supported by different versions of mozilla's javascript runtime. supported features added in javascript 1.8.5 (gecko 2, firefox 4 and later) firefox 4 has full e
cmascript 5 support including the object.* methods and strict mode. see new in javascript 1.8.5. added in javascript 1.8.1 (gecko 1.9.1, firefox 3.5) native json support object.getprototypeof() method. string.trim() method, which trims whitespace from both ends of the string. gecko 1.9.1.4 updated the implementation of json.stringify() to be compliant with e
cmascript 5. improvements laid ou...
...t 5 support including the object.* methods and strict mode. see new in javascript 1.8.5. added in javascript 1.8.1 (gecko 1.9.1, firefox 3.5) native json support object.getprototypeof() method. string.trim() method, which trims whitespace from both ends of the string. gecko 1.9.1.4 updated the implementation of json.stringify() to be compliant with e
cmascript 5. improvements laid out by e
cmascript 5 have been made in the parsing algorithm that prevents evaluating xhtml as javascript code in certain circumstances. added in javascript 1.6 (gecko 1.8, firefox 1.5) new array methods offering several improved methods for manipulating arrays -- have been part of javascript since javascript 1.6. now they've been standardized as part of e
cmascript 5. ...
JS_EnumerateDiagnosticMemoryRegions
this article covers features introduced in spidermonkey 17 enumerate memory regions that contain diagnostic information.. syntax void js_enumeratediagnosti
cmemoryregions(jsenumeratediagnosti
cmemorycallback callback); name type description callback jsenumeratediagnosti
cmemorycallback pointer to the new callback function to use. callback syntax typedef bool (* jsenumeratediagnosti
cmemorycallback)(void *ptr, size_t length); name type description ptr void * pointer to the allocated memory. length size_t length of the allocated memory. ...
...callback jsenumeratediagnosti
cmemorycallback pointer to the new callback function to use. callback syntax typedef bool (* jsenumeratediagnosti
cmemorycallback)(void *ptr, size_t length); name type description ptr void * pointer to the allocated memory. length size_t length of the allocated memory. description js_enumeratediagnosti
cmemoryregions enumerates memory regions that contain diagnostic information intended to be included in crash report minidumps. ...
...tr, size_t length); name type description ptr void * pointer to the allocated memory. length size_t length of the allocated memory. ...
...tion ptr void * pointer to the allocated memory. length size_t length of the allocated memory. ...
AesGcmParams - Web APIs
the aesg
cmparams dictionary of the web crypto api represents the object that should be passed as the algorithm parameter into subtlecrypto.encrypt(), subtlecrypto.decrypt(), subtlecrypto.wrapkey(), or subtlecrypto.unwrapkey(), when using the aes-g
cm algorithm. for details of how to supply appropriate values for this parameter, see the specification for aes-g
cm: nist sp800-38d, in particular section 5.2.1.1 on input data. properties name a domstring. this should be set to aes-g
cm. iv a buffersource — the initialization vector. this must be unique for every encryption operation carried out with a given key. put another way: never reuse an iv with the same key. ...
...section 8.2 of the specification outlines methods for constructing ivs. ...
... be omitted without compromising the security of the encryption operation. taglength optional a number. this determines the size in bits of the authentication tag generated in the encryption operation and used for authentication in the corresponding decryption. according to the web crypto specification this must have one of the following values: 32, 64, 96, 104, 112, 120, or 128. the aes-g
cm specification recommends that it should be 96, 104, 112, 120 or 128, although 32 or 64 bits may be acceptable in some applications: appendix c of the specification provides additional guidance here. taglength is optional and defaults to 128 if it is not specified. examples see the examples for subtlecrypto.encrypt() and subtlecrypto.decrypt(). specifications specification sta...
... recommendation ...
Date.prototype.setUTCMonth() - JavaScript
dayvalue optional. an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the dayvalue parameter, the value returned from the getutcdate() method is used. ...
... dayvalue optional. an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the dayvalue parameter, the value returned from the getutcdate() method is used. ...
... months january through december. dayvalue optional. an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the dayvalue parameter, the value returned from the getutcdate() method is used. ...
...ate. description if you do not specify the dayvalue parameter, the value returned from the getutcdate() method is used. if a parameter you specify is outside of the expected range, setut
cmonth() attempts to update the date information in the date object accordingly. for example, if you use 15 for monthvalue, the year will be incremented by 1, and 3 will be used for month. examples using setut
cmonth() var thebigday = new date(); thebigday.setut
cmonth(11); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.setut
cmonth' in that specification. ...
ECMAScript 2015 support in Mozilla - Archive of obsolete content
e
cmascript 2015 is the sixth edition of the e
cmascript language specification standard. it defines the standard for the javascript implementation in spidermonkey, the engine used in firefox and other mozilla applications. code-named "es.next", "harmony", or "e
cmascript 6", the first working draft (based on e
cmascript 5.1) was published on july 12, 2011 as "es.next". in august 2014, the e
cmascript 2015 draft specification was feature frozen and went through a stabilization and bug fixing period. finally, e
cma-262 edition 6 got officially approved and published as a standard on june 17, 2015 by the e
cma general assembly. it will also appear as the international industry standard iso/iec 16262:2016. a pdf and html version of the standard can be freely downloaded on e
cma-international.org. a...
...as feature frozen and went through a stabilization and bug fixing period. finally, e
cma-262 edition 6 got officially approved and published as a standard on june 17, 2015 by the e
cma general assembly. it will also appear as the international industry standard iso/iec 16262:2016. a pdf and html version of the standard can be freely downloaded on e
cma-international.org. a channel for feedback on e
cmascript standards is es-discuss. standard library additions to the array object array iteration with for...of (firefox 13) array.from() (firefox 32) array.of() (firefox 25) array.prototype.fill() (firefox 31) array.prototype.find(), array.prototype.findindex() (firefox 25) array.prototype.entries(), array.prototype.keys() (firefox 28), array.prototype.values() array.prototype.copywi...
... arraybuffer get arraybuffer[@@species] (firefox 48) dataview int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array get %typedarray%[@@species] (firefox 48) expressions and operators new.target (firefox 41) spread operator for arrays (firefox 16) use symbol.iter...
ECMA - MDN Web Docs Glossary: Definitions of Web-related terms
e
cma international (formally european computer manufacturers association) is a non-profit organization that develops standards in computer hardware, communications, and programming languages. on the web it is famous for being the organization which maintain the e
cma-262 specification (aka. e
cmascript) which is the core specification for the javascript language. ...
... e
cma international (formally european computer manufacturers association) is a non-profit organization that develops standards in computer hardware, communications, and programming languages. on the web it is famous for being the organization which maintain the e
cma-262 specification (aka. e
cmascript) which is the core specification for the javascript language. ...
... (formally european computer manufacturers association) is a non-profit organization that develops standards in computer hardware, communications, and programming languages. ...
ECMAScript - MDN Web Docs Glossary: Definitions of Web-related terms
e
cmascript is a scripting language specification on which javascript is based. e
cma international is in charge of standardizing e
cmascript. ...
... e
cmascript is a scripting language specification on which javascript is based. e
cma international is in charge of standardizing e
cmascript. ...
... e
cmascript is a scripting language specification on which javascript is based. e
cma international is in charge of standardizing e
cmascript. ...
JS_ValueToECMAInt32
obsolete since jsapi 28this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. convert a javascript value to an integer type as specified by the e
cmascript standard. syntax jsbool js_valuetoe
cmaint32(jscontext *cx, jsval v, int32 *ip); jsbool js_valuetoe
cmauint32(jscontext *cx, jsval v, uint32 *ip); jsbool js_valuetouint16(jscontext *cx, jsval v, uint16 *ip); name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the javascript value to convert. ip int32 * or uint32 * or int16 * out parameter...
... name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the javascript value to convert. ip int32 * or uint32 * or int16 * out parameter. on success, *ip receives the converted value. description js_valuetoe
cmaint32, js_valuetoe
cmauint32, and js_valuetouint16 convert a javascript value to various integer types as specified in the e
cmascript specification. js_valuetoe
cmaint32 implements the toint32 operator specified in e
cma 262-3 9.5. js_valuetoe
cmauint32 implements the touint32 operator specified in e
cma 262-3 9.6. js_valuetouint16 implements the touint16 operator specified in e
cma 262-3 9.7. ...
...on error or exception, it returns js_false, and the value left in *ip is undefined. ...
IDBFactory.cmp() - Web APIs
the
cmp() method of the idbfactory interface compares two values as keys to determine equality and ordering for indexeddb operations, such as storing and iterating. note: this feature is available in web workers. note: do not use this method for comparing arbitrary javascript values, because many javascript values are either not valid indexeddb keys (booleans and objects, for example) or are treated as equivalent indexeddb keys (for example, since indexeddb ignores arrays with non-numeric properties and treats them as empty arrays, so any non-numeric arrays are treated as equivalent). this throws an exception if either of the values is not a valid key. syntax var result = indexeddb.
cmp(first, second); parameters first the first key to compare. second the second key to compare...
...tion -1 1st key is less than the 2nd key 0 1st key is equal to the 2nd key 1 1st key is greater than the 2nd key exceptions this method may raise a domexception of the following types: attribute description dataerror one of the supplied keys was not a valid key. example var a = 1; var b = 2; var result = window.indexeddb.
cmp(a, b); console.log( "comparison results: " + result ); specifications specification status comment indexed database api 2.0the definition of '
cmp()' in that specification. recommendation indexed database api draftthe definition of '
cmp()' in that specification. recommendation browser compatibility the compatibility table on this page...
...ation browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
the javascript warning "08 (or 09) is not a legal e
cma-262 octal constant" occurs when 08 or 09 number literals are used. they can't be interpreted as an octal number. message warning: syntaxerror: 08 is not a legal e
cma-262 octal constant. warning: syntaxerror: 09 is not a legal e
cma-262 octal constant. error type warning. javascript execution won't be halted. what went wrong? decimal literals can start with a zero (0) followed by another decimal digit, but if all digits after the leading 0 are smaller than 8, the number is interpreted as an octal number. because this is not the case with 08 and 09, javascript warns about it. note that octal literals and octal escape sequences are deprecated and will present an additional deprecation warning. with e
cmascript 6 and later, the syntax...
...ipt warns about it. note that octal literals and octal escape sequences are deprecated and will present an additional deprecation warning. with e
cmascript 6 and later, the syntax uses a leading zero followed by a lowercase or uppercase latin letter "o" (0o or 0o). see the page about lexical grammar for more information. ...
Date.prototype.getUTCMilliseconds() - JavaScript
the getut
cmilliseconds() method returns the milliseconds portion of the time object's value. syntax dateobj.getut
cmilliseconds() return value an integer number, between 0 and 999, representing the milliseconds portion of the given date object. this method is a companion to the other utc based methods that give hour portion, minute portion, etc.; this method gives milliseconds portion. not to be confused with unix epoch time. to get total milliseconds since 1970/01/01, use the method ".gettime()". examples using getut
cmilliseconds() the following example assigns the milliseconds portion of the current time to the variable milliseconds. ...
...t give hour portion, minute portion, etc.; this method gives milliseconds portion. not to be confused with unix epoch time. to get total milliseconds since 1970/01/01, use the method ".gettime()". examples using getut
cmilliseconds() the following example assigns the milliseconds portion of the current time to the variable milliseconds. var today = new date(); var milliseconds = today.getut
cmilliseconds(); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.getut
cmilliseconds' in that specification. ...
Date.prototype.getUTCMonth() - JavaScript
the getut
cmonth() returns the month of the specified date according to universal time, as a zero-based value (where zero indicates the first month of the year). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.getut
cmonth() return value an integer number, between 0 and 11, corresponding to the month of the given date according to universal time. 0 for january, 1 for february, 2 for march, and so on. examples using getut
cmonth() the following example assigns the month portion of the current date to the variable month. ...
... a pull request. syntax dateobj.getut
cmonth() return value an integer number, between 0 and 11, corresponding to the month of the given date according to universal time. 0 for january, 1 for february, 2 for march, and so on. examples using getut
cmonth() the following example assigns the month portion of the current date to the variable month. var today = new date(); var month = today.getut
cmonth(); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.getut
cmonth' in that specification. ...
Date.prototype.setUTCMilliseconds() - JavaScript
the setut
cmilliseconds() method sets the milliseconds for a specified date according to universal time. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.setut
cmilliseconds(millisecondsvalue) parameters millisecondsvalue a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if a parameter you specify is outside of the expected range, setut
cmilliseconds() attempts to update the date information in the date object accordingly. for example, if you use 1100 for millisecondsvalue, t...
...ween 1 january 1970 00:00:00 utc and the updated date. description if a parameter you specify is outside of the expected range, setut
cmilliseconds() attempts to update the date information in the date object accordingly. for example, if you use 1100 for millisecondsvalue, the seconds stored in the date object will be incremented by 1, and 100 will be used for milliseconds. examples using setut
cmilliseconds() var thebigday = new date(); thebigday.setut
cmilliseconds(500); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.setut
cmilliseconds' in that specification. ...
calcMode - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> usage notes value discrete | linear | paced | spline default value linear animatable no discrete this specifies that the animation function will jump from one value to the next without any interpolation. linear simple linear interpolation between values is used to calculate the animation function. except for <animatemotion>, this is the default value. ...
...e. spline interpolates from one value in the values list to the next according to a time function defined by a cubic bézier spline. the points of the spline are defined in the keytimes attribute, and the control points for each interval are defined in the keysplines attribute. specifications specification status comment svg animations level 2the definition of 'cal
cmode' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'cal
cmode' in that specification. recommendation initial definition ...
CMS - MDN Web Docs Glossary: Definitions of Web-related terms
a
cms (content management system) is software that allows users to publish, organize, change, or remove various kinds of content, not only text but also embedded images, video, audio, and interactive code. learn more general knowledge content management system on wikipedia ...
SCM - MDN Web Docs Glossary: Definitions of Web-related terms
s
cm (source control management) is a system for managing source code. usually it refers to the use of software to handle versioning of source files. a programmer can modify source code files without being afraid of editing out useful stuff, because a s
cm keeps track of how the source code has changed and who made the changes. some s
cm systems include cvs, svn, git. learn more general knowledge revision control on wikipedia ...
nsStaticModuleInfo
summary this data structure is used by ns_initxpcom3 to specify static xpcom modules. #include "nsxpcom.h" struct nsstati
cmoduleinfo { const char* name; nsgetmoduleproc getmodule; }; members name this member provides the name of the module as a null-terminated, ascii-valued character array. getmodule this member provides a function pointer of type nsgetmoduleproc that returns a nsimodule instance. ...
SyncManager.getTags() - Web APIs
the syn
cmanager.gettags method of the syn
cmanager interface returns a list of developer-defined identifiers for syn
cmanager registrations. syntax syn
cmanager.gettags().then(function(tags[]) { ... }) returns a promise that resolves to an array of domstrings containing developer-defined identifiers for syn
cmanager registrations. parameters none. ...
SyncManager.register() - Web APIs
}) returns a promise that resolves to an instance of syncregistration. parameters options optional an object that sets options for an instance of syncregistration. the available options are: allowonbattery: a boolean that determines whether synchronization is allowed when the user agent is on a battery-powered device. the default is true. id: the unique identifier of the specified syncregistration object. idlerequired: a boolean that determines whether synchronization is allowed when the user agent's device is idle. the default is false. ...
SyncManager - Web APIs
the syn
cmanager interface of the the serviceworker api provides an interface for registering and listing sync registrations. properties none. methods syn
cmanager.register create a new sync registration and return a promise. syn
cmanager.gettags return a list of developer-defined identifiers for syn
cmanager registration. specifications specification status comment web background synchronizationthe definition of 'syn
cmanager' in that specification. living standard initial definition. ...
Date.prototype.getUTCMinutes() - JavaScript
the getut
cminutes() method returns the minutes in the specified date according to universal time. syntax dateobj.getut
cminutes() return value an integer number, between 0 and 59, representing the minutes in the given date according to universal time. examples using getut
cminutes() the following example assigns the minutes portion of the current time to the variable minutes. var today = new date(); var minutes = today.getut
cminutes(); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.getut
cminutes' in that specification. ...
Editor Embedding Guide - Archive of obsolete content
l pointer or a pointer to a valid structure filled with relative parameters to acommand (see list below for legal params). 3. verify if a command is enabled -- iscommandenabled: commandmanager->iscommanddisabled(acommand, retval) 4. get the current command state of a given command -- getcommandstate: commandmanager->getcommandstate(acommand,acommandparams) index of commands and parameters
cmd_bold toggles bold style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal bold
cmd_italics toggles italics style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_ena...
...ll"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal bold
cmd_italics toggles italics style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal italics
cmd_underline toggles underline on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal underline
cmd_tt toggles teletype style (monospace font) on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed...
...e_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal underline
cmd_tt toggles teletype style (monospace font) on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal teletype
cmd_strikethrough toggles strikethrough style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters example normal strikethrough
cmd_superscript toggles superscript style on selection. getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean),...
...And 40 more matches
Index
rtion of your own certificates, the certificates of peers or cas, and a list of trust decisions (such as to not trust a built-in ca, or to explicitly trust other cas). examples for the database files are key3.db and cert8.db, where the numbers are file version numbers. a third file contains the list of external pkcs#11 modules that have been registered to be used by nss. the file could be named se
cmod.db, but in newer database generations a file named pkcs11.txt is used. only nss is allowed to access and manipulate these database files directly; a programmer using nss must go through the apis offered by nss to manipulate the data stored in these files. the programmer's task is to initialize nss with the required parameters (such as a database), and nss will then transparently manage the d...
...time if data elements are still being referenced. in addition to the freebl, softoken, and ckbi modules, there is an utility library for general operations (e.g., encoding/decoding between data formats, a list of standardized object identifiers (oid)). nss has an ssl/tls module that implements the secure sockets layer/transport layer security network protocols, an s/mime module that implements
cms messaging used by secure email and some instant messaging implementations, a dbm library that implements the classic database storage, and finally a core nss library for the big set of “everything else”. newer generations of the database use the sqlite database to allow concurrent access by multiple applications. all of the above are provided as shared libraries. the crmf library, which i...
...e sqlite database to allow concurrent access by multiple applications. all of the above are provided as shared libraries. the crmf library, which is used to produce certain kinds of certificate requests, is available as a library for static linking only. when dealing with certificates (x.509), file formats such as pkcs#12 (certificates and keys), pkcs#7 (signed data), and message formats as
cms, we should mention asn.1, which is a syntax for storing structured data in a very efficient (small sized) presentation. it was originally developed for telecommunication systems at times where it was critical to minimize data as much as possible (although it still makes sense to use that principle today for good performance). in order to process data available in the asn.1 format, the usual appr...
...And 33 more matches
All keyboard shortcuts - Firefox Developer Tools
shortcuts work in the main browser window to open the specified tool. the same shortcuts will work to close tools hosted in the toolbox, if the tool is active. for tools like the browser console that open in a new window, you have to close the window to close the tool. ...
...tools like the browser console that open in a new window, you have to close the window to close the tool. ...
... open toolbox (with the most recent tool activated) ctrl + shift + i
cmd + opt + i ctrl + shift + i bring toolbox to foreground (if the toolbox is in a separate window and not in foreground) ctrl + shift + i or f12
cmd + opt + i or f12 ctrl + shift + i or f12 close toolbox (if the toolbox is in a separate window and in foreground) ctrl + shift + i or f12
cmd + opt + i or f12 ctrl + shift + i or f12 open web console 1 ctrl + shift + k
cmd + opt + k ctrl + shift + k toggle "pick an element from the page" (opens the toolbox and/or focus the inspector tab) ctrl + shift + c
cmd + opt + c ctrl + shift + c open style editor shift + f7 shift + f7 * shift + f7 open profiler shift + f5 sh...
...And 31 more matches
context-menu - Archive of obsolete content
e page context is appropriate when your item acts on the page as a whole. it does not occur when the user invokes the context menu on a link, image, or other non-text node, or while a selection exists. declarative contexts you can specify some simple, declarative contexts when you create a menu item by setting the context property of the options object passed to its constructor, like this: var
cm = require("sdk/context-menu");
cm.item({ label: "my menu item", context:
cm.urlcontext("*.mozilla.org") }); constructor description pagecontext() the page context. selectioncontext() this context occurs when the menu is invoked on a page in which the user has made a selection. selectorcontext(selector) this context occurs when the menu is in...
... the menu is invoked on the node specified or any descendant of that node, but the "context" event handler is passed the actual node on which the menu was invoked. the example above works because <img> elements can't contain other elements, but in the example below, node.nodename is not guaranteed to be "p" - for example, it won't be "p" if the user context-clicked a link inside a paragraph: var
cm = require("sdk/context-menu");
cm.item({ label: "a paragraph", context:
cm.selectorcontext("p"), contentscript: 'self.on("context", function (node) {' + ' console.log(node.nodename);' + ' return true;' + '});' }); the content script is executed for every page that a context menu is shown for. it will be executed the first time it is need...
...u. if you did not use selectorcontext to decide whether to show the menu item, then this is the actual node clicked. if you did use selectorcontext, then this is the node that matched your selector. for example, suppose your add-on looks like this: var script = "self.on('click', function (node, data) {" + " console.log('clicked: ' + node.nodename);" + "});"; var
cm = require("sdk/context-menu");
cm.item({ label: "body context", context:
cm.selectorcontext("body"), contentscript: script }); this add-on creates a context-menu item that uses selectorcontext to display the item whenever the context menu is activated on any descendant of the <body> element. when clicked, the item just logs the nodename property for the node passed to the click handler. ...
...And 27 more matches
Python binding for NSS
tion the doc directory contains other files you may wish to review. how to report a bug python-nss bugs are currently being tracked in the red hat bugzilla system for fedora. you can enter a bug report here. source download area source downloads are maintained here. links to download url for a specific release can be found in the release information section. mozilla source code management (s
cm) information on march 21, 2013 the nss project switched from using cvs as it's source code manager (s
cm) to mercurial, also known as hg. all prior cvs information (including release tags) were imported into the new mercurial repositories, as such there is no need to utilize the deprecated cvs repositories, use mercurial instead. to check out python-nss source code from mercurial do this: hg cl...
... you may want to review the getting mozilla source code using mercurial documentation for more information with working with mercurial. the old deprecated cvs documentation can be found here: getting mozilla source code using cvs. ...
...may want to review the getting mozilla source code using mercurial documentation for more information with working with mercurial. the old deprecated cvs documentation can be found here: getting mozilla source code using cvs. the old deprecated python-nss cvs source code location is mozilla/security/python/nss. release information release 1.0.1 release date 2017-02-28 s
cm tag pynss_release_1_0_1 source download https://ftp.mozilla.org/pub/mozilla.org/security/python-nss/releases/pynss_release_1_0_1/src/ change log add tls 1.3 cipher suites ssl_cipher_info.py now attempts to enable tls 1.3 fix build issue in setup.py. python-nss can now be build as python wheel, e.g. `pip wheel -w dist .` the following c...
...And 23 more matches
NSS functions
cert_verifycertnow mxr 3.2 and later. if you need to verify for multiple usages use cert_verifycertificatenow cert_verifyocspresponsesignature mxr 3.6 and later cert_verifysigneddata mxr 3.4 and later cert_verifysigneddatawithpublickey mxr 3.7 and later cert_verifysigneddatawithpublickeyinfo mxr 3.7 and later nss_
cmpcertchainwcanames mxr 3.2 and later nss_findcertkeatype mxr 3.2 and later cryptography functions the public functions listed here perform cryptographic operations based on the pkcs #11 interface. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross ...
... 3.2 and later seckey_destroyencryptedprivatekeyinfo mxr 3.2 and later seckey_destroyprivatekeyinfo mxr 3.2 and later seckey_destroypublickey mxr 3.2 and later seckey_publickeystrength mxr 3.2 and later seckey_updatecertpqg mxr 3.2 and later se
cmod_addnewmodule mxr 3.3 and later se
cmod_addnewmoduleex mxr 3.4 and later se
cmod_deletemoduleex mxr 3.12 and later se
cmod_cancelwait mxr 3.9.3 and later se
cmod_candeleteinternalmodule mxr 3.5 and later se
cmod_createmodule mxr 3.4 and later ...
...odule mxr 3.3 and later se
cmod_addnewmoduleex mxr 3.4 and later se
cmod_deletemoduleex mxr 3.12 and later se
cmod_cancelwait mxr 3.9.3 and later se
cmod_candeleteinternalmodule mxr 3.5 and later se
cmod_createmodule mxr 3.4 and later se
cmod_deletemodule mxr 3.4 and later se
cmod_findmodule mxr 3.4 and later se
cmod_findslot mxr 3.4 and later se
cmod_freemodulespeclist mxr 3.4 and later se
cmod_getdbmodulelist mxr 3.9 and later se
cmod_getdeadmodulelist mxr 3.9 and later ...
...And 23 more matches
Index
# page tags and summary 1 spidermonkey: the mozilla javascript runtime spidermonkey standalone source code releases can be found on the releases page. 2 creating javascript tests automated testing, build documentation, guide, qa, spidermonkey in which test suite does your new test belong? 3 creating javascript jstest reftests e
cmascript, guide, javascript, test in the js/src/tests directory, there are a few important subdirectories. 4 foss guide, spidermonkey feel free to add your own spidermonkey-based open source projects (and if necessary add categories)! 5 future directions guide, mozilla, spidermonkey this article documents future directions in functionality, design, an...
...lue. the conversion always succeeds. 71 js::symbolvalue jsapi reference, reference, référence(2), spidermonkey js::symbolvalue converts a given js::symbol to js::value. the conversion always succeeds. 72 js::toboolean jsapi reference, spidermonkey js::toboolean converts a javascript value to a boolean. it implements the toboolean operation described in e
cma 262 §7.1.2.this function can not fail and the return value is always the boolean conversion of the argument. 73 js::toint32 jsapi reference, reference, référence(2), spidermonkey js::toint32 converts a javascript value to a signed 32bit integer. it implements the toint32 operator described in e
cma 262-3 §9.5. 74 js::toint64 jsapi reference, reference, réf...
...r. it implements the toint32 operator described in e
cma 262-3 §9.5. 74 js::toint64 jsapi reference, reference, référence(2), spidermonkey js::toint64 converts a javascript value to a signed 64bit integer. 75 js::tonumber jsapi reference, spidermonkey js::tonumber converts a javascript value to a number. it implements the tonumber operator described in e
cma 262-3 §9.3. 76 js::toprimitive jsapi reference, spidermonkey js::toprimitive converts a javascript object, obj, to a primitive value using e
cmascript 6 toprimitive. 77 js::tostring jsapi reference, reference, référence(2), spidermonkey js::tostring returns a string representation of a javascript value. 78 js::touint16 jsapi reference, r...
...And 21 more matches
S/MIME functions
ctions listed here perform s/mime operations using the s/mime toolkit. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...ozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...ion definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...And 17 more matches
List of commands - Archive of obsolete content
the following lists commands which might be usable by <command> or command dispatchers/controllers. ...
... the following lists commands which might be usable by <command> or command dispatchers/controllers. ...
... the following lists commands which might be usable by <command> or command dispatchers/controllers. ...
...And 16 more matches
Commands - Archive of obsolete content
ed for you. you can use a command for any operation. mozilla uses them for almost every menu command. in addition, text fields and other widgets have a number of commands which they already support that you can invoke. you should use them when the operation depends on which element is focused. a command is identified by its id attribute. ...
...a uses the convention that command id's start with '
cmd_'. you will probably want to use the same id if a command is already being used, however, for your own commands, you can use any command id you wish. to avoid conflicts, you may wish to include the application name in the command id. a simple way of using commands is as follows: example: simple command example 1 : source view <command id="
cmd_openhelp" oncommand="alert('help!');"/> <button label="help" command="
cmd_openhelp"/> in this example, instead of placing the oncommand attribute on the button, we instead place it on a command element. the two are then linked using the command attribute, which has the value of the command's id. the result is that when the button is pressed, the command '
cmd_openhelp' is invoked. there are tw...
...y hook up elements that would send a command event. additionally, if you set the disabled attribute on the command, the command will be disabled and it will not be invoked. any buttons and menu items hooked up to it will be disabled automatically. if you re-enable the command, the buttons will become enabled again. ...
...And 15 more matches
JavaScript language resources - JavaScript
e
cmascript is the scripting language that forms the basis of javascript. e
cmascript standardized by the e
cma international standards organization in the e
cma-262 and e
cma-402 specifications. ...
... e
cmascript is the scripting language that forms the basis of javascript. e
cmascript standardized by the e
cma international standards organization in the e
cma-262 and e
cma-402 specifications. ...
... e
cmascript is the scripting language that forms the basis of javascript. e
cmascript standardized by the e
cma international standards organization in the e
cma-262 and e
cma-402 specifications. ...
...And 15 more matches
Index - Archive of obsolete content
95% of the measured results. for example if the mean is 100 and the 95% confidence interval is 2%, 95% of the expected values should fall between 98 and 102. to compare two vms against each other export avm2=<path to 2nd vm> or use --avm2=<path to 2nd vm>. the percentage difference is calculated between the two vms. see the --help usage for more details about performance tests. ...
... for example if the mean is 100 and the 95% confidence interval is 2%, 95% of the expected values should fall between 98 and 102. to compare two vms against each other export avm2=<path to 2nd vm> or use --avm2=<path to 2nd vm>. the percentage difference is calculated between the two vms. see the --help usage for more details about performance tests. ...
...he 95% confidence interval is 2%, 95% of the expected values should fall between 98 and 102. to compare two vms against each other export avm2=<path to 2nd vm> or use --avm2=<path to 2nd vm>. the percentage difference is calculated between the two vms. see the --help usage for more details about performance tests. 657
cmdline tests the
cmdline testsuite is located in test/
cmdline. ...
...And 11 more matches
Scratchpad - Archive of obsolete content
examining some globals: window /* [object chromewindow] */ gbrowser /* [object xulelement] */ the scratchpad execution context is set to browser when a snippet file has // -sp-context: browser on the first line. ...
...hpad execution context is set to browser when a snippet file has // -sp-context: browser on the first line. ...
...e first line. ...
...And 11 more matches
Strict mode - JavaScript
strict mode isn't just a subset: it intentionally has different semantics from normal code. browsers not supporting strict mode will run strict mode code with different behavior from browsers that do, so don't rely on strict mode without feature-testing for support for the relevant aspects of strict mode. ...
...y. strict mode makes several changes to normal javascript semantics: eliminates some javascript silent errors by changing them to throw errors. fixes mistakes that make it difficult for javascript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that's not strict mode. prohibits some syntax likely to be defined in future versions of e
cmascript. see transitioning to strict mode, if you want to change your code to work in the restricted variant of javascript. invoking strict mode strict mode applies to entire scripts or to individual functions. it doesn't apply to block statements enclosed in {} braces; attempting to apply it to such contexts does nothing. eval code, function code, event handler attributes, strings passed to w...
... strict mode for a function, put the exact statement "use strict"; (or 'use strict';) in the function's body before any other statements. function strict() { // function-level strict mode syntax 'use strict'; function nested() { return 'and so am i!'; } return "hi! i'm a strict mode function! " + nested(); } function notstrict() { return "i'm not strict."; } strict mode for modules e
cmascript 2015 introduced javascript modules and therefore a 3rd way to enter strict mode. the entire contents of javascript modules are automatically in strict mode, with no statement needed to initiate it. function strict() { // because this is a module, i'm strict by default } export default strict; changes in strict mode strict mode changes both syntax and runtime behavior. changes gene...
...And 11 more matches
Rosetta - Archive of obsolete content
by default, the only possible standardized scripting language for html is e
cmascript. hence, if you are going to use another scripting language you might expect that most of the browsers will not recognize it. also, regarding some languages (like c), it is even not well defined the meaning of part of their semantics in respect to a scope that is more restricted than the full access to the resources they usually deal with – imagine, for example, the meaning of a c pointer within a html page! ...
...we can show, however, a possible way to start from. the following code is nothing...
...ng of part of their semantics in respect to a scope that is more restricted than the full access to the resources they usually deal with – imagine, for example, the meaning of a c pointer within a html page! nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in e
cmascript allow us, in theory, to build full virtual machines in pure e
cmascript. therefore, it is also possible, in theory, to use e
cmascript for a smaller task: parsing exotic programming languages (i.e., creating compilers). beyond e
cmascript this is not the place for showing a full compiler written in e
cmascript. we can show, however, a possible way to start from. the following code is nothing but the base for an extensible collection of compilers. but by default...
...And 10 more matches
NSS PKCS11 Functions
pkcs #11 functions this chapter describes the core pkcs #11 functions that an application needs for communicating with cryptographic modules. in particular, these functions are used for obtaining certificates, keys, and passwords. this was converted from "chapter 7: pkcs #11 functions". back to the nss reference main page. ...
... pkcs #11 functions this chapter describes the core pkcs #11 functions that an application needs for communicating with cryptographic modules. in particular, these functions are used for obtaining certificates, keys, and passwords. this was converted from "chapter 7: pkcs #11 functions". back to the nss reference main page. ...
... pkcs #11 functions this chapter describes the core pkcs #11 functions that an application needs for communicating with cryptographic modules. in particular, these functions are used for obtaining certificates, keys, and passwords. this was converted from "chapter 7: pkcs #11 functions". back to the nss reference main page. ...
...And 9 more matches
Lexical grammar - JavaScript
control characters control characters have no visual representation but are used to control the interpretation of the text. ...
... control characters control characters have no visual representation but are used to control the interpretation of the text. ...
...ove the readability of the source text. however, in some cases, line terminators can influence the execution of javascript code as there are a few places where they are forbidden. line terminators also affect the process of automatic semicolon insertion. line terminators are matched by the \s class in regular expressions. only the following unicode code points are treated as line terminators in e
cmascript, other line breaking characters are treated as white space (for example, next line, nel, u+0085 is considered as white space). line terminator characters code point name abbreviation description escape sequence u+000a line feed <lf> new line character in unix systems. \n u+000d carriage return <cr> new line character in ...
...And 9 more matches
Localization - Archive of obsolete content
text/css"?> <!doctype window system "chrome://findfile/locale/findfile.dtd"> <window id="findfile-window" title="&findwindow.title;" persist="screenx screeny width height" orient="horizontal" onload="initsearchlist()" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="findfile.js"/> <popupset> <menupopup id="editpopup"> <menuitem label="&cut
cmd.label;" accesskey="&cut
cmd.accesskey;"/> <menuitem label="©
cmd.label;" accesskey="©
cmd.accesskey;"/> <menuitem label="&paste
cmd.label;" accesskey="&paste
cmd.accesskey;" disabled="true"/> </menupopup> </popupset> <keyset> <key id="cut_
cmd" modifiers="accel" key="&cut
cmd.commandkey;"/> <key id="copy_
cmd" modifiers="accel" key="©
cmd.commandkey;"/> <key id="paste_c...
...sskey;"/> <menuitem label="©
cmd.label;" accesskey="©
cmd.accesskey;"/> <menuitem label="&paste
cmd.label;" accesskey="&paste
cmd.accesskey;" disabled="true"/> </menupopup> </popupset> <keyset> <key id="cut_
cmd" modifiers="accel" key="&cut
cmd.commandkey;"/> <key id="copy_
cmd" modifiers="accel" key="©
cmd.commandkey;"/> <key id="paste_
cmd" modifiers="accel" key="&paste
cmd.commandkey;"/> <key id="close_
cmd" keycode="vk_escape" oncommand="window.close();"/> </keyset> <vbox flex="1"> <toolbox> <menubar id="findfiles-menubar"> <menu id="file-menu" label="&filemenu.label;" accesskey="&filemenu.accesskey;"> <menupopup id="file-popup"> <menuitem label="&open
cmd.label;" accesskey="&open
cmd.accesskey;"/> <menuit...
...> <key id="close_
cmd" keycode="vk_escape" oncommand="window.close();"/> </keyset> <vbox flex="1"> <toolbox> <menubar id="findfiles-menubar"> <menu id="file-menu" label="&filemenu.label;" accesskey="&filemenu.accesskey;"> <menupopup id="file-popup"> <menuitem label="&open
cmd.label;" accesskey="&open
cmd.accesskey;"/> <menuitem label="&save
cmd.label;" accesskey="&save
cmd.accesskey;"/> <menuseparator/> <menuitem label="&close
cmd.label;" accesskey="&close
cmd.accesskey;" key="close_
cmd" oncommand="window.close();"/> </menupopup> </menu> <menu id="edit-menu" label="&editmenu.label;" accesskey="&editmenu.accesskey;"> <menupopup id="edit-popup"> <menui...
...And 8 more matches
nsIMacDockSupport
lla-release/source/browser/base/content/browser.js#1562 this is seen here: if you were to copy and follow that example you would replace the default native menu. ...
...le you would replace the default native menu. ...
...lt native menu. ...
...And 8 more matches
Index - Web APIs
ing the aes-cbc algorithm. 43 aesctrparams api, aesctrparams, dictionary, reference, web crypto api the aesctrparams dictionary of the web crypto api represents the object that should be passed as the algorithm parameter into subtlecrypto.encrypt(), subtlecrypto.decrypt(), subtlecrypto.wrapkey(), or subtlecrypto.unwrapkey(), when using the aes-ctr algorithm. 44 aesg
cmparams api, aesg
cmparams, dictionary, reference, web crypto api the aesg
cmparams dictionary of the web crypto api represents the object that should be passed as the algorithm parameter into subtlecrypto.encrypt(), subtlecrypto.decrypt(), subtlecrypto.wrapkey(), or subtlecrypto.unwrapkey(), when using the aes-g
cm algorithm. 45 aeskeygenparams api, aeskeygenparams, dictionar...
...the samples to the specified channel of the audiobuffer, from the source array. 107 audiobuffer.duration api, audiobuffer, property, reference, web audio api, duration a double. 108 audiobuffer.getchanneldata() api, audiobuffer, method, reference, web audio api the getchanneldata() method of the audiobuffer interface returns a float32array containing the p
cm data associated with the channel, defined by the channel parameter (with 0 representing the first channel). 109 audiobuffer.length api, audiobuffer, property, reference, web audio api, length the length property of the audiobuffer interface returns an integer representing the length, in sample-frames, of the p
cm data stored in the buffer. 110 audiobuffer.numberofch...
... interface of the indexeddb api will be implemented by worker objects. 2030 idbfactory api, http, indexeddb, interface, offline, reference, storage in the following code snippet, we make a request to open a database, and include handlers for the success and error cases. ...
...And 8 more matches
JavaScript modules - JavaScript
10.3samsung internet android full support 8.0nodejs full support 13.2.0notes full support 13.2.0notes notes modules must either have a filename ending in .mjs, or the nearest parent package.json file must contain "type": "module". ...
...es must either have a filename ending in .mjs, or the nearest parent package.json file must contain "type": "module". see node's e
cmascript modules documentation for more details. full support 12.0.0notes disabled notes modules must either have a filename ending in .mjs, or the nearest parent package.json file must contain "type": "module". see node's e
cmascript modules documentation for more details.disabled from version 12.0.0: this feature is behind the --experimental-modules runtime flag. full support 8.5.0notes disabled notes module filenames must end with .mjs, not .js. ...
...have a filename ending in .mjs, or the nearest parent package.json file must contain "type": "module". see node's e
cmascript modules documentation for more details.disabled from version 12.0.0: this feature is behind the --experimental-modules runtime flag. full support 8.5.0notes disabled notes module filenames must end with .mjs, not .js. ...
...And 8 more matches
Private class fields - JavaScript
rn 'hello world' } } class classwithprivatestaticfield { static #private_static_field } examples private static fields private fields are accessible on the class constructor from inside the class declaration itself. the limitation of static variables being called by only static methods still holds. class classwithprivatestaticfield { static #private_static_field static publicstati
cmethod() { classwithprivatestaticfield.#private_static_field = 42 return classwithprivatestaticfield.#private_static_field } } console.assert(classwithprivatestaticfield.publicstati
cmethod() === 42) private static fields are added to the class constructor at class evaluation time. there is a provenance restriction on private static fields. only the class which defines the private stati...
...licstati
cmethod() === 42) private static fields are added to the class constructor at class evaluation time. there is a provenance restriction on private static fields. only the class which defines the private static field can access the field. this can lead to unexpected behaviour when using this. ...
... private static field can access the field. this can lead to unexpected behaviour when using this. class baseclasswithprivatestaticfield { static #private_static_field static basepublicstati
cmethod() { this.#private_static_field = 42 return this.#private_static_field } } class subclass extends baseclasswithprivatestaticfield { } let error = null try { subclass.basepublicstati
cmethod() } catch(e) { error = e} console.assert(error instanceof typeerror) private instance fields private instance fields are declared with # names (pronounced "hash names"), which are identifiers prefixed with #. the # is a part of the name itself. it is used for declaration and accessing as well. the encapsulation is enforced by the language. it is a syntax error to refer to # names from o...
...And 8 more matches
Communicating with frame scripts
necessary, frame scripts can pass wrappers called cross process object wrappers (also known as cpows) to chrome, and chrome can use these wrappers to get synchronous access to content objects. content to chrome the frame script can choose to send synchronous or asynchronous messages to chrome code. asynchronous messaging to send an asynchronous message the frame script uses the global sendasyn
cmessage() function: // frame script sendasyn
cmessage("my-addon@me.org:my-e10s-extension-message"); sendasyn
cmessage() takes one mandatory parameter, which is the name of the message. all messages share the same namespace, so to avoid conflicts with other code, you'll need to ensure that the names you use are unique. if you're using the message manager in an add-on, a good way to do that is to pre...
...me, you can pass detailed data as a string or a json-serializable object, and after that you can pass any objects it wants to pass to content as cpows. the example below sends a message named "my-e10s-extension-message", with a data payload containing details and tag properties, and exposes the event.target object as a cpow: // frame script addeventlistener("click", function (event) { sendasyn
cmessage("my-addon@me.org:my-e10s-extension-message", { details : "they clicked", tag : event.target.tagname }, { target : event.target }); }, false); to receive messages from content, a chrome script needs to add a message listener using the message manager's addmessagelistener() api. the message passed to the listener is an object containing the following properties: ...
... needs to add a message listener using the message manager's addmessagelistener() api. the message passed to the listener is an object containing the following properties: name string containing the message name. sync boolean declaring whether the message was send synchronously or aynchronously. ...
...And 7 more matches
Message manager overview
essage manager, it's received by all content tabs, and is then delivered to any frame scripts that are listening for it. ...
...particular window. if you send a message using the window message manager, it gets sent to all content tabs in that window. ...
...end are delivered only to that content tab. you can mix and match: so for example, you could load a script into every tab using the global message manager, but then send a message to the script instance loaded into a specific tab by using the browser message manager. ...
...And 7 more matches
NSS_3.12_release_notes.html
ategenericobject (see pk11pub.h) pk11_createpbev2algorithmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11pub.h) pk11_getpbecryptomechanism (see pk11pub.h) pk11_isremovable (see pk11pub.h) pk11_mergetokens (see pk11pub.h) pk11_writerawattribute (see pk11pub.h) seckey_ecparamstobasepointorderlen (see keyhi.h) seckey_ecparamstokeysize (see keyhi.h) se
cmod_deletemoduleex (see se
cmod.h) sec_getregisteredhttpclient (see ocsp.h) sec_pkcs5isalgorithmpbealgtag (see secpkcs5.h) vfy_createcontextdirect (see cryptohi.h) vfy_createcontextwithalgorithmid (see cryptohi.h) vfy_verifydatadirect (see cryptohi.h) vfy_verifydatawithalgorithmid (see cryptohi.h) vfy_verifydigestdirect (see cryptohi.h) vfy_verifydigestwithalgorithmid (see cryptohi.h) new macros f...
...oken_not_logged_in sec_error_ocsp_responder_cert_invalid sec_error_ocsp_bad_signature sec_error_out_of_search_limits sec_error_invalid_policy_mapping sec_error_policy_validation_failed sec_error_unknown_aia_location_type sec_error_bad_http_response sec_error_bad_ldap_response sec_error_failed_to_encode_data sec_error_bad_info_access_location sec_error_libpkix_internal new mechanism flags (see se
cmod.h) public_mech_aes_flag public_mech_sha256_flag public_mech_sha512_flag public_mech_camellia_flag new oids (see secoidt.h) new ec signature oids sec_oid_ansix962_ecdsa_signature_recommended_digest sec_oid_ansix962_ecdsa_signature_specified_digest sec_oid_ansix962_ecdsa_sha224_signature sec_oid_ansix962_ecdsa_sha256_signature sec_oid_ansix962_ecdsa_sha384_signature sec_oid_ansix962_ecdsa_sh...
... after use. bug 414985: crash in pkix_pl_ocsprequest_destroy bug 421870: strsclnt crashed in pkix tests. ...
...And 7 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
es of data so that servers can fulfill data requests based on which servers are closest to the respective end-users. cdns make for fast service less affected by high traffic. 46 cia glossary, security cia (confidentiality, integrity, availability) (also called the cia triad or aic triad) is a model that guides an organization's policies for information security. 47
cms
cms, composing, content management system, glossary a
cms (content management system) is software that allows users to publish, organize, change, or remove various kinds of content, not only text but also embedded images, video, audio, and interactive code. 48 cors glossary, infrastructure, security cors (cross-origin resource sharing) is a system, consisting of tr...
..., in javascript it is possible to change the type of a variable or add new properties or methods to an object while the program is running. 123 dynamic typing codingscripting, glossary, programminglanguage dynamically-typed languages are those (like javascript) where the interpreter assigns variables a type at runtime based on the variable's value at the time. ...
... type of a variable or add new properties or methods to an object while the program is running. 123 dynamic typing codingscripting, glossary, programminglanguage dynamically-typed languages are those (like javascript) where the interpreter assigns variables a type at runtime based on the variable's value at the time. 124 e
cma glossary, stub, webmechanics e
cma international (formally european computer manufacturers association) is a non-profit organization that develops standards in computer hardware, communications, and programming languages. 125 e
cmascript glossary, webmechanics e
cmascript is a scripting language specification on which javascript is based. e
cma international is in charge of standardizing e
cmascript. 126 ...
...And 6 more matches
Style Editor - Firefox Developer Tools
l be used for all the developer tools that use the source editor. you need to reopen the editor for the change to take effect. from firefox 33 onwards, the key binding preference is exposed in the editor preferences section of the developer tools settings, and you can set it there instead of about:config. ...
... for all the developer tools that use the source editor. you need to reopen the editor for the change to take effect. from firefox 33 onwards, the key binding preference is exposed in the editor preferences section of the developer tools settings, and you can set it there instead of about:config. ...
...o reopen the editor for the change to take effect. from firefox 33 onwards, the key binding preference is exposed in the editor preferences section of the developer tools settings, and you can set it there instead of about:config. ...
...And 6 more matches
JavaScript technologies overview - JavaScript
introduction whereas html defines a webpage's structure and content and css sets the formatting and appearance, javascript adds interactivity to a webpage and creates rich web applications. however, the umbrella term "javascript" as understood in a web browser context contains several very different elements. one of them is the core language (e
cmascript), another is the collection of the web apis, including the dom (document object model). ...
...ts the formatting and appearance, javascript adds interactivity to a webpage and creates rich web applications. however, the umbrella term "javascript" as understood in a web browser context contains several very different elements. one of them is the core language (e
cmascript), another is the collection of the web apis, including the dom (document object model). javascript, the core language (e
cmascript) the core language of javascript is standardized by the e
cma tc39 committee as a language named e
cmascript. ...
...ents. one of them is the core language (e
cmascript), another is the collection of the web apis, including the dom (document object model). javascript, the core language (e
cmascript) the core language of javascript is standardized by the e
cma tc39 committee as a language named e
cmascript. this core language is also used in non-browser environments, for example in node.js. what falls under the e
cmascript scope? ...
...And 6 more matches
Performance
ribed in their respective subtopics. performance best practices declaring stateless functions once per process bad: // addon.js services.mm.loadframescript("framescript.js", true) // framescript.js const precomputedconstants = // ... function helper(window, action) { // ... do some work on the window } function dosomething(message) { result = helper(content, message.data) sendasyn
cmessage("my-addon:response-from-child", {something: result}) } addmessagelistener("my-addon:request-from-parent", dosomething) why is this bad? because declared functions are also objects. and since frame scripts get evaluated for each tab this means new function objects get instantiated, new constants get computed, block scopes must be set up etc. while it may seem fairly innocencous in this...
....js components.utils.import("resource://my-addon/processmodule.jsm", {}).addframe(this) // processmodule.jsm const exported_symbols = ['addframe']; const precomputedconstants = // ... function helper(window, action) { // ... do some work on the window } function dosomething(message) { frameglobal = message.target result = helper(frameglobal.content, message.data) frameglobal.sendasyn
cmessage("my-addon:response-from-child", {something: result}) } function addframe(frameglobal) { frameglobal.addmessagelistener("my-addon:request-from-parent", dosomething) } javascript modules are per-process singletons and thus all their objects are only initialized once, which makes them suitable for stateless callbacks. but care must be taken to not leak references to the frame script gl...
...en to not leak references to the frame script global when it is passed into a jsm. alternatively the frame's unload event or weak maps can be used to ensure that frames can be cleaned up when their respective tab is closed. store heavyweight state once per process bad: // addon.js var main = new myaddonservice(); main.onchange(statechange); function statechange() { services.mm.broadcastasyn
cmessage("my-addon:update-configuration", {newconfig: main.serialize()}) } // framescript.js var maincopy; function onupdate(message) { maincopy = myaddonservice.deserialize(message.data.newconfig); } addmessagelistener("my-addon:update-configuration", onupdate) // maincopy used by other functions the main issue here is that a separate object is kept for each tab. not only does that incre...
...And 5 more matches
NSS 3.12.4 release notes
is also available on ftp.mozilla.org for secure https download: source tarball: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_4_rtm/src/. major changes in nss 3.12.4 nss 3.12.4 is the version that we submitted to nist for fips 140-2 validation. currently nss 3.12.4 is in the "review pending" state in the fips 140-2 pre-validation list at http://csrc.nist.gov/groups/stm/
cmvp/documents/140-1/140inprocess.pdf added crl distribution point support (see cert.h). cert_decodecrlissuingdistributionpoint cert_findcrlissuingdistpointexten the old documentation of the expression matching syntax rules was incorrect, and the new corrected documentation is as follows for public nssutil functions (see portreq.h): port_regexpvalid port_regexpsearch port_regexpcasesearch ...
... separator is required. more are permitted. expressions inside unions may not include unions or exclusions. inside a union, to be matched and not treated as a special character, these characters must be escaped: \ ( | ) [ ~ except when they occur inside a bracketed expression, where only \ and ] require escaping. new functions in the nss shared library: pk11_isinternalkeyslot (see pk11pub.h) se
cmod_opennewslot (see pk11pub.h) new error codes (see secerr.h): sec_error_bad_info_access_method sec_error_crl_import_failed new oids (see secoidt.h) sec_oid_x509_any_policy the nssckbi pkcs #11 module's version changed to 1.75. obsolete code for win16 has been removed. support for openvms has been removed. bugs fixed the following bugs have been fixed in nss 3.12.4. bug 321755: imp...
...oad libsqlite3.so crash [@ @0x0 ] bug 495097: sdb_mapsqlerror returns signed int bug 495103: nss_initreadwrite(sql:<dbdir>) causes nss to look for sql:<dbdir>/libnssckbi.so bug 495365: add const to the 'nickname' parameter of sec_certnicknameconflict bug 495656: nss_initreadwrite(sql:<configdir>) leaves behind a pkcs11.txu file if libnssckbi.so is in <configdir>. ...
...And 5 more matches
Using XPCOM Components
ager component, and the selected cookie is deleted from disk and removed from the displayed list. ...
...st. ...
...e snippet in getting the cookiemanager component in javascript shows how the remove() method from the xpcom cookiemanager component can be called from javascript: getting the cookiemanager component in javascript // xpconnect to cookiemanager // get the cookie manager component in javascript var
cmgr = components.classes["@mozilla.org/cookiemanager;1"] .getservice();
cmgr =
cmgr.queryinterface(components.interfaces.nsicookiemanager); // called as part of a largerdeleteallcookies() function function finalizecookiedeletions() { for (var c=0; c<deletedcookies.length; c++) {
cmgr.remove(deletedcookies[c].host, deletedcookies[c].name, deletedcookies[c].path); } deletedcookies.length = 0; } connecting to components from the inter...
...And 5 more matches
SubtleCrypto.encrypt() - Web APIs
ith the encrypted data (also known as "ciphertext"). syntax const result = crypto.subtle.encrypt(algorithm, key, data); parameters algorithm is an object specifying the algorithm to be used and any extra parameters if required: to use rsa-oaep, pass an rsaoaepparams object. to use aes-ctr, pass an aesctrparams object. to use aes-cbc, pass an aescbcparams object. to use aes-g
cm, pass an aesg
cmparams object. key is a cryptokey containing the key to be used for encryption. data is a buffersource containing the data to be encrypted (also known as the plaintext). return value result is a promise that fulfills with an arraybuffer containing the "ciphertext". exceptions the promise is rejected when the following exceptions are encountered: invalidaccesserro...
...ons the promise is rejected when the following exceptions are encountered: invalidaccesserror raised when the requested operation is not valid for the provided key (e.g. invalid encryption algorithm, or invalid key for the specified encryption algorithm). operationerror raised when the operation failed for an operation-specific reason (e.g. algorithm parameters of invalid sizes, or aes-g
cm plaintext longer than 2³⁹−256 bytes). supported algorithms the web crypto api provides four algorithms that support the encrypt() and decrypt() operations. one of these algorithms — rsa-oaep — is a public-key cryptosystem. the other three encryption algorithms here are all symmetric algorithms, and they're all based on the same underlying cipher, aes (advanced encryption standard). ...
...t() operations. one of these algorithms — rsa-oaep — is a public-key cryptosystem. the other three encryption algorithms here are all symmetric algorithms, and they're all based on the same underlying cipher, aes (advanced encryption standard). the difference between them is the mode. the web crypto api supports three different aes modes: ctr (counter mode) cbc (cipher block chaining) g
cm (galois/counter mode) it's strongly recommended to use authenticated encryption, which includes checks that the ciphertext has not been modified by an attacker. authentication helps protect against chosen-ciphertext attacks, in which an attacker can ask the system to decrypt arbitrary messages, and use the result to deduce information about the secret key. while it's possible to add authenticat...
...And 5 more matches
SubtleCrypto.unwrapKey() - Web APIs
nwrappingkey is the cryptokey to use to decrypt the wrapped key. the key must have the unwrapkey usage set. unwrapalgo is an object specifying the algorithm to be used to encrypt the exported key, and any extra parameters as required: to use rsa-oaep, pass an rsaoaepparams object. to use aes-ctr, pass an aesctrparams object. to use aes-cbc, pass an aescbcparams object. to use aes-g
cm, pass an aesg
cmparams object. to use aes-kw, pass the string "aes-kw" or an object of the form { "name": "aes-kw }. unwrappedkeyalgo is a dictionary object defining the type of key to unwrap and providing extra algorithm-specific parameters as required. for rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep: pass an rsahashedimportparams object. for ecdsa or ecdh: pass an eckeyimportparams...
...t of the form { "name": "aes-kw }. unwrappedkeyalgo is a dictionary object defining the type of key to unwrap and providing extra algorithm-specific parameters as required. for rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep: pass an rsahashedimportparams object. for ecdsa or ecdh: pass an eckeyimportparams object. for hmac: pass an hmacimportparams object. for aes-ctr, aes-cbc, aes-g
cm, or aes-kw: pass the string identifying the algorithm or an object of the form { "name": algorithm }, where algorithm is the name of the algorithm. extractable is a boolean indicating whether it will be possible to export the key using subtlecrypto.exportkey() or subtlecrypto.wrapkey(). keyusages is an array indicating what can be done with the key. possible values of the array are: ...
...ncryption or wrapping. syntaxerror raised when keyusages is empty but the unwrapped key is of type secret or private. typeerror raised when trying to use an invalid format. supported algorithms the unwrapkey() method supports the same algorithms as the wrapkey() method. examples note: you can try the working examples on github. unwrapping a "raw" key in this example we unwrap an aes-g
cm symmetric key. the key was exported in "raw" format and encrypted using the aes-kw algorithm, with a key derived from a password. to unwrap, we ask the user for the password and use pbkdf2 and some salt to derive the aes-kw unwrapping key. the salt needs to be the same as the salt that was used to derive the original aes-kw key wrapping key. once we have the unwrapping key we pass it into unwra...
...And 5 more matches
SubtleCrypto.wrapKey() - Web APIs
o wrap. wrappingkey is the cryptokey used to encrypt the exported key. the key must have the wrapkey usage set. wrapalgo is an object specifying the algorithm to be used to encrypt the exported key, and any required extra parameters: to use rsa-oaep, pass an rsaoaepparams object. to use aes-ctr, pass an aesctrparams object. to use aes-cbc, pass an aescbcparams object. to use aes-g
cm, pass an aesg
cmparams object. to use aes-kw, pass the string "aes-kw", or an object of the form { "name": "aes-kw }. return value result is a promise that fulfills with an arraybuffer containing the encrypted exported key. exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccesserror raised when the wrapping key is not a key for the...
... typeerror raised when trying to use an invalid format. supported algorithms all algorithms that are usable for encryption are also usable for key wrapping, as long as the key has the "wrapkey" usage set. for key wrapping you have the additional option of aes-kw. aes-kw aes-kw is a way to use the aes cipher for key wrapping. one advantage of using aes-kw over another aes mode such as aes-g
cm is that aes-kw does not require an initialization vector. to use aes-kw, the input must be a multiple of 64 bits. aes-kw is specified in rfc 3394. examples note: you can try the working examples out on github. raw wrap this example wraps an aes key. it uses "raw" as the export format and aes-kw, with a password-derived key, to encrypt it. see the complete code on github. let salt; /* get...
... key encryption key const keymaterial = await getkeymaterial(); salt = window.crypto.getrandomvalues(new uint8array(16)); const wrappingkey = await getkey(keymaterial, salt); return window.crypto.subtle.wrapkey( "raw", keytowrap, wrappingkey, "aes-kw" ); } /* generate an encrypt/decrypt secret key, then wrap it. */ window.crypto.subtle.generatekey( { name: "aes-g
cm", length: 256, }, true, ["encrypt", "decrypt"] ) .then((secretkey) => { return wrapcryptokey(secretkey); }) .then((wrappedkey) => { console.log(wrappedkey); }); pkcs #8 wrap this example wraps an rsa private signing key. it uses "pkcs8" as the export format and aes-g
cm, with a password-derived key, to encrypt it. see the complete code on github. let salt; let iv; /* get some k...
...And 5 more matches
JavaScript data types and data structures - JavaScript
s are drawn. dynamic typing javascript is a loosely typed and dynamic language. ...
...es as "primitive values". boolean type boolean represents a logical entity and can have two values: true and false. see boolean and boolean for more details. null type the null type has exactly one value: null. see null and null for more details. undefined type a variable that has not been assigned a value has the value undefined. see undefined and undefined for more details. number type e
cmascript has two built-in numeric types: number and bigint (see below). the number type is a double-precision 64-bit binary format ieee 754 value (numbers between -(253 − 1) and 253 − 1). in addition to representing floating-point numbers, the number type has three symbolic values: +infinity, -infinity, and nan ("not a number"). to check for the largest available value or smallest available v...
...sion 64-bit binary format ieee 754 value (numbers between -(253 − 1) and 253 − 1). in addition to representing floating-point numbers, the number type has three symbolic values: +infinity, -infinity, and nan ("not a number"). to check for the largest available value or smallest available value within ±infinity, you can use the constants number.max_value or number.min_value. starting with e
cmascript 2015, you are also able to check if a number is in the double-precision floating-point number range using number.issafeinteger() as well as number.max_safe_integer and number.min_safe_integer. beyond this range, integers in javascript are not safe anymore and will be a double-precision floating point approximation of the value. the number type has only one integer with two representatio...
...And 5 more matches
Introduction - JavaScript
d dynamically. variable data types are not declared (dynamic typing, loosely typed). variable data types must be declared (static typing, strongly typed). cannot automatically write to hard disk. can automatically write to hard disk. for more information on the differences between javascript and java, see the chapter details of the object model. ...
...ared (dynamic typing, loosely typed). variable data types must be declared (static typing, strongly typed). cannot automatically write to hard disk. can automatically write to hard disk. for more information on the differences between javascript and java, see the chapter details of the object model. javascript and the e
cmascript specification javascript is standardized at e
cma international — the european association for standardizing information and communication systems (e
cma was formerly an acronym for the european computer manufacturers association) to deliver a standardized, international programming language based on javascript. this standardized version of javascript, called e
cmascript, behaves the same way in all applications that support the standard. compa...
... systems (e
cma was formerly an acronym for the european computer manufacturers association) to deliver a standardized, international programming language based on javascript. this standardized version of javascript, called e
cmascript, behaves the same way in all applications that support the standard. companies can use the open standard language to develop their implementation of javascript. the e
cmascript standard is documented in the e
cma-262 specification. see new in javascript to learn more about different versions of javascript and e
cmascript specification editions. the e
cma-262 standard is also approved by the iso (international organization for standardization) as iso-16262. you can also find the specification on the e
cma international website. ...
...And 5 more matches
Public class fields - JavaScript
mpat information below. both static and instance public fields are writable, enumerable, and configurable properties. as such, unlike their private counterparts, they participate in prototype inheritance. syntax class classwithinstancefield { instancefield = 'instance field' } class classwithstaticfield { static staticfield = 'static field' } class classwithpublicinstancemethod { publi
cmethod() { return 'hello world' } } examples public static fields public static fields are useful when you want a field to exist only once per class, not on every class instance you create. this is useful for caches, fixed-configuration, or any other data you don't need to be replicated across instances. public static fields are declared using the static keyword. they are added to the cl...
...nsole.log(subclasswithstaticfield.basestaticfield) // expected output: "base field" when initializing fields, this refers to the class constructor. you can also reference it by name, and use super to get the superclass constructor (if one exists). ...
...an also reference it by name, and use super to get the superclass constructor (if one exists). class classwithstaticfield { static basestaticfield = 'base static field' static anotherbasestaticfield = this.basestaticfield static basestati
cmethod() { return 'base static method output' } } class subclasswithstaticfield extends classwithstaticfield { static substaticfield = super.basestati
cmethod() } console.log(classwithstaticfield.anotherbasestaticfield) // expected output: "base static field" console.log(subclasswithstaticfield.substaticfield) // expected output: "base static method output" public instance fields public instance fields exist on every created instance of a class. by declaring a public field, you can ensure the field is always present, and the class definition ...
...And 5 more matches
parseInt() - JavaScript
nd trailing spaces are allowed. because some numbers use the e character in their string representation (e.g. 6.022e23 for 6.022 × 1023), using parseint to truncate numbers will produce unexpected results when used on very large or very small numbers. parseint should not be used as a substitute for math.floor(). parseint understands exactly two signs: + for positive, and - for negative (since e
cmascript 1). it is done as an initial step in the parsing after whitespace is removed. if no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. if radix is undefined, 0, or unspecified, javascript assumes the following: if the input string begins with "0x" or "0x" (a zero, followed by lowercase or upp...
...ined, 0, or unspecified, javascript assumes the following: if the input string begins with "0x" or "0x" (a zero, followed by lowercase or uppercase x), radix is assumed to be 16 and the rest of the string is parsed as a hexidecimal number. if the input string begins with "0" (a zero), radix is assumed to be 8 (octal) or 10 (decimal). exactly which radix is chosen is implementation-dependent. e
cmascript 5 clarifies that 10 (decimal) should be used, but not all browsers support this yet. for this reason, always specify a radix when using parseint. if the input string begins with any other value, the radix is 10 (decimal). if the first character cannot be converted to a number, parseint returns nan. for arithmetic purposes, the nan value is not a number in any radix. you can call the is...
...d on to arithmetic operations, the operation result will also be nan. to convert a number to its string literal in a particular radix, use thatnumber.tostring(radix). bigint warning: parseint converts a bigint to a number and loses precision in the process. this is because trailing non-numeric values, including "n", are discarded. ...
...And 5 more matches
Object initializer - JavaScript
a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax let o = {} let o = {a: 'foo', b: 42, c: {}} let a = 'foo', b = 42, c = {} let o = {a: a, b: b, c: c} let o = { property: function (parameters) {}, get property() {}, set property(value) {} }; new notations in e
cmascript 2015 please see the compatibility table for support for these notations. in non-supporting environments, these notations will lead to syntax errors. // shorthand property names (es2015) let a = 'foo', b = 42, c = {}; let o = {a, b, c} // shorthand method names (es2015) let o = { property(parameters) {} } // computed property names (es2015) let prop = 'foo' let o = { [prop]: 'hey', ...
...ccessors for detailed information.) object.foo // "bar" object['age'] // 42 object.foo = 'baz' property definitions we have already learned how to notate properties using the initializer syntax. oftentimes, there are variables in your code that you would like to put into an object. you will see code like this: let a = 'foo', b = 42, c = {}; let o = { a: a, b: b, c: c } with e
cmascript 2015, there is a shorter notation available to achieve the same: let a = 'foo', b = 42, c = {}; // shorthand property names (es2015) let o = {a, b, c} // in other words, console.log((o.a === {a}.a)) // true duplicate property names when using the same name for your properties, the second property will overwrite the first. let a = {x: 1, x: 2} console.log(a) // {x: 2} in ec...
...other words, console.log((o.a === {a}.a)) // true duplicate property names when using the same name for your properties, the second property will overwrite the first. let a = {x: 1, x: 2} console.log(a) // {x: 2} in e
cmascript 5 strict mode code, duplicate property names were considered a syntaxerror. with the introduction of computed property names making duplication possible at runtime, e
cmascript 2015 has removed this restriction. function havees2015duplicatepropertysemantics() { 'use strict'; try { ({prop: 1, prop: 2}); // no error thrown, duplicate property names allowed in strict mode return true; } catch(e) { // error thrown, duplicates prohibited in strict mode return false; } } method definitions a property of an object can also refer to a func...
...And 5 more matches
StringView - Archive of obsolete content
valid codepoints encoded by 1-6 bytes, * while the unicode view of utf-8 in 2003 has limited them to 1-4 bytes in order to * match utf-16's codepoints. in front of a 5/6-byte sequence stringview tries to * encode it in any case. ...
...so...: */ (nchar / 1073741824); atarget[nidx++] = 0x80 /* 128 */ + ((nchar >>> 24) & 0x3f /* 63 */); atarget[nidx++] = 0x80 /* 128 */ + ((nchar >>> 18) & 0x3f /* 63 */); atarget[nidx++] = 0x80 /* 128 */ + ((nchar >>> 12) & 0x3f /* 63 */); atarget[nidx++] = 0x80 /* 128 */ + ((nchar >>> 6) & 0x3f /* 63 */); atarget[nidx++] = 0x80 /* 128 */ + (nchar & 0x3f /* 63 */); } ...
...aaaaaasaaaasaaaaaaaaaaaaaaaaaaaaaaaaabaaaaasaaaaaaaaaaaaaaaaaaaaaaaaaciaaaagaaaaaaaaaaaaaaaaaaaaaaaaaabsawjjlnnvljyachv0cwbfx2xpymnfc3rhcnrfbwfpbgbfx2dtb25fc3rhcnrfxwbhtelcq18yljiunqaaaaacaaiaaaaaaaeaaqabaaaaeaaaaaaaaab1gmkjaaacadeaaaaaaaaayahgaaaaaaagaaaaawaaaaaaaaaaaaaa6ahgaaaaaaahaaaaaqaaaaaaaaaaaaaa8ahgaaaaaaahaaaaagaaaaaaaaaaaaaa+ahgaaaaaaahaaaaawaaaaaaaaaaaaaasipsceilbrufiabihcb0behdaaaasipe
cmmaaaaaaaaaaaaaaaaaap81agugap8lbaugaa8fqad/jqifiaboaaaaaong/////yx6bcaaaaeaaadp0p////8l8gqgaggcaaaa6cd///8x7umj0v5iiejig+twufrjx8cqbuaasmfbiavaaejhxwafqadot/////rmka8fqac4fwlgafvilrajyabig/gosinldwjdw7gaaaaasixadprdvxajyad/4a8fgaaaaac4ealgafvilrajyabiwfgdsinlsincsmhqp0gb0ejr+hucxco6aaaaaeif0nt0xuijxr8qcwaa/+iph4aaaaaagd1zbcaaahurvuij5eh+////xcyfrgqgaahzww8fqabigz0yaiaaahqeuaaaaabihcb0ffw/8azgaeij5f...
...And 4 more matches
controllers - Archive of obsolete content
mand dispatcher will locate controllers to handle a command by using the focused element's list. ...
...r will locate controllers to handle a command by using the focused element's list. ...
...ocate controllers to handle a command by using the focused element's list. ...
...And 4 more matches
New in JavaScript - Archive of obsolete content
this chapter contains information about javascript's version history and implementation status for mozilla/spidermonkey-based javascript applications, such as firefox. e
cmascript versions language resources learn more about the e
cmascript standards on which the javascript language is based on. e
cmascript 5 support implementation status for the current standard e
cma-262 edition 5.1 in mozilla-based engines and products. e
cmascript 2015 support implementation status for the draft e
cma-262 edition 6 (es2015) in mozilla-based engines and products. e
cmascript next support implementation status for upcoming e
cma-262 features as per the yearly (es2016/es2017/es2018/...) release schedule in mozilla-based engines and products. javascript versions deprecated ( ). the explicit versioning...
... javascript was released as version 1.0 in march 1996 in netscape navigator 2.0 and internet explorer 2.0. javascript 1.1 version shipped in netscape navigator 3.0. released on august 19, 1996. ...
...release schedule in mozilla-based engines and products. javascript versions deprecated ( ). the explicit versioning and opt-in of language features was mozilla-specific and are in process of being removed. firefox 4 was the last version which referred to a javascript version (1.8.5). with new e
cma standards, javascript language features are now often mentioned with their initial definition in e
cma-262 editions such as e
cmascript 2015. javascript was released as version 1.0 in march 1996 in netscape navigator 2.0 and internet explorer 2.0. javascript 1.1 version shipped in netscape navigator 3.0. released on august 19, 1996. javascript 1.2 version shipped in netscape navigator 4.0-4.05. released on june 11, 1997. javascript 1.3 version shipped in netscape navigator 4.06-4.7x. rele...
...And 4 more matches
NSS tools : modutil
name modutil - manage pkcs #11 module information within the security module database. synopsis modutil [options] [[arguments]] status this documentation is still work in progress. please contribute to the initial review in mozilla nss bug 836477[1] description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within se
cmod.db files and within hardware tokens. modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with s...
...flags, as well as any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation. this is covered in the jar installation file section in the man page, which details the special script needed to perform an installation through a server or with modutil. -list [modulename] display basic information about the contents of the se
cmod.db file. specifying a modulename displays detailed information about a particular module and its slots and tokens. -rawadd add the module spec string to the se
cmod.db database. -rawlist display the module specs for a specified module or for all loadable modules. -undefault modulename specify the security mechanisms for which the named module will not be a default provider. the securit...
...hers in a module that is being added to the database. the cipher-enable-list is a colon-delimited list of cipher names. enclose this list in quotation marks if it contains spaces. -dbdir [sql:]directory specify the database directory in which to access or create security module database files. modutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and se
cmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. --dbprefix prefix specify the prefix used on the database files, such as my_ for my_cert8.db. this option is provided as a special case. changing the names of the certificate and key databases is not recommended. -install...
...And 4 more matches
NSS tools : modutil
name modutil — manage pkcs #11 module information within the security module database. synopsis modutil [options] arguments description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within se
cmod.db files and within hardware tokens. modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with security module database management are part of a process that typically also involves manag...
...rget machine, including the pkcs #11 module library file and other files such as documentation. this is covered in the jar installation file section in the man page, which details the special script needed to perform an installation through a server or with modutil. -list [modulename] display basic information about the contents of the se
cmod.db file. specifying a modulename displays detailed information about a particular module and its slots and tokens. -rawadd add the module spec string to the se
cmod.db database. -rawlist display the module specs for a specified module or for all loadable modules. -undefault modulename specify the security mechanisms...
...-enable-list is a colon-delimited list of cipher names. enclose this list in quotation marks if it contains spaces. -dbdir [sql:]directory specify the database directory in which to access or create security module database files. modutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and se
cmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. --dbprefix prefix specify the prefix used on the database files, such as my_ for my_cert8.db. this option is provided as a special case. changing the names of...
...And 4 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
an ill-fated marketing decision that attempted to capitalize on the popularity of sun microsystem's java language — despite the two having very little in common. this has been a source of confusion ever since. several months later, microsoft released jscript with internet explorer 3. it was a mostly-compatible javascript work-alike. several months after that, netscape submitted javascript to e
cma international, a european standards organization, which resulted in the first edition of the e
cmascript standard that year. the standard received a significant update as e
cmascript edition 3 in 1999, and it has stayed pretty much stable ever since. the fourth edition was abandoned, due to political differences concerning language complexity. many parts of the fourth edition formed the basis for ...
... international, a european standards organization, which resulted in the first edition of the e
cmascript standard that year. the standard received a significant update as e
cmascript edition 3 in 1999, and it has stayed pretty much stable ever since. the fourth edition was abandoned, due to political differences concerning language complexity. many parts of the fourth edition formed the basis for e
cmascript edition 5, published in december of 2009, and for the 6th major edition of the standard, published in june of 2015. because it is more familiar, we will refer to e
cmascript as "javascript" from this point on. unlike most programming languages, the javascript language has no concept of input or output. it is designed to run as a scripting language in a host environment, and it is up to ...
...are a variable without assigning any value to it, its type is undefined. an important difference between javascript and other languages like java is that in javascript, blocks do not have scope; only functions have a scope. so if a variable is defined using var in a compound statement (for example inside an if control structure), it will be visible to the entire function. however, starting with e
cmascript 2015, let and const declarations allow you to create block-scoped variables. operators javascript's numeric operators are +, -, *, / and % which is the remainder operator (which is the same as modulo.) values are assigned using =, and there are also compound assignment statements such as += and -=. these extend out to x = x operator y. x += 5; x = x + 5; you can use ++ and -- to incre...
...And 4 more matches
Grammar and types - JavaScript
as a variable name. let früh = "foobar" but, the variable früh is not the same as früh because javascript is case sensitive. in javascript, instructions are called statements and are separated by semicolons (;). a semicolon is not necessary after a statement if it is written on its own line. but if more than one statement on a line is desired, then they must be separated by semicolons. e
cmascript also has rules for automatic insertion of semicolons (asi) to end statements. (for more information, see the detailed reference about javascript's lexical grammar.) it is considered best practice, however, to always write a semicolon after a statement, even when it is not strictly needed. this practice reduces the chances of bugs getting into the code. the source text of javascript scri...
...s. for example: var n = null; console.log(n * 32); // will log 0 to the console variable scope when you declare a variable outside of any function, it is called a global variable, because it is available to any other code in the current document. when you declare a variable within a function, it is called a local variable, because it is available only within that function. javascript before e
cmascript 2015 does not have block statement scope. rather, a variable declared within a block is local to the function (or global scope) that the block resides within. for example, the following code will log 5, because the scope of x is the global context (or the function context if the code is part of a function). the scope of x is not limited to the immediate if statement block. if (true) { ...
...nction (or global scope) that the block resides within. for example, the following code will log 5, because the scope of x is the global context (or the function context if the code is part of a function). the scope of x is not limited to the immediate if statement block. if (true) { var x = 5; } console.log(x); // x is 5 this behavior changes when using the let declaration (introduced in e
cmascript 2015). if (true) { let y = 5; } console.log(y); // referenceerror: y is not defined variable hoisting another unusual thing about variables in javascript is that you can refer to a variable declared later, without getting an exception. this concept is known as hoisting. variables in javascript are, in a sense, "hoisted" (or "lifted") to the top of the function or statement. however...
...And 4 more matches
Function.prototype.bind() - JavaScript
ing scope is treated as the thisarg for the new function. arg1, arg2, ...argn optional arguments to prepend to arguments provided to the bound function when invoking func. return value a copy of the given function with the specified this value, and initial arguments (if provided). description the bind() function creates a new bound function, which is an exotic function object (a term from e
cmascript 2015) that wraps the original function object. calling the bound function generally results in the execution of its wrapped function. a bound function has the following internal properties: [[boundtargetfunction]] the wrapped function object [[boundthis]] the value that is always passed as this value when calling the wrapped function. [[boundarguments]] a list of values whose elem...
...t is generally best to go with the first option. ...
...ur scripts, allowing use of much of the functionality of bind() in implementations that do not natively support it. ...
...And 4 more matches
Template literals (Template strings) - JavaScript
ine 1 \n string text line 2" , // including the two characters '\' and 'n' in addition, the string.raw() method exists to create raw strings—just like the default template function and string concatenation would create. ...
...les of the following escape sequences: unicode escapes started by "\u", for example \u00a9 unicode code point escapes indicated by "\u{}", for example \u{2f804} hexadecimal escapes started by "\x", for example \xa9 octal literal escapes started by "\0o" and followed by one or more digits, for example \0o251 this means that a tagged template like the following is problematic, because, per e
cmascript grammar, a parser looks for valid unicode escape sequences, but finds malformed syntax: latex`\unicode` // throws in older e
cmascript versions (es2016 and earlier) // syntaxerror: malformed unicode character escape sequence es2018 revision of illegal escape sequences tagged templates should allow the embedding of languages (for example dsls, or latex), where other escapes sequences are ...
...ar, a parser looks for valid unicode escape sequences, but finds malformed syntax: latex`\unicode` // throws in older e
cmascript versions (es2016 and earlier) // syntaxerror: malformed unicode character escape sequence es2018 revision of illegal escape sequences tagged templates should allow the embedding of languages (for example dsls, or latex), where other escapes sequences are common. the e
cmascript proposal template literal revision (stage 4, to be integrated in the e
cmascript 2018 standard) removes the syntax restriction of e
cmascript escape sequences from tagged templates. however, illegal escape sequences must still be represented in the “cooked” representation. they will show up as undefined element in the “cooked” array: function latex(str) { return { "cooked": str[0...
...And 4 more matches
Handling common JavaScript problems - Learn web development
such incompatibility problems persisted well into the early 2000s, as old browsers were still being used and still needed supporting. this is one of the main reasons why libraries like jquery came into existence — to abstract away differences in browser implementations (e...
... support older browsers has lessened (although bear in mind that they have not gone away altogether). these days, most cross-browser javascript problems are seen: when poor-quality browser-sniffing code, feature-detection code, and vendor prefix usage block browsers from running code they could otherwise use just fine. when developers make use of new/nascent javascript features (for example e
cmascript 6 / e
cmascript next features, modern web apis...) in their code, and find that such features don't work in older browsers. we'll explore all these problems and more below. fixing general javascript problems as we said in the previous article on html/css, you should make sure your code is working generally, before going on to concentrate on the cross-browser issues. if you are not alrea...
...st common mistakes javascript developers make has some nice discussions of these common mistakes and more. linters as with html and css, you can ensure better quality, less error-prone javascript code using a linter, which points out errors and can also flag up warnings about bad practices, etc., and be customized to be stricter or more relaxed in their error/warning reporting. the javascript/e
cmascript linters we'd recommend are jshint and eslint; these can be used in a variety of ways, some of which we'll detail below. online the jshint homepage provides an online linter, which allows you to enter your javascript code on the left and provides an output on the right, including metrics, warnings, and errors. code editor plugins it is not very convenient to have to copy and paste you...
...And 3 more matches
NSS 3.52 release notes
3.52 requires nspr 4.25 or newer. nss 3.52 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_52_rtm/src/ other releases are available in nss releases. notable changes in nss 3.52 bug 1603628 - update nss to support pkcs #11 v3.0. note: this change modifies the ck_g
cm_params struct to include the ulivbits field which, prior to pkcs #11 v3.0, was ambiguously defined and not included in the nss definition. if an application is recompiled with nss 3.52+, this field must be initialized to a value corresponding to ulivlen. alternatively, defining nss_pkcs11_2_0_compat will yield the old definition. see the bug for more information. bug 1623374 - support new p...
...ield which, prior to pkcs #11 v3.0, was ambiguously defined and not included in the nss definition. if an application is recompiled with nss 3.52+, this field must be initialized to a value corresponding to ulivlen. alternatively, defining nss_pkcs11_2_0_compat will yield the old definition. see the bug for more information. bug 1623374 - support new pkcs #11 v3.0 message interface for aes-g
cm and chachapoly. bug 1612493 - integrate avx2 chacha20, poly1305, and chacha20poly1305 from hacl*. bugs fixed in nss 3.52 bug 1633498 - fix unused variable 'getauxval' error on ios compilation. bug 1630721 - add softoken functions for fips. bug 1630458 - fix problem of gyp msvc builds not producing debug symbol files. bug 1629663 - add ikev1 quick mode kdf. bug 1629661 - mpconfig calls i...
...quick mode kdf. bug 1629661 - mpconfig calls in ssl initialize policy before nss is initialized. bug 1629655 - support temporary session objects in ckfw. bug 1629105 - add pkcs11 v3.0 functions to module debug logger. bug 1626751 - fix error in generation of fuzz32 docker image after updates. bug 1625133 - fix implicit declaration of function 'getopt' error. bug 1624864 - allow building of g
cm-arm32-neon on non-armv7 architectures. bug 1624402 - fix compilation error in firefox android. bug 1624130 - require ck_function_list structs to be packed. bug 1624377 - fix clang warning for unknown argument '-msse4'. bug 1623374 - support new pkcs #11 v3.0 message interface for aes-g
cm and chachapoly. bug 1623184 - fix freebl_cpuid for querying extended features. bug 1622555 - fix argumen...
...And 3 more matches
NSS API Guidelines
.h, certdb.h, cert.h, certt.h certhi provides high-level certificate-related functions, that do not access the certificate database, nor individual certificate data directly. currently, ocsp checking settings are exported through certhi. ...
...ificate-related functions, that do not access the certificate database, nor individual certificate data directly. currently, ocsp checking settings are exported through certhi. high cert lib/certhigh ocsp.h, ocspt.h crmf provides functions, and data types, to handle certificate management message format (
cmmf) and certificate request message format (crmf, see rfc 2511) data.
cmmf no longer exists as a proposed standard;
cmmf functions have been incorporated into the proposal for certificate management protocols (
cmp). same level as ssl lib/crmf
cmmf.h, crmf.h, crmft.h,
cmmft.h, crmffut.h cryptohi provides high-level cryptographic support operations: such as signing, verifying signatures, key generation, key manipulation, hashing; and data types. th...
... nss.h pk11wrap provides access to pkcs #11 modules, through a unified interface. the pkcs11wrap library provides functions for selecting/finding pkcs #11 modules and slots. it also provides functions that invoke operations in selected modules and slots, such as key selection and generation, signing, encryption and decryption, etc. crypto wrapper lib/pk11wrap pk11func.h, se
cmod.h, se
cmodt.h pkcs12 provides functions and types for encoding and decoding pkcs #12 data. pkcs #12 can be used to to encode keys, and certificates, for export or import into other applications. pkcs #12 lib/pkcs12 pkcs12t.h, pkcs12.h, p12plcy.h, p12.h, p12t.h pkcs7 provides functions and types for encoding and decoding encrypted data in pkcs #7 format. for examp...
...And 3 more matches
sample2
btain one at http://mozilla.org/mpl/2.0/. ...
... different from sample 5 ? * * 1. as in sample 5, output is a pkcs#10 csr * 2. input and store a cert in cert db and also used to input, store and trust ca cert. * 3. like sample 5, but puts cert in header * 4. ...
...== pl_opt_ok) { switch (optstate->option) { case 'a': ascii = pr_true; break; case 'g': /* generate a csr */ case 'a': /* add cert to database */ case 'h': /* save cert to the header file */ case 'e': /* encrypt with public key from cert in header file */ case 's': /* sign with private key */ case 'd': /* decrypt with the matching private key */ case 'v': /* verify with the matching public key */
cmd = option2command(optstate->option); break; case 'd': dbdir = strdup(optstate->value); break; case 'f': pwdata.source = pw_fromfile; pwdata.data = strdup(optstate->value); break; case 'p': pwdata.source = pw_plaintext; pwdata.data = strdup(optstate->value); break; case 'i': infilename = strdup(optstate->value); break; case 'b': headerfilename = strdup(optstate->value); break; case 'e': encryptedf...
...And 3 more matches
PKCS #11 Module Specs
if the value is quoted, then the value is terminated with and ending quote of the form ', ", ), ], }, or > matching the respective starting quote. ending quotes can be escaped. embedded '\' charaters are considered escape characters for the next character in the stream. note that case must be preserved in the values. these modules specs can be passed by the application directly to nss via the se
cmod_loadusermodule() call. to initialize a pkcs #11 module 'on-the-fly'. recognized names all applications/libraries must be able recognize the following name values: library this specifies the path to the pkcs #11 library. name this specifies the name of the pkcs #11 library. parameter this specifies a pkcs #11 library parameter with the application must pass to the pkcs #11 library a...
...d; } ck_c_initialize_args; applications/libraries must set libraryparameters to null if no parameter value is specified. pkcs #11 libraries which accept parameters must check if the 'new' preserved field is null if and only if libraryparameters field is not null. nss specific parameters in module specs here are the nss application specific parameters in use. this data is currently stored in se
cmod.db or pkcs11.txt. this isn't part of the generic spec (that is other applications need not parse it, nor pkcs #11 modules need supply them or use them). nss="nss_params" nss_params are themselves name/value pairs, parsed with the same rules described above. valid names inside nss_params are: flags - comma separated list of flag values, parsed case-insensitive. valid flag values are: ...
...whenever the a private key on this token needs to be access (this is on the entire token, not on a key-by-key basis. timeout- whenever the last explicit login was longer than 'timeout' minutes ago. only - authenticate to the token only when necessary (default). ...
...And 3 more matches
NSS tools : certutil
of the ca certificate, or use the ca's email address. bracket the issuer string with quotation marks if it contains spaces. -d [prefix]directory specify the database directory containing the certificate and key database files. certutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and se
cmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). nss recognizes the following prefixes: · sql: requests the newer database · dbm: requests the legacy database if no prefix is specified the default type is retrieved from nss_default_db_type. if nss_default_db_type is not set then dbm: is the ...
... examples are the most common ones or are used to illustrate a specific scenario. use the -h option to show the complete list of arguments for each command option. creating new security databases certificates, keys, and security modules related to managing certificates are stored in three related databases: * cert8.db or cert9.db * key3.db or key4.db * se
cmod.db or pkcs11.txt these databases must be created before certificates or keys can be generated. certutil -n -d [sql:]directory creating a certificate request a certificate request contains most or all of the information that is used to generate the final certificate. this request is submitted separately to a certificate authority and is then approved by some me...
...=california,c=us" -d sql:/home/my/sharednssdb -p 650-5 55-0123 -a -o cert.cer generating key. this may take a few moments... ...
...And 3 more matches
certutil
lias of the ca certificate, or use the ca's email address. bracket the issuer string with quotation marks if it contains spaces. -d [sql:]directory specify the database directory containing the certificate and key database files. certutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and se
cmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. -e check a certificate's signature during the process of validating a certificate. -f password-file specify a file that will automatically supply the pas...
...in these examples are the most common ones or are used to illustrate a specific scenario. use the -h option to show the complete list of arguments for each command option. creating new security databases certificates, keys, and security modules related to managing certificates are stored in three related databases: o cert8.db or cert9.db o key3.db or key4.db o se
cmod.db or pkcs11.txt these databases must be created before certificates or keys can be generated. certutil -n -d [sql:]directory creating a certificate request a certificate request contains most or all of the information that is used to generate the final certificate. this request is submitted separately to a certificate authority and is then approved by some mechanism (...
...iew,st=california,c=us" -d sql:/home/my/sharednssdb -p 650-555-0123 -a -o cert.cer generating key. this may take a few moments... ...
...And 3 more matches
JSAPI reference
ince javascript 1.9.1 js_max_operation_limit obsolete since javascript 1.9.1 js_operation_weight_base obsolete since javascript 1.9.1 js_setthreadstacklimit obsolete since jsapi 13 js_setscriptstackquota obsolete since javascript 1.8.6 js_setoptions obsolete since jsapi 27 js_getoptions obsolete since jsapi 27 js_toggleoptions obsolete since jsapi 27 enum jsversion jsversion_e
cma_3 jsversion_1_6 jsversion_1_7 jsversion_1_8 jsversion_e
cma_5 jsversion_default jsversion_unknown jsversion_latest js_getimplementationversion 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_getglobalforscopec...
...these macros must not be applied to values that are not known to be the right type. like c casts, they may cause cras...
...these macros must not be applied to values that are not known to be the right type. like c casts, they may cause crashes if applied to incorrect values. they neve...
...And 3 more matches
nsIAppShellService
upstate(in long awindowwidth, in long awindowheight); obsolete since gecko 1.8 nsixulwindow createtoplevelwindow(in nsixulwindow aparent, in nsiuri aurl, in pruint32 achromemask, in long ainitialwidth, in long ainitialheight, in nsiappshell aappshell); nsiwebnav createwindowlessbrowser (in bool aischrome) void destroyhiddenwindow(); void doprofilestartup(in nsi
cmdlineservice a
cmdlineservice, in boolean caninteract); obsolete since gecko 1.8 void ensure1window(in nsi
cmdlineservice a
cmdlineservice); obsolete since gecko 1.8 void enterlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void exitlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void gethiddenwindowandjscontext(out nsidomwindow ahiddendomwindow...
...service); obsolete since gecko 1.8 void enterlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void exitlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void gethiddenwindowandjscontext(out nsidomwindow ahiddendomwindow, out jscontext ajscontext); native code only! ...
...te since gecko 1.8 void enterlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void exitlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void gethiddenwindowandjscontext(out nsidomwindow ahiddendomwindow, out jscontext ajscontext); native code only! ...
...And 3 more matches
Debugger keyboard shortcuts - Firefox Developer Tools
command windows macos linux close current file ctrl + w
cmd + w ctrl + w search for a string in the current file ctrl + f
cmd + f ctrl + f search for a string in all files ctrl + shift + f
cmd + shift + f ctrl + shift + f find next in the current file ctrl + g
cmd + g ctrl + g search for scripts by name ctrl + p
cmd + p ctrl + p resume execution when at a breakpoint f8 f8 1 f8 step over f10 f10 1 f10 step into f11 f11 1 f11 step out shift + f11 shift + f11 1 shift + f11 toggle breakpoint on the currently selected line ctrl + b
cmd + b ctrl + b toggle conditional breakpoint on the current...
... resume execution when at a breakpoint f8 f8 1 f8 step over f10 f10 1 f10 step into f11 f11 1 f11 step out shift + f11 shift + f11 1 shift + f11 toggle breakpoint on the currently selected line ctrl + b
cmd + b ctrl + b toggle conditional breakpoint on the currently selected line ctrl + shift + b
cmd + shift + b ctrl + shift + b 1. by default, on some macs, the function key is remapped to use a special feature: for example, to change the screen brightness or the volume. see this guide to using these keys as standard function keys. to use a remapped key as a standard function key, hold the function key down as well (so to open the profiler, use shift + function + f5). note: before...
...the function key is remapped to use a special feature: for example, to change the screen brightness or the volume. see this guide to using these keys as standard function keys. to use a remapped key as a standard function key, hold the function key down as well (so to open the profiler, use shift + function + f5). ...
...And 3 more matches
Toolbox - Firefox Developer Tools
see also keyboard shortcuts. by default, the window appears docked to the bottom side of the firefox window, but you can detach it if you like. this is what it looks like when it's docked: the window itself is split into two parts: a toolbar along the top, and a main pane underneath: note: since firefox 62, you can drag and drop tabs in the main toolbar of the toolbox t...
... see the separate page on the developer tools settings. main pane the content of the main pane in the window is entirely controlled by, and specific to, the hosted tool currently selected. keyboard shortcuts these shortcuts work whenever the toolbox is open, no matter which tool is active. ...
...t of the main pane in the window is entirely controlled by, and specific to, the hosted tool currently selected. keyboard shortcuts these shortcuts work whenever the toolbox is open, no matter which tool is active. command windows macos linux cycle through tools left to right ctrl + ]
cmd + ] ctrl + ] cycle through tools right to left ctrl + [
cmd + [ ctrl + [ toggle between active tool and settings. f1 f1 f1 toggle toolbox between the last 2 docking modes ctrl + shift + d
cmd + shift + d ctrl + shift + d toggle split console (except if console is the currently selected tool) esc esc esc these shortcuts work in all tools that are hosted in the toolbox. comm...
...And 3 more matches
Element: DOMActivate event - Web APIs
the domactivate event is fired at an element when it becomes active, such as when it is clicked on using the mouse or a keypress is used to navigate to it. ...
...activate event is fired at an element when it becomes active, such as when it is clicked on using the mouse or a keypress is used to navigate to it. ...
...tive, such as when it is clicked on using the mouse or a keypress is used to navigate to it. ...
...And 3 more matches
itemtype - HTML: Hypertext Markup Language
ification. it is left to such specifications to define whether multiple items of the same global identifier (whether on the same page or different pages) are allowed to exist, and what processing rules for that vocabulary are, with respect to handling the case of multiple items with the same id. ...
...dling the case of multiple items with the same id. ...
... <br> </span> ...
...And 3 more matches
static - JavaScript
// 3 console.log(triple.triple(6)); // 18 var tp = new triple(); console.log(biggertriple.triple(3)); // 81 (not affected by parent's instantiation) console.log(tp.triple()); // 'tp.triple is not a function'. calling static methods from another static method in order to call a static method within another static method of the same class, you can use the this keyword. ...
...e.triple(6)); // 18 var tp = new triple(); console.log(biggertriple.triple(3)); // 81 (not affected by parent's instantiation) console.log(tp.triple()); // 'tp.triple is not a function'. calling static methods from another static method in order to call a static method within another static method of the same class, you can use the this keyword. ...
...e(3)); // 81 (not affected by parent's instantiation) console.log(tp.triple()); // 'tp.triple is not a function'. calling static methods from another static method in order to call a static method within another static method of the same class, you can use the this keyword. ...
...And 3 more matches
Date.parse() - JavaScript
of milliseconds since january 1, 1970, 00:00:00 utc. this function is useful for setting date values based on string values, for example in conjunction with the settime() method and the date object. date time string format the standard string representation of a date time string is a simplification of the iso 8601 calendar date extended format. (see the section date time string format in the e
cmascript specification for more details.) for example, "2011-10-10" (date-only form), "2011-10-10t14:48:00" (date-time form), or "2011-10-10t14:48:00.000+09:00" (date-time form with milliseconds and time zone) can be passed and will be parsed. when the time zone offset is absent, date-only forms are interpreted as a utc time and date-time forms are interpreted as local time. while time zone speci...
...number of milliseconds between january 1, 1970 00:00:00 utc and the point in time represented by the argument or nan. because parse() is a static method of date, it is called as date.parse() rather than as a method of a date instance. fall-back to implementation-specific date formats this section contains implementation-specific behavior that can be inconsistent across implementations. the e
cmascript specification states: if the string does not conform to the standard format the function may fall back to any implementation–specific heuristics or implementation–specific parsing algorithm. unrecognizable strings or dates containing illegal element values in iso formatted strings shall cause date.parse() to return nan. however, invalid values in date strings not recognized as simplif...
...if the string does not conform to the standard format the function may fall back to any implementation–specific heuristics or implementation–specific parsing algorithm. unrecognizable strings or dates containing illegal element values in iso formatted strings shall cause date.parse() to return nan. however, invalid values in date strings not recognized as simplified iso format as defined by e
cma-262 may or may not result in nan, depending on the browser and values provided, e.g.: // non-iso string with invalid date values new date('23/25/2014'); will be treated as a local date of 25 november, 2015 in firefox 30 and an invalid date in safari 7. however, if the string is recognized as an iso format string and it contains invalid values, it will return nan in all browsers compliant wit...
...And 3 more matches
Number.prototype.toLocaleString() - JavaScript
angeerror exception can be used: function tolocalestringsupportslocales() { var number = 0; try { number.tolocalestring('i'); } catch (e) { return e.name === 'rangeerror'; } return false; } prior to es5.1, implementations were not required to throw a range error exception if tolocalestring is called with arguments. ...
...cales() { var number = 0; try { number.tolocalestring('i'); } catch (e) { return e.name === 'rangeerror'; } return false; } prior to es5.1, implementations were not required to throw a range error exception if tolocalestring is called with arguments. a check that works in all hosts, including those supporting e
cma-262 prior to ed 5.1, is to test for the features specified in e
cma-402 that are required to support regional options for number.prototype.tolocalestring directly: function tolocalestringsupportsoptions() { return !!(typeof intl == 'object' && intl && typeof intl.numberformat == 'function'); } this tests for a global intl object, checks that it's not null and that it has a numberformat property that is a function. using locales this example shows some of ...
... ...
...And 3 more matches
Spread syntax (...) - JavaScript
s) are expected. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax for function calls: myfunction(...iterableobj); for array literals or strings: [...iterableobj, '4', 'five', 6]; for object literals (new in e
cmascript 2018): let objclone = { ...obj }; rest syntax (parameters) rest syntax looks exactly like spread syntax. in a way, rest syntax is the opposite of spread syntax. spread syntax "expands" an array into its elements, while rest syntax collects multiple elements and "condenses" them into a single element. see rest parameters. examples spread in function calls replace apply() it is common...
...2 onto arr1 array.prototype.unshift.apply(arr1, arr2) // arr1 is now [3, 4, 5, 0, 1, 2] with spread syntax, this becomes: let arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr2, ...arr1]; // arr1 is now [3, 4, 5, 0, 1, 2] note: unlike unshift(), this creates a new arr1, and does not modify the original arr1 array in-place. spread in object literals the rest/spread properties for e
cmascript proposal (es2018) added spread properties to object literals. it copies own enumerable properties from a provided object onto a new object. shallow-cloning (excluding prototype) or merging of objects is now possible using a shorter syntax than object.assign(). const obj1 = { foo: 'bar', x: 42 }; const obj2 = { foo: 'baz', y: 13 }; const clonedobj = { ...obj1 }; // object { foo: "bar", x...
... ...
...And 3 more matches
Creating regular expressions for a microsummary generator - Archive of obsolete content
bay url we now have a regular expression that matches auction item urls, including those with multiple query parameters in any order. but ebay uses a different style of url in some cases (f.e. on its search results page). ...
...tegoryz2036qq
cmdzviewitem to accommodate these urls, we can create a second regular expression that matches them. as before, we should distinguish the components of the url which are unique to the item from those which are common to all auction item urls of this style. ...
...hem. as before, we should distinguish the components of the url which are unique to the item from those which are common to all auction item urls of this style. here are several other urls of this style: http://cgi.ebay.com/firefox-2002-dvd_w0qqitemz130017517168qqihz003qqcategoryz617qq
cmdzviewitem http://cgi.ebay.com/ahm-ho-scale-firefox-tank-car_w0qqitemz290019763032qqihz019qqcategoryz19130qq
cmdzviewitem http://cgi.ebay.com/inuyasha-anime-pin-of-kirara-kilala-firefox_w0qqitemz170019463424qqihz007qqcategoryz39557qq
cmdzviewitem based on these examples, it looks like the urls all start with "http://cgi.ebay.com/", they all contain the string "qqitemz" followed by the item number, and they all end with the string "qq
cmdzviewitem". so we might construct the following regular expression to...
...And 2 more matches
Keyboard Shortcuts - Archive of obsolete content
ange the disabled attribute using a script. our find files example let's add keyboard shortcuts to the find files dialog. we'll add four of them, one for each of the cut, copy, and paste commands and also one for the close command when the user presses esc. ...
...r find files example let's add keyboard shortcuts to the find files dialog. we'll add four of them, one for each of the cut, copy, and paste commands and also one for the close command when the user presses esc. ...
...to the find files dialog. we'll add four of them, one for each of the cut, copy, and paste commands and also one for the close command when the user presses esc. ...
...And 2 more matches
New in JavaScript 1.3 - Archive of obsolete content
the following is a changelog for javascript from netscape navigator 4.0 to 4.5. the old netscape documentation can be found on archive.org. netscape navigator 4.5 was released on october 19, 1998. the most significant change in javascript 1.3 was compliance with e
cma-262 and unicode by removing inconsistencies between javascript 1.2 and the new e
cma standard (which was published in june 1997). additional features of version 1.2, at the time not specified by e
cma-262 were kept in the javascript language (see below for a list of differences). javascript versions netscape communicator and navigator 4.06 and 4.5 executes javascript language versions up to 1.3. note that communicator and navigator 4.0-4.05 and earlier ignored scripts with the language attribute set to "javascript1.3" and high...
...cript1.3"> <!-- javascript for navigator 4.5. ...
...obals nan infinity undefined new methods isfinite() function.prototype.call() function.prototype.apply() date.utc() date.prototype.getfullyear() date.prototype.setfullyear() date.prototype.getmilliseconds() date.prototype.setmilliseconds() date.prototype.getutcfullyear() date.prototype.getut
cmonth() date.prototype.getutcdate() date.prototype.getutchours() date.prototype.getut
cminutes() date.prototype.getutcseconds() date.prototype.getut
cmilliseconds() date.prototype.toutcstring() date.prototype.setutcfullyear() date.prototype.setut
cmonth() date.prototype.setutcdate() date.prototype.setutchours() date.prototype.setut
cminutes() date.prototype.setutcseconds() date.prototype.setut
cmilliseconds() other new features strict equality operators unicode support a...
...And 2 more matches
Introducing a complete toolchain - Learn web development
e, creating a separate version and try out new functionality on, without those changes affecting your original code. finally, it can help you undo changes or revert your code back to a time "when it was working" if a mistake has been introduced somewhere and you are having trouble fixing it — something all developers need to do once in a while! git can be downloaded and installed via the git-s
cm website — download the relevant installer for your system, run it, and follow the on-screen prompts. this is all you need to do for now. you can interact with git in a number of different ways, from using the command line to issue commands, to using a git gui app to issue the same commands by pushing buttons, or even from directly inside your code editor, as seen in the visual studio code exa...
... first of all, create a file in the root of your will-it-miss directory called .prettierrc.json. to configure prettier, give .prettierrc.json the following contents: { "singlequote": true, "trailingcomma": "es5" } with these settings, when prettier formats javascript for you it will use single quotes for all your quoted values, and it won't use trailing commas (a newer feature of e
cmascript that will cause errors in older browsers). you can find more about configuring prettier in its documentation. next up, we’ll configure eslint — create another file in the root of your will-it-miss directory called .eslintrc.json, and give it the following contents: { "env": { "es6": true, "browser": true }, "extends": "eslint:recommended", "parseroptions": { ...
...ipt that will cause errors in older browsers). you can find more about configuring prettier in its documentation. next up, we’ll configure eslint — create another file in the root of your will-it-miss directory called .eslintrc.json, and give it the following contents: { "env": { "es6": true, "browser": true }, "extends": "eslint:recommended", "parseroptions": { "e
cmaversion": 6, "sourcetype": "module" }, "rules": { "no-console": 0 } } the above eslint configuration says that we want to use the "recommended" eslint settings, that we're going to allow usage of es6 features (such as map() or set()), that we can use module import statements, and that using console.log() is allowed. however, in the project's source files we are using react ...
...And 2 more matches
Eclipse CDT
ou can set the scheme to "emacs" or "microsoft visual studio" if that's your thing, or change individual key bindings. when changing individual key bindings, note that bindings are context sensitive and that any changes you make may be ignored if they conflict with existing bindings, or if they are overridden by a binding for a more specific context. for example, changing the find next command to
cmd-g/ctrl-g is not sufficient. for that to work you also either need to find the existing bindings for that key combination (using the bindings column to sort by key combination helps with this) and remove them, or else you need to make your binding very specific by setting the "when" field to "c/c++ editor" instead of the more general "editing text". opening files you can quickly open a file by ...
...is not sufficient. for that to work you also either need to find the existing bindings for that key combination (using the bindings column to sort by key combination helps with this) and remove them, or else you need to make your binding very specific by setting the "when" field to "c/c++ editor" instead of the more general "editing text". opening files you can quickly open a file by name using
cmd-shift-r/ctrl-shift-r. although eclipse doesn't do fuzzy matching when you type a file name, it does allow you to use wildcards. to quickly switch between a source file and its header file, use ctrl-tab. to quickly switch to a recently viewed document use
cmd-f6/ctrl-f6. if you want to change this awkward key binding, the command you need to rebind is "next editor". to show a filterable list o...
... file name, it does allow you to use wildcards. to quickly switch between a source file and its header file, use ctrl-tab. to quickly switch to a recently viewed document use
cmd-f6/ctrl-f6. if you want to change this awkward key binding, the command you need to rebind is "next editor". to show a filterable list of open documents (similar to the way emacs gives you a list of open buffers), use
cmd-e/ctrl-e. if you click the yellow, double arrow button at the top of the project explorer tab on the left, it will keep the selected file in the project explorer tab in sync with the file that you're currently editing. organizing views use ctrl-m to toggle maximization of the current editor view (the editor must be focused first). to tab to another view, use
cmd-f7/ctrl-f7. this is useful if...
...And 2 more matches
Cross Process Object Wrappers
ects available to chrome through a wrapper called a cross process object wrapper, also known as a cpow. however, although cpows are convenient, they have serious limitations and can cause responsiveness problems, so should only be used when necessary and only as a migration aid. ...
...ome through a wrapper called a cross process object wrapper, also known as a cpow. however, although cpows are convenient, they have serious limitations and can cause responsiveness problems, so should only be used when necessary and only as a migration aid. passing cpows from frame scripts frame scripts can send messages to chrome using one of two global functions: sendasyn
cmessage() or sendsyn
cmessage(). ...
...ages to chrome using one of two global functions: sendasyn
cmessage() or sendsyn
cmessage(). the optional third parameter to each of these functions is an object whose properties are objects to wrap. for example, this frame script sends a dom node to chrome when the user clicks it, as the clicked property of the third argument: // frame script addeventlistener("click", function (event) { sendasyn
cmessage("my-e10s-extension-message", {}, { clicked : event.target }); }, false); in the chrome script, the dom node is now accessible through a cross process object wrapper, as a property of the objects property of the message. the chrome script can get and set the wrapped object's properties and call its functions: // chrome script windowmm.addmessagelistener("my-e10s-extension-message", handlem...
...And 2 more matches
Message manager overview
re are three different subtypes of frame message manager: the global message manager, the window message manager, and the browser message manager. all three enable chrome code to: load a script into a frame in the content the content process using a loadframescript() function. these scripts are called "frame scripts". communicate with frame scripts using addmessagelistener() and broadcastasyn
cmessage() or sendasyn
cmessage() functions. note that in this context, "browser" refers to the xul <browser> object, which is a frame that hosts a single web document. it does not refer to the more general sense of a web browser. global message manager the global message manager operates on every <browser> (that is, every open content tab). loadframescript() loads the given script into ev...
...t in this context, "browser" refers to the xul <browser> object, which is a frame that hosts a single web document. it does not refer to the more general sense of a web browser. global message manager the global message manager operates on every <browser> (that is, every open content tab). loadframescript() loads the given script into every <browser> in every browser window. broadcastasyn
cmessage() sends the message to every <browser> in every browser window. it's a chromemessagebroadcaster object, which implements the following interfaces: nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster you can access the global message manager like this: // chrome script let globalmm = cc["@mozilla.org/globalmessagemanager;1"] .getservice(ci.nsimessagelistenermanag...
... it's a chromemessagebroadcaster object, which implements the following interfaces: nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster the window message manager can be accessed as a property of the browser window: // chrome script let windowmm = window.messagemanager; browser message manager the bro...
...And 2 more matches
AsyncTestUtils extended framework
his case the default is zero recipients. from: (automatically generated) a list whose first element is a (display) name and second element is an email address. for example, {count: 4, from: ["john doe", "john_doe@example.com"]} would result in four messages from john doe to random recipients. synthetic message sets the code that creates synthetic message sets returns instances of the syntheti
cmessageset class. this class not only holds references to the syntheti
cmessage instances, but it also tracks what folders they were injected into as well as what folders you move them to. this allows you to get at the nsimsgdbhdr instances directly. keep in mind that the class is not magic and will lose track of the message headers if you manipulate them without referencing the message set. access...
...s, but it also tracks what folders they were injected into as well as what folders you move them to. this allows you to get at the nsimsgdbhdr instances directly. keep in mind that the class is not magic and will lose track of the message headers if you manipulate them without referencing the message set. accessing synthetic messages and headers synmessages [attribute] the js list of syntheti
cmessages held in the set. while you should not modify this list, you can get its length and read from it. getmsghdr(aindex) [function] retrieve the nsimsgdbhdr at the given index. getmsguri(aindex) [function] retrieve the uri of the message header at the given index. msghdrlist [getter] return a js list with all the nsimsgdbhdrs for the messages that have been injected into folders. xpcomhdr...
...the framework: asynctestutils.js: core async testing logic. dependent on loghelper.js so it can log what test it is on, etc. loghelper.js: this allows rich logging via logsploder. if you aren't using logsploder, then this just makes your tests fail if errors get logged to the error console (like you see if you go to the "tools | error console" menu). ...
...And 2 more matches
NSS 3.15.2 release notes
s 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. users are encouraged to upgrade immediately. bug 894370 - (cve-2013-1739) avoid uninitialized data read in the event of a decryption failure. ...
...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. users are encouraged to upgrade immediately. bug 894370 - (cve-2013-1739) avoid uninitialized data read in the event of a decryption failure. ...
... are encouraged to upgrade immediately. bug 894370 - (cve-2013-1739) avoid uninitialized data read in the event of a decryption failure. new in nss 3.15.2 new functionality aes-g
cm ciphersuites: aes-g
cm cipher suite (rfc 5288 and rfc 5289) support has been added when tls 1.2 is negotiated. specifically, the following cipher suites are now supported: tls_ecdhe_ecdsa_with_aes_128_g
cm_sha256 tls_ecdhe_rsa_with_aes_128_g
cm_sha256 tls_dhe_rsa_with_aes_128_g
cm_sha256 tls_rsa_with_aes_128_g
cm_sha256 new functions pk11_cipherfinal has been introduced, which is a simple alias for pk11_digestfinal. new types no new types have been introduced. new pkcs #11 mechanisms no new pkcs#11 mechanisms have been introduced notable changes in nss 3.15.2 bug 880543 -...
...And 2 more matches
Enc Dec MAC Output Public Key as CSR
*/ temp = pr_write(outfile, decbuf, decbuflen); if (temp != decbuflen) { pr_fprintf(pr_stderr, "write error\n"); rv = secfailure; break; } blocknumber++; } if (rv != secsuccess) { goto cleanup; } rv = macfinal(ctxmac, newmac, &newmaclen, sizeof(newmac)); if (rv != secsuccess) { goto cleanup; } if (port_mem
cmp(macitem->data, newmac, newmaclen) == 0) { rv = secsuccess; } else { pr_fprintf(pr_stderr, "check mac : failure\n"); pr_fprintf(pr_stderr, "extracted : "); printasascii(pr_stderr, macitem->data, macitem->len); pr_fprintf(pr_stderr, "computed : "); printasascii(pr_stderr, newmac, newmaclen); rv = secfailure; } cleanup: if (ctxmac...
...same. ...
... char * progname = strrchr(argv[0], '/'); progname = progname ? ...
...And 2 more matches
NSS Tools modutil
using the security module database (modutil) newsgroup: mozilla.dev.tech.crypto the security module database tool is a command-line utility for managing pkcs #11 module information within se
cmod.db files or within hardware tokens. you can use the tool to add and delete pkcs #11 modules, change passwords, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create key3.db, cert8.db, and se
cmod.db security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases (key3.db files) and certificate databases (cert8.db files). the key, certificate, and pkcs #11 modul...
...ons of the options and arguments listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options specify an action. option arguments modify an action. the options and arguments for the modutil command are defined as follows: options -create create new se
cmod.db, key3.db, and cert8.db files. use the -dbdir directory argument to specify a directory. if any of these databases already exist in a specified directory, the security module database tool displays an error message. -list [modulename] display basic information about the contents of the se
cmod.db file. use modulename to display detailed information about a particular module and its slots and...
...cify a text file containing a token's new or replacement password so that a password can be entered automatically with the -changepw tokenname option. -slot slotname specify a particular slot to be enabled or disabled with the -enable modulename or -disable modulename options. -nocertdb do not open the certificate or key databases. this has several effects: with the -create command, only a se
cmod.db file will be created; cert8.db and key3.db will not be created. with the -jar command, signatures on the jar file will not be checked. with the -changepw command, the password on the netscape internal module cannot be set or changed, since this password is stored in key3.db. usage the security module database tool's capabilities are grouped as follows, using these combinations ...
...And 2 more matches
Creating JavaScript jstest reftests
the js/src/tests directories test files are run by the jstest harness in the shell and the reftest harness in the browser. this directory contains tests of spidermonkey conformance to e
cmascript as well as spidermonkey non-standard extenstions to e
cmascript. directory overview in the js/src/tests directory, there are a few important subdirectories. non262 tests the directory js/src/tests/non262/ should contain all tests of the following type: regressions of spidermonkey non-standard spidermonkey extensions to the javascript language test of "implementation-defined" details of the e
cmascript standard for example, the exact definition of pi or some details of array sorting. you should not add tests of the following type: tests of the jit test of jit cor...
...cript language test of "implementation-defined" details of the e
cmascript standard for example, the exact definition of pi or some details of array sorting. you should not add tests of the following type: tests of the jit test of jit correctness belong in the jit-test suite, read more here. performance tests or stress tests tests of spidermonkey's comformance to the e
cmascript standard a brief history: in 2017, spidermonkey started comsuming test262, a comprehensive tests suite for e
cmascript implementations. before using test262, spidermonkey had a fair number of internal tests of conformance to e
cmascript, and many of those tests remain in the js/src/non262 directory as regressions. test262 tests test262 is the implementation conformance test suite for the...
...mozilla manually imports these tests into the js/src/tests/test262 directory. ...
...And 2 more matches
Finishing the Component
y that holds the contents of the urls is guaranteed to be valid for the lifetime of the object. but regardless of how optimized the implementation is with respect to is memory usage, a heap allocation will be made for every xpcom object created. the string comparison with the url type "http", "https", and "ftp" looks like this: nsembedcstring scheme; contentlocation->getscheme(scheme); if (str
cmp("http", scheme.get()) != 0 && str
cmp("https", scheme.get()) != 0 && str
cmp("ftp", scheme.get()) != 0) { // this isn't a type of uri that we deal with. *_retval = pr_true; return ns_ok; } creating nsiuri objects to create an nsiuri, use nsiioservice. nsiioservice is the part of the networking library ("necko") that's responsible for kicking off network requests, managing proto...
... do not allow this nsiuri to load. *_retval = pr_false; nsresult rv; nscomptr<nsi...
... do not allow this nsiuri to load. *_retval = pr_false; nsresult rv; nscomptr<nsiservicemanager> servman; rv = ns_getservic...
...And 2 more matches
Index
faces, interfaces:scriptable, reference, xpcom, xpcom interface reference implemented by: @mozilla.org/inspector/dom-utils;1 as a service: 192 jsdistackframe interfaces, interfaces:scriptable, needscontent, needshelp, xpcom, xpcom interface reference strict mode is on. warnings reported as errors. makes eval() use the last object on its 'obj' param's scope chain as the e
cma 'variables object'. private data for this object is an nsisupports object. attempting to alter this bit will result in an ns_error_illegal_value. opt_* values above, or'd together. last version set on this context. scripts typically select this with the "language" attribute. see the version_* consts on jsdidebuggerservice. unique tag among all valid jsdicontext objects, useful as a hash key. pri...
..., commands when this method is called, your implementation should execute the command with the specified name. 445 nsicontrollers interfaces, interfaces:scriptable, xpcom, xpcom interface reference, commands, controllers this interface is used to manage instances of the nsicontroller interface. windows and text inputs have default controllers that allow commands such as
cmd_copy to act on the focused element or window. xul elements can also have controllers, although they do not have any default controllers. 446 nsiconverterinputstream interfaces, interfaces:scriptable, streams, unicode, xpcom, xpcom api reference, xpcom interface reference implemented by: @mozilla.org/intl/converter-input-stream;1. to create an instance, use: 447 ns...
...e a single "other side" that they send messages to, but rather a set of subordinate message managers. for example, broadcasting a message through a window message manager will broadcast the message to all frame message managers within its window. 741 nsimessagelistener this interface is used to receive messages sent using the nsimessagebroadcaster, nsimessagesender, or nsisyn
cmessagesender interfaces. listeners are attached using the nsimessagelistenermanager interface. 742 nsimessagelistenermanager interfaces, interfaces:scriptable, message manager, xpcom, xpcom interface reference implemented by: @mozilla.org/globalmessagemanager;1. to access this service, use: 743 nsimessagesender message senders enable clients to send async...
...And 2 more matches
nsIAppStartup
o use the service: var appstartup = components.classes["@mozilla.org/toolkit/app-startup;1"] .getservice(components.interfaces.nsiappstartup); method overview void createhiddenwindow(); boolean createstartupstate(in long awindowwidth, in long awindowheight); obsolete since gecko 1.9.1 void destroyhiddenwindow(); void doprofilestartup(in nsi
cmdlineservice a
cmdlineservice, in boolean caninteract); obsolete since gecko 1.9.1 void ensure1window(in nsi
cmdlineservice a
cmdlineservice); obsolete since gecko 1.9.1 void enterlastwindowclosingsurvivalarea(); void exitlastwindowclosingsurvivalarea(); void getstartupinfo(); void hidesplashscreen(); obsolete since gecko 1.9.1 void initialize(in...
...ndow was opened. destroyhiddenwindow() destroys the hidden window. this will have no effect if the hidden window has not yet been created. void destroyhiddenwindow(); parameters none. doprofilestartup() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) starts up the profile manager with the given arguments. void doprofilestartup( in nsi
cmdlineservice a
cmdlineservice, in boolean caninteract ); parameters a
cmdlineservice the arguments given to the program. caninteract if false and ui is needed, will fail. ensure1window() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) ensures that at least one window exists after creating the startup state. if one has not been made, t...
... enterlastwindowclosingsurvivalarea() serves for situations when all application windows will be closed but we don't want to take this as a signal to quit the application. bracket the code where the last window could close with these. ...
...And 2 more matches
Debugger.Environment - Firefox Developer Tools
a debugger.environment instance represents a lexical environment, associating names with variables. each debugger.frame instance representing a debuggee frame has an associated environment object describing the variables in scope in that frame; and each debugger.object instance representing a debuggee function has an environment object representing the environment the function has closed over. e
cmascript environments form a tree, in which each local environment is parented by its enclosing environment (in e
cmascript terms, its ‘outer’ environment). we say an environmentbinds an identifier if that environment itself associates the identifier with a variable, independently of its outer environments. we say an identifier isin scope in an environment if the identifier is bound in that envi...
...at the environment’s bindings are the properties of an object. the global object and dom elements appear in the chain of environments via object environments. (note that with statements have their own environment type.) “with”, indicating that the environment was introduced by a with statement. parent the environment that encloses this one (the “outer” environment, in e
cmascript terminology), or null if this is the outermost environment. object a debugger.object instance referring to the object whose properties this environment reflects. if this is a declarative environment record, this accessor throws a typeerror (since declarative environment records have no such object). both "object" and "with" environments have object properties that provide the object whos...
...thods of other kinds of objects. names() return an array of strings giving the names of the identifiers bound by this environment. the result does not include the names of identifiers bound by enclosing environments. getvariable(name) return the value of the variable bound toname in this environment, or undefined if this environment does not bindname.name must be a string that is a valid e
cmascript identifier name. the result is a debuggee value. javascript engines often omit variables from environments, to save space and reduce execution time. if the given variable should be in scope, but getvariable is unable to produce its value, it returns an ordinary javascript object (not a debugger.object instance) whose optimizedout property is true. this is not an invocation function; if...
...And 2 more matches
Page inspector keyboard shortcuts - Firefox Developer Tools
command windows macos linux inspect element ctrl + shift + c
cmd + shift + c ctrl + shift + c node picker these shortcuts work while the node picker is active. command windows macos linux select the element under the mouse and cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane. ...
...d cancel picker mode click click click select the element under the mouse and stay in picker mode shift+click shift+click shift+click html pane these shortcuts work while you're in the inspector's html pane. command windows macos linux delete the selected node delete delete delete undo delete of a node ctrl + z
cmd + z ctrl + z redo delete of a node ctrl + shift + z / ctrl + y
cmd + shift + z /
cmd + y ctrl + shift + z / ctrl + y move to next node (expanded nodes only) down arrow down arrow down arrow move to previous node up arrow up arrow up arrow move to first node in the tree. home home home move to last node in the tre...
... enter step forward through the attributes of a node tab tab tab step backward through the attributes of a node shift + tab shift + tab shift + tab (when an attribute is selected) start editing the attribute enter return enter hide/show the selected node h h h focus on the search box in the html pane ctrl + f
cmd + f ctrl + f edit as html f2 f2 f2 stop editing html f2 / ctrl +enter f2 /
cmd + return f2 / ctrl + enter copy the selected node's outer html ctrl + c
cmd + c ctrl + c scroll the selected node into view s s s find the next match in the markup, when searching is active enter return enter find the...
...And 2 more matches
SVGLength - Web APIs
ttype) properties readonly unsigned short unittype float value float valueinspecifiedunits domstring valueasstring constants svg_lengthtype_unknown = 0 svg_lengthtype_number = 1 svg_lengthtype_percentage = 2 svg_lengthtype_ems = 3 svg_lengthtype_exs = 4 svg_lengthtype_px = 5 svg_lengthtype_
cm = 6 svg_lengthtype_mm = 7 svg_lengthtype_in = 8 svg_lengthtype_pt = 9 svg_lengthtype_pc = 10 normative document svg 1.1 (2nd edition) example <svg height="200" onload="start();" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"><![cdata[ function start() { var rect = document.getelementbyid("myrect"); ...
...= 8 svg_lengthtype_pt = 9 svg_lengthtype_pc = 10 normative document svg 1.1 (2nd edition) example <svg height="200" onload="start();" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"><![cdata[ function start() { var rect = document.getelementbyid("myrect"); var val = rect.x.baseval; // read x in pixel and
cm units console.log("value: " + val.value + ", valueinspecifiedunits: " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring); // set x = 20pt and read it out in pixel and pt units val.newvaluespecifiedunits(svglength.svg_lengthtype_pt, 20); console.log("value: " + val.value + ", valueinspecifiedunits " + val.unitty...
...valueasstring: " + val.valueasstring); // convert x = 20pt to inches and read out in pixel and inch units val.converttospecifiedunits(svglength.svg_lengthtype_in); console.log("value: " + val.value + ", valueinspecifiedunits " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring); } ]]></script> <rect id="myrect" x="1
cm" y="1
cm" fill="green" stroke="black" stroke-width="1" width="1
cm" height="1
cm" /> </svg> results on a desktop monitor (pixel units will be dpi-dependent): value: 37.7952766418457, valueinspecifiedunits: 6: 1, valueasstring: 1
cm value: 26.66666603088379, valueinspecifiedunits 9: 20, valueasstring: 20pt value: 26.66666603088379, valueinspecifiedunits 8: 0.277777761220932, value...
...And 2 more matches
WebRTC Statistics API - Web APIs
local ice candidate associated with the connection's rtcicetransports. rtcicecandidatestats rtcstats media-source statistics about the media produced by the mediastreamtrack attached to an rtp sender. the dictionary this key maps to depends on the track's kind. rtcaudiosourcestats or rtcvideosourcestats rt
cmediasourcestats rtcstats rtcaudiosourcestats or rtcvideosourcestats outbound-rtp statistics describing the state of one of the outbound data streams on this connection. rtcoutboundrtpstreamstats rtcsentrtpstreamstats rtcrtpstreamstats rtcstats ...
...connectionstats rtcstats receiver statistics related to a specific rtcrtpreceiver and the media associated with that receiver. the specific type of object representing the statistics depends on the media kind. rtcaudioreceiverstats or rtcvideoreceiverstats rtcaudiohandlerstats or rtcvideohandlerstats rt
cmediahandlerstats rtcstats remote-candidate statistics about a remote ice candidate associated with the connection's rtcicetransports. rtcicecandidatestats rtcstats remote-inbound-rtp statistics describing the state of the inbound data stream f...
... rtcsctptransportstats rtcstats sender statistics related to a specific rtcrtpsender and the media associated with that sender. the type of object representing this statistic depends on the kind of the media. ...
...And 2 more matches
CSS values and units - CSS: Cascading Style Sheets
may or may not have a decimal point with a fractional component, for example 0.255, 128 or -1.2. numbers may also be preceded by a + or - symbol. dimensions a <dimension> is a <number> with a unit attached to it, for example 45deg, 100ms, or 10px. the attached unit identifier is case insensitive. there is never a space or any other characters between a the number and the unit identifier: i.e. 1
cm is not valid. css uses dimensions to specify: <length> (distance units) <angle> <time> <frequency> <resolution> these are all covered in subsections below. distance units where a distance unit, also known as a length, is allowed as a value for a property, this is described as the <length> type. there are two types of lengths in css: relative and absolute. relative length units specif...
...mension. vmax 1% of viewport's larger dimension. absolute length units are fixed to a physical length: either an inch or a centimeter. many of these units are therefore more useful when the output is a fixed size media, such as print. for example, mm is a physical millimeter, 1/10th of a centimeter. ...
... 1% of viewport's larger dimension. absolute length units are fixed to a physical length: either an inch or a centimeter. many of these units are therefore more useful when the output is a fixed size media, such as print. for example, mm is a physical millimeter, 1/10th of a centimeter. absolute length units unit name equivalent to
cm centimeters 1
cm = 96px/2.54 mm millimeters 1mm = 1/10th of 1
cm q quarter-millimeters 1q = 1/40th of 1
cm in inches 1in = 2.54
cm = 96px pc picas 1pc = 1/16th of 1in pt points 1pt = 1/72th of 1in px pixels 1px = 1/96th of 1in when including a length value, if the length is 0, the unit identifier is not required. otherwi...
...And 2 more matches
Rich-Text Editing in Mozilla - Developer guides
nd(aname,false, aarg); document.getelementbyid('editorwindow').contentwindow.focus() } example: a simple but complete rich text editor <!doctype html> <html> <head> <title>rich text editor</title> <script type="text/javascript"> var odoc, sdeftxt; function initdoc() { odoc = document.getelementbyid("textbox"); sdeftxt = odoc.innerhtml; if (document.compform.switchmode.checked) { setdo
cmode(true); } } function formatdoc(s
cmd, svalue) { if (validatemode()) { document.execcommand(s
cmd, false, svalue); odoc.focus(); } } function validatemode() { if (!document.compform.switchmode.checked) { return true ; } alert("uncheck \"show html\"."); odoc.focus(); return false; } function setdo
cmode(btosource) { var ocontent; if (btosource) { ocontent = document.createtextno...
..." title="print" onclick="printdoc();" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalgpc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaalewaacxmbajqcgaaaaad0su1fb9oebxczfmgboiwaaaaidevydenvbw1lbnqa9sywvwaaaufjrefuomvtlutsjfeux//n3nn0ydpbh1abrpt4lfqtqkc3jrkkneisiiribbehjjpklivo4m1rrmkkjqirmjruqudkpt71qpipirkpaqdf55tv5vvuszjqtjolseukd3xu/3dpzusc/22wtu2wrn+jg5so/ocdh8y
cmjdflehmlkjkvk7kuyn+ufza/rtth76zavocdptrxzqtni3mrwupc+6cktlxz/sddp2uu9uxlmyxz6qm8v4tz8lhf1h+zdqxt7s8olmxtbf4e8qafhjj3kbp2mzkkthpitjp9vh6ihia+whtasx5brpwuemgdondf/2a4m7ukds1jw662+xkqtkeuoqjktojm2h53yfl15psj04zc94wdtibr26fxlc2mzrvbccebz2kirfd414tkmlezbvgt33+qcohgha81swysew0r1uzfnylmtpx80pngqq91lwvk2jgvgnfvzg6ycyrat16gftw5kkkfo1eqltfh5q2ett0biwf+aitq4fdbk+imyo1oxvgf03wafjqvbckvdffryetxqiffygazths0zwag...
...formatting" onclick="formatdoc('removeformat')" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalgpc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaaoxaaadsqblssogwaaaad0su1fb9oecqmckpi8ciiaaaaidevydenvbw1lbnqa9sywvwaaauhjrefuomtjybgfxab501zwbvval2nhnlmk6mxcjbf69zu+hz/9fb5o1lx+bg45qhl8/fyr5it3xrp/ywtuvvvk3veqgxz70tvbjy8+wv39+2/hz19/mgwjzzutyjaluobv9jimaxheyd3h7ku8fpj2i
cml8z92dlbtmzdeig3fco7j08foh1kurkm3e9iw54yvkwutuom+lpt/bgbwf3//sf37/1/c02ccg1lb8f//f95dzx74mtmzshhosm6szrq/a6ir/z2rkfejbxulyfpdidi6af///2ckahbp7+7wmavp5n76+p2clrliyl8h9w36aujcbcxm4szmtjac7kza////r3h1w2cfwagafpbqs5g7d95++/p1b4+eck8tawmdw/1h7159+/7r7zcvpz4fohbzewmdwx8gbgagnnatfhzx8zqrj+4vjbh5cqegoyseua/v3n7hxmqi8wugbgygl3vvg7fupk3i5gd9/fja7zsmdazmg/ze52mzesj4yu1xeq/ff7w5dvfvas1lsxc4db7z8c3r8p7qjf///2d...
...And 2 more matches
Making content editable - Developer guides
"allaccess"); user_pref("capability.policy.allowclipboard.clipboard.paste", "allaccess"); example: a simple but complete rich text editor <!doctype html> <html> <head> <title>rich text editor</title> <script type="text/javascript"> var odoc, sdeftxt; function initdoc() { odoc = document.getelementbyid("textbox"); sdeftxt = odoc.innerhtml; if (document.compform.switchmode.checked) { setdo
cmode(true); } } function formatdoc(s
cmd, svalue) { if (validatemode()) { document.execcommand(s
cmd, false, svalue); odoc.focus(); } } function validatemode() { if (!document.compform.switchmode.checked) { return true ; } alert("uncheck \"show html\"."); odoc.focus(); return false; } function setdo
cmode(btosource) { var ocontent; if (btosource) { ocontent = document.createtextno...
..." title="print" onclick="printdoc();" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalgpc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaalewaacxmbajqcgaaaaad0su1fb9oebxczfmgboiwaaaaidevydenvbw1lbnqa9sywvwaaaufjrefuomvtlutsjfeux//n3nn0ydpbh1abrpt4lfqtqkc3jrkkneisiiribbehjjpklivo4m1rrmkkjqirmjruqudkpt71qpipirkpaqdf55tv5vvuszjqtjolseukd3xu/3dpzusc/22wtu2wrn+jg5so/ocdh8y
cmjdflehmlkjkvk7kuyn+ufza/rtth76zavocdptrxzqtni3mrwupc+6cktlxz/sddp2uu9uxlmyxz6qm8v4tz8lhf1h+zdqxt7s8olmxtbf4e8qafhjj3kbp2mzkkthpitjp9vh6ihia+whtasx5brpwuemgdondf/2a4m7ukds1jw662+xkqtkeuoqjktojm2h53yfl15psj04zc94wdtibr26fxlc2mzrvbccebz2kirfd414tkmlezbvgt33+qcohgha81swysew0r1uzfnylmtpx80pngqq91lwvk2jgvgnfvzg6ycyrat16gftw5kkkfo1eqltfh5q2ett0biwf+aitq4fdbk+imyo1oxvgf03wafjqvbckvdffryetxqiffygazths0zwag...
...formatting" onclick="formatdoc('removeformat')" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalgpc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaaoxaaadsqblssogwaaaad0su1fb9oecqmckpi8ciiaaaaidevydenvbw1lbnqa9sywvwaaauhjrefuomtjybgfxab501zwbvval2nhnlmk6mxcjbf69zu+hz/9fb5o1lx+bg45qhl8/fyr5it3xrp/ywtuvvvk3veqgxz70tvbjy8+wv39+2/hz19/mgwjzzutyjaluobv9jimaxheyd3h7ku8fpj2i
cml8z92dlbtmzdeig3fco7j08foh1kurkm3e9iw54yvkwutuom+lpt/bgbwf3//sf37/1/c02ccg1lb8f//f95dzx74mtmzshhosm6szrq/a6ir/z2rkfejbxulyfpdidi6af///2ckahbp7+7wmavp5n76+p2clrliyl8h9w36aujcbcxm4szmtjac7kza////r3h1w2cfwagafpbqs5g7d95++/p1b4+eck8tawmdw/1h7159+/7r7zcvpz4fohbzewmdwx8gbgagnnatfhzx8zqrj+4vjbh5cqegoyseua/v3n7hxmqi8wugbgygl3vvg7fupk3i5gd9/fja7zsmdazmg/ze52mzesj4yu1xeq/ff7w5dvfvas1lsxc4db7z8c3r8p7qjf///2d...
...And 2 more matches
Functions - JavaScript
er. parsley. " myconcat('. ', 'sage', 'basil', 'oregano', 'pepper', 'parsley'); note: the arguments variable is "array-like", but not an array. it is array-like in that it has a numbered index and a length property. however, it does not possess all of the array-manipulation methods. see the function object in the javascript reference for more information. ...
... in the following example, if no value is provided for b, its value would be undefined when evaluating a*b, and a call to multiply would normally have returned nan. ...
...n a value if they are undefined. in the following example, if no value is provided for b, its value would be undefined when evaluating a*b, and a call to multiply would normally have returned nan. however, this is prevented by the second line in this example: function multiply(a, b) { b = typeof b !== 'undefined' ? b : 1; return a * b; } multiply(5); // 5 with default parameters (post-e
cmascript 2015) with default parameters, a manual check in the function body is no longer necessary. you can simply put 1 as the default value for b in the function head: function multiply(a, b = 1) { return a * b; } multiply(5); // 5 for more details, see default parameters in the reference. rest parameters the rest parameter syntax allows us to represent an indefinite number of arguments a...
...And 2 more matches
Classes - JavaScript
method definitions the body of a class is the part that is in curly brackets {}. this is where you define class members, such as methods or constructor. strict mode the body of a class is executed in strict mode, i.e., code written here is subject to stricter syntax for increased performance, some otherwise silent errors will be thrown, and certain keywords are reserved for future versions of e
cmascript. constructor the constructor method is a special method for creating and initializing an object created with a class. there can only be one special method with the name "constructor" in a class. a syntaxerror will be thrown if the class contains more than one occurrence of a constructor method. a constructor can use the super keyword to call the constructor of the super class. prototyp...
...sed inheritance. class cat { constructor(name) { this.name = name; } speak() { console.log(`${this.name} makes a noise.`); } } class lion extends cat { speak() { super.speak(); console.log(`${this.name} roars.`); } } let l = new lion('fuzzy'); l.speak(); // fuzzy makes a noise. // fuzzy roars. mix-ins abstract subclasses or mix-ins are templates for classes. ...
...e. // fuzzy roars. mix-ins abstract subclasses or mix-ins are templates for classes. an e
cmascript class can only have a single superclass, so multiple inheritance from tooling classes, for example, is not possible. the functionality must be provided by the superclass. ...
...And 2 more matches
Array.prototype.lastIndexOf() - JavaScript
searched from back to front. if the calculated index is less than 0, -1 is returned, i.e. the array will not be searched. return value the last index of the element in the array; -1 if not found. description lastindexof compares searchelement to elements of the array using strict equality (the same method used by the ===, or triple-equals, operator). ...
...or triple-equals, operator). polyfill lastindexof was added to the e
cma-262 standard in the 5th edition; as such it may not be present in other implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of lastindexof in implementations which do not natively support it. this algorithm is exactly the one specified in e
cma-262, 5th edition, assuming object, typeerror, number, math.floor, math.abs, and math.min have their original values. ...
... implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of lastindexof in implementations which do not natively support it. this algorithm is exactly the one specified in e
cma-262, 5th edition, assuming object, typeerror, number, math.floor, math.abs, and math.min have their original values. ...
...And 2 more matches
Array.prototype.map() - JavaScript
the array are changed, their value as passed to callback will be the value at the time map visits them. elements that are deleted after the call to map begins and before being visited are not visited. due to the algorithm defined in the specification, if the array which map was called upon is sparse, resulting array will also be sparse keeping same indices blank. ...
... also be sparse keeping same indices blank. polyfill map was added to the e
cma-262 standard in the 5th edition. therefore, it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of map in implementations which do not natively support it. this algorithm is exactly the one specified in e
cma-262, 5th edition, assuming object, typeerror, and array have their original values and that callback.call evaluates to the original value of function.prototype.call. ...
... work around this by inserting the following code at the beginning of your scripts, allowing use of map in implementations which do not natively support it. this algorithm is exactly the one specified in e
cma-262, 5th edition, assuming object, typeerror, and array have their original values and that callback.call evaluates to the original value of function.prototype.call. // production steps of e
cma-262, edition 5, 15.4.4.19 // reference: http://es5.github.io/#x15.4.4.19 if (!array.prototype.map) { array.prototype.map = function(callback/*, thisarg*/) { var t, a, k; if (this == null) { throw new typeerror('this is null or not defined'); } // 1. let o be the result of calling toobject passing the |this| // value as the argument. var o = object(this); ...
...And 2 more matches
Array.prototype.some() - JavaScript
all to some() begins will not be visited by callback. if an existing, unvisited element of the array is changed by callback, its value passed to the visiting callback will be the value at the time that some() visits that element's index. elements that are deleted are not visited. ...
...mpty array returns false for any condition! ...
...you can work around this by inserting the following code at the beginning of your scripts, allowing use of some() in implementations which do not natively support it. this algorithm is exactly the one specified in e
cma-262, 5th edition, assuming object and typeerror have their original values and that fun.call evaluates to the original value of function.prototype.call(). ...
...And 2 more matches
Array.prototype.toLocaleString() - JavaScript
bcp 47 language tag, or an array of such strings. for the general form and interpretation of the locales argument, see the intl page. options optional an object with configuration properties, for numbers see number.prototype.tolocalestring(), and for dates see date.prototype.tolocalestring(). return value a string representing the elements of the array. polyfill // https://tc39.github.io/e
cma402/#sup-array.prototype.tolocalestring if (!array.prototype.tolocalestring) { object.defineproperty(array.prototype, 'tolocalestring', { value: function(locales, options) { // 1. let o be ? toobject(this value). if (this == null) { throw new typeerror('"this" is null or not defined'); } var a = object(this); // 2. let len be ? tolength(? get(a, "leng...
... ...
... ...
...And 2 more matches
Date - JavaScript
script date objects represent a single moment in time in a platform-independent format. date objects contain a number that represents milliseconds since 1 january 1970 utc. tc39 is working on temporal, a new date/time api. read more about it on the igalia blog and fill out the survey. it needs real-world feedback from web developers, but is not yet ready for production use! description the e
cmascript epoch and timestamps a javascript date is fundamentally specified as the number of milliseconds that have elapsed since midnight on january 1, 1970, utc. this date and time is the same as the unix epoch, which is the predominant base value for computer-recorded date and time values. note: it's important to keep in mind that while the time value at the heart of a date object is utc, the b...
...ote: it's important to keep in mind that while the time value at the heart of a date object is utc, the basic methods to fetch the date and time or its components all work in the local (i.e. host system) time zone and offset. it should be noted that the maximum date is not of the same value as the maximum safe integer (number.max_safe_integer is 9,007,199,254,740,991). instead, it is defined in e
cma-262 that a maximum of ±100,000,000 (one hundred million) days relative to january 1, 1970 utc (that is, april 20, 271821 bce ~ september 13, 275760 ce) can be represented by the standard date object (equivalent to ±8,640,000,000,000,000 milliseconds). date format and time zone conversions there are a number of methods available to obtain a date in various formats, as well as to perform time ...
...ing to universal time. date.prototype.getutcday() returns the day of the week (0–6) in the specified date according to universal time. date.prototype.getutcfullyear() returns the year (4 digits for 4-digit years) in the specified date according to universal time. date.prototype.getutchours() returns the hours (0–23) in the specified date according to universal time. date.prototype.getut
cmilliseconds() returns the milliseconds (0–999) in the specified date according to universal time. date.prototype.getut
cminutes() returns the minutes (0–59) in the specified date according to universal time. date.prototype.getut
cmonth() returns the month (0–11) in the specified date according to universal time. date.prototype.getutcseconds() returns the seconds (0–59) in the specifie...
...And 2 more matches
Intl.Locale.prototype.maximize() - JavaScript
fier are called extension subtags and are not affected by the maximize() method. examples of these subtags include locale.hourcycle, locale.calendar, and locale.numeric. ...
...ale = new intl.locale("fr", {hourcycle: "h24", calendar: "gregory"}); console.log(mylocale.basename); // prints "fr" console.log(mylocale.tostring()); // prints "fr-u-ca-gregory-hc-h24" let mylo
cmaximized = mylocale.maximize(); // prints "fr-latn-fr". the "latn" and "fr" tags are added, // since french is only written in the latin script and is most likely to be spoken in france. console.log(mylo
cmaximized.basename); // prints "fr-latn-fr-u-ca-gregory-hc-h24". ...
...()); // prints "fr-u-ca-gregory-hc-h24" let mylo
cmaximized = mylocale.maximize(); // prints "fr-latn-fr". the "latn" and "fr" tags are added, // since french is only written in the latin script and is most likely to be spoken in france. console.log(mylo
cmaximized.basename); // prints "fr-latn-fr-u-ca-gregory-hc-h24". // note that the extension tags (after "-u") remain unchanged. ...
...And 2 more matches
Intl.Locale.prototype.minimize() - JavaScript
subtags and are not affected by the minimize() method. examples of these subtags include locale.hourcycle, locale.calendar, and locale.numeric. ...
...minimize let mylocale = new intl.locale("fr-latn-fr", {hourcycle: "h24", calendar: "gregory"}); console.log(mylocale.basename); // prints "fr-latn-fr" console.log(mylocale.tostring()); // prints "fr-latn-fr-u-ca-gregory-hc-h24" let mylo
cminimized = mylocale.minimize(); // prints "fr", since french is only written in the latin script // and is most likely to be spoken in france. ...
... "fr-latn-fr" console.log(mylocale.tostring()); // prints "fr-latn-fr-u-ca-gregory-hc-h24" let mylo
cminimized = mylocale.minimize(); // prints "fr", since french is only written in the latin script // and is most likely to be spoken in france. console.log(mylo
cminimized.basename); // prints "fr-u-ca-gregory-hc-h24". // note that the extension tags (after "-u") remain unchanged. ...
...And 2 more matches
String - JavaScript
ls can be specified using single or double quotes, which are treated identically, or using the backtick character `. this last form specifies a template literal: with this form you can interpolate expressions. character access there are two ways to access an individual character in a string. the first is the charat() method: return 'cat'.charat(1) // returns "a" the other way (introduced in e
cmascript 5) is to treat the string as an array-like object, where individual characters correspond to a numerical index: return 'cat'[1] // returns "a" when using bracket notation for character access, attempting to delete or assign a value to these properties will not succeed. the properties involved are neither writable nor configurable. (see object.defineproperty() for more information.) com...
...ring as an array-like object, where individual characters correspond to a numerical index: return 'cat'[1] // returns "a" when using bracket notation for character access, attempting to delete or assign a value to these properties will not succeed. the properties involved are neither writable nor configurable. (see object.defineproperty() for more information.) comparing strings in c, the str
cmp() function is used for comparing strings. in javascript, you just use the less-than and greater-than operators: let a = 'a' let b = 'b' if (a < b) { // true console.log(a + ' is less than ' + b) } else if (a > b) { console.log(a + ' is greater than ' + b) } else { console.log(a + ' and ' + b + ' are equal.') } a similar result can be achieved using the localecompare() method inherited b...
...ototype.tolowercase() returns the calling string value converted to lowercase. string.prototype.tostring() returns a string representing the specified object. overrides the object.prototype.tostring() method. string.prototype.touppercase() returns the calling string value converted to uppercase. string.prototype.trim() trims whitespace from the beginning and end of the string. part of the e
cmascript 5 standard. string.prototype.trimstart() trims whitespace from the beginning of the string. string.prototype.trimend() trims whitespace from the end of the string. string.prototype.valueof() returns the primitive value of the specified object. overrides the object.prototype.valueof() method. string.prototype.@@iterator() returns a new iterator object that iterates over the code poi...
...And 2 more matches
CommandLine - Archive of obsolete content
handling command line arguments with xulrunner for multiple instances application it's fairly easy to retrieve application specific command line arguments in xulrunner when it's not a single instance application. an nsicommandline object is passed as the first argument of the launched window: example var
cmdline = window.arguments[0];
cmdline =
cmdline.queryinterface(components.interfaces.nsicommandline); alert(
cmdline.handleflagwithparam("test", false)); see also: chrome: command line for single instance applications of course, for a single instance application (see toolkit.singletonwindowtype for more information), the last example still applies the first time your application is launched. however, if you'd like to retrieve the latest command line arguments (to open a fil...
...ationname/clh;1"; const cld_category = "m-applicationname"; var apphandler = { /* nsisupports */ queryinterface : function clh_qi(aiid) { if (aiid.equals(nsicommandlinehandler) || aiid.equals(nsifactory) || aiid.equals(nsisupports)) return this; throw components.results.ns_error_no_interface; }, /* nsicommandlinehandler */ handle : function clh_handle(a
cmdline) { var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.notifyobservers(a
cmdline, "commandline-args-changed", null); }, helpinfo : " -test <value> a test attribute\n", /* nsifactory */ createinstance : function mdh_ci(aouter, aiid) { ...
...nts.classes["@mozilla.org/categorymanager;1"] .getservice(nsicategorymanager); catman.deletecategoryentry("command-line-handler", cld_category); }, canunload : function (acompmgr) { return true; } }; function nsgetmodule(acompmgr, afilespec) { return apphandlermodule; } create an observer that will get notified when arguments change: chrome/content/
cmdline.js function commandlineobserver() { this.register(); } commandlineobserver.prototype = { observe: function(asubject, atopic, adata) { var
cmdline = asubject.queryinterface(components.interfaces.nsicommandline); var test =
cmdline.handleflagwithparam("test", false); alert("test = " + test); }, register: function() { var observerservice = components.classes["@mozil...
...</window> original document information author: georges-etienne legendre last updated date: august 21st, 2007 ...
GLSL Shaders - Game development
6, 1.0); } this will set an rgba color to recreate the current light blue one — the first three float values (ranging from 0.0 to 1.0) represent the red, green, and blue channels while the fourth one is the alpha transparency (ranging from 0.0 — fully transparent — to 1.0 — fully opaque). ...
... to recreate the current light blue one — the first three float values (ranging from 0.0 to 1.0) represent the red, green, and blue channels while the fourth one is the alpha transparency (ranging from 0.0 — fully transparent — to 1.0 — fully opaque). ...
... blue one — the first three float values (ranging from 0.0 to 1.0) represent the red, green, and blue channels while the fourth one is the alpha transparency (ranging from 0.0 — fully transparent — to 1.0 — fully opaque). applying the shaders to actually apply the newly created shaders to the cube, comment out the basi
cmaterial definition first: // var basi
cmaterial = new three.meshbasi
cmaterial({color: 0x0095dd}); then, create the shadermaterial: var shadermaterial = new three.shadermaterial( { vertexshader: document.getelementbyid( 'vertexshader' ).textcontent, fragmentshader: document.getelementbyid( 'fragmentshader' ).textcontent }); this shader material takes the code from the scripts and applies it to the object the material is assigned to. then, in the line that def...
...e the shadermaterial: var shadermaterial = new three.shadermaterial( { vertexshader: document.getelementbyid( 'vertexshader' ).textcontent, fragmentshader: document.getelementbyid( 'fragmentshader' ).textcontent }); this shader material takes the code from the scripts and applies it to the object the material is assigned to. then, in the line that defines the cube we need to replace the basi
cmaterial: var cube = new three.mesh(boxgeometry, basi
cmaterial); ...with the newly created shadermaterial: var cube = new three.mesh(boxgeometry, shadermaterial); three.js compiles and runs the shaders attached to the mesh to which this material is given. in our case the cube will have both vertex and texture shaders applied. that's it — you've just created the simplest possible shader, con...
Function - MDN Web Docs Glossary: Definitions of Web-related terms
part of a function declaration or function expression. the function name's scope depends on whether the function name is a declaration or expression. different types of functions an anonymous function is a function without a function name. ...
...pends on whether the function name is a declaration or expression. different types of functions an anonymous function is a function without a function name. only function expressions can be anonymous, function declarations must have a name: // when used as a function expression (function () {}); // or using the e
cmascript 2015 arrow notation () => {}; the following terms are not used in the e
cmascript language specification, they're jargon used to refer to different types of functions. a named function is a function with a function name: // function declaration function foo() {}; // named function expression (function bar() {}); // or using the e
cmascript 2015 arrow notation const foo = () => {}; an inner function is a function inside another function (square in this case). an outer...
...named function expression (function bar() {}); // or using the e
cmascript 2015 arrow notation const foo = () => {}; an inner function is a function inside another function (square in this case). an outer function is a function containing a function (addsquares in this case): function addsquares(a,b) { function square(x) { return x * x; } return square(a) + square(b); }; //using e
cmascript 2015 arrow notation const addsquares = (a,b) => { const square = x => x*x; return square(a) + square(b); }; a recursive function is a function that calls itself. see recursion. ...
...se): function addsquares(a,b) { function square(x) { return x * x; } return square(a) + square(b); }; //using e
cmascript 2015 arrow notation const addsquares = (a,b) => { const square = x => x*x; return square(a) + square(b); }; a recursive function is a function that calls itself. see recursion. function loop(x) { if (x >= 10) return; loop(x + 1); }; //using e
cmascript 2015 arrow notation const loop = x => { if (x >= 10) return; loop(x + 1); }; an immediately invoked function expressions (iife) is a function that is called directly after the function is loaded into the browser’s compiler. the way to identify an iife is by locating the extra left and right parenthesis at the end of the function’s definition. // declared functions can't ...
Round Trip Time (RTT) - MDN Web Docs Glossary: Definitions of Web-related terms
round trip time (rtt) is the length time it takes for a data packet to be sent to a destination plus the time it takes for an acknowledgment of that packet to be received back at the origin. the rtt between a network and server can be determined by using the ping command. ...
...ime it takes for a data packet to be sent to a destination plus the time it takes for an acknowledgment of that packet to be received back at the origin. the rtt between a network and server can be determined by using the ping command. ...
... the time it takes for an acknowledgment of that packet to be received back at the origin. the rtt between a network and server can be determined by using the ping command. ...
...eceived back at the origin. the rtt between a network and server can be determined by using the ping command. $ ping example.com ping example.com (216.58.194.174): 56 data bytes 64 bytes from 216.58.194.174: i
cmp_seq=0 ttl=55 time=25.050 ms 64 bytes from 216.58.194.174: i
cmp_seq=1 ttl=55 time=23.781 ms 64 bytes from 216.58.194.174: i
cmp_seq=2 ttl=55 time=24.287 ms 64 bytes from 216.58.194.174: i
cmp_seq=3 ttl=55 time=34.904 ms 64 bytes from 216.58.194.174: i
cmp_seq=4 ttl=55 time=26.119 ms --- google.com ping statistics --- 5 packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 23.781/26.828/34.904/4.114 ms in the above example, the average round trip time is shown on the final line as 26.8ms. see also time to first byte (ttfb) latency ...
Command line crash course - Learn web development
d the file names using your finder or explorer gui app, it would take you a long time. anyway, the terminal is not going away anytime soon. what does the terminal look like? below you can see some of the different flavours of programs that are available that can get you to a terminal. the next images show the command prompts available in windows — there’s a good range of options from the "
cmd" program to "powershell" — which can be run from the start menu by typing the program name. and below, you can see the macos terminal application. how do you access the terminal? many developers today are using unix-based tools (e.g. the terminal, and the tools you can access through it). many tutorials and tools that exist on the web today support (and sadly assume) unix-based systems,...
...ot cause us any worries as we work through this article. the terminal is available on macos at applications/utilities/terminal. windows as with some other programming tools, using the terminal (or command line) on windows has traditionally not been as simple or easy as on other operating systems. but things are getting better. windows has traditionally had its own terminal-like program called
cmd (“the command prompt”) for a long time, but this definitely doesn’t have parity with unix commands, and is equivalent to the old-style windows dos prompt. better programs exist for providing a terminal experience on windows, such as powershell (see here to find installers), and gitbash (which comes as part of the git for windows toolset) however, the best option for windows in the moder...
... you to run a “true terminal” directly on windows, without needing a virtual machine. this can be installed directly from the windows store for free. you can find all the documentation you need in the windows subsystem for linux documentation. in terms of what option to choose on windows, we’d strongly recommend trying to install the wsl. you could stick with the default command prompt (
cmd), and many tools will work ok, but you’ll find everything easier if you have better parity with unix tools. side note: what's the difference between a command line and a terminal? generally you'll find these two terms used interchangeably. technically, a terminal is software that starts and connects to a shell. a shell is your session and session environment (where things like the prompt and...
...roject\src — this may seem really odd, but if you are interested in why, watch this youtube clip featuring an explanation by one of microsoft’s principal engineers. listing directory contents another built-in unix command is ls (short for list), which lists the contents of the directory you’re currently in. note that this won’t work if you’re using the default windows command prompt (
cmd) — the equivalent there is dir. try running this now in your terminal: ls this gives you a list of the files and directories in your present working directory, but the information is really basic — you only get the name of each item present, not whether it is a file or a directory, or anything else. fortunately, a small change to the command usage can give you a lot more information. int...
Embedding Tips
nager which points to your nsiwebbrowserchrome implementation. this implementation should also implement nsiclipboarddragdrophooks. deny the drop by setting the return value of the allowdrop() function. ...
...plementation should also implement nsiclipboarddragdrophooks. deny the drop by setting the return value of the allowdrop() function. ...
...ion. ...
...ager> commandmanager = do_getinterface(iwebbrowser); if (commandmanager) { nscomptr<nsidomwindow> thedomwindow = do_getinterface(iwebbrowser); nscomptr<nsicommandparams>
cmdparamsobj = do_createinstance(ns_command_params_contractid,&rv);
cmdparamsobj->setisupportsvalue("addhook", reinterpret_cast<nsisupports*>(ichromeimplementation)); commandmanager->docommand("
cmd_clipboarddragdrophook",
cmdparamsobj, thedomwindow); } ...
Localizing with Koala
se, you'll see in a moment how koala nicely handles entity order. the entity was added to the file and the english string is automatically highlighted, so that you can translate it right away. this entity is used in the tooltip that appears when you hover over the magnifying glass icon in the search bar. once you translated the searchendcap.label entity, add the other one from this file, i.e.
cmd_enginemanager.label. you can right-click it and choose "add entity" as you did previously, or just double-click the entity name to add it to the file. note how koala is smart enough to insert this entity before searchendcap.label. this is helpful for keeping the localization files clean and tidy at all times. the string to translated is selected so that you can translate it without any further ...
...choose "add entity" as you did previously, or just double-click the entity name to add it to the file. note how koala is smart enough to insert this entity before searchendcap.label. this is helpful for keeping the localization files clean and tidy at all times. the string to translated is selected so that you can translate it without any further clicking. when you are done with translating the
cmd_enginemanager.label entity, save the file. now let's create the other file. double-click on search.properties and click "ok" when koala asks if you want to create this file. from the sidebar, add the
cmd_addfoundengine string to the newly-created search.properties file in your locale file structure. translate the
cmd_addfoundengine string. notice that the .properties files have a different synt...
...iles to see more detail, including the exact list of missing (green "+" icon), obsolete and translated (white circle icon) entities. now that you've translated these 3 strings, let's commit your work to the local hg repository that you created in the "creating a new project" section. committing your work hopefully by now, you have translated 3 strings in the following 2 files: searchbar.dtd:
cmd_enginemanager.label searchendcap.label search.properties:
cmd_addfoundengine it's time to put these files under mercurial's version control system. this will allow you to track changes, export them to remote repositories (first on bitbucket, later on hg.mozilla.org) and revert files to earlier versions in case of errors. version control systems add a lot of transparency to your work and ...
...tutorial, we will switch to the command line every now and then to see what koala does behind the scenes. normally though, you don't have to use the command line to commit your work. assuming that your locale files are in c:\mozilla\l10n\locale\x-testing\3.6 which is where the local mercurial repository was created (see creating a new project section), you should be able to successfully issue "hg
cmd" commands in that directory (where "
cmd" might be "status", "log", "commit" etc.). for example, try issuing "hg status" inside c:\mozilla\l10n\locale\x-testing\3.6: c:\mozilla\l10n\locale\x-testing\3.6> hg status ? browser\chrome\browser\search.properties ? browser\chrome\browser\searchbar.dtd the question marks ("?") in front of the file names indicate that the files are not tracked by mercuri...
Localizing with Mercurial
ou've installed mercurial, we'll walk through the steps to configure it. mercurial on linux you can easily install mercurial from the command line by issuing one of the following commands. choose the appropriate command for your distribution and make sure to run as root. ...
...t-get install mercurial # fedora $ yum install mercurial # gentoo $ emerge mercurial # arch linux $ pa
cman -s mercurial # opensolaris $ pkg install sunwmercurial if you prefer a graphical interface, you can download and install mercurialeclipse here. did it work? open a terminal window and enter hg --version. if you see a message about the version of mercurial (e.g. mercurial distributed s
cm (version 1.3.1)), you have installed mercurial successfully! more details for more details on installing hg on linux systems, refer to the instructions on mercurial's download page. mercurial on windows with windows, you have a couple of install options: for a command line interface, download and install mozillabuild package. this will not only install hg, but also all the tools required t...
...en updated correctly." alternatively, you can edit the %path% variable manually. in order to do so, right-click on your computer icon, choose properties > advanced > environmental variables, select path and click edit. if you don't see path among the options, you'll have to click add and edit it within the add dialog. see the screenshot for an example. did it work? go to start > run... type
cmd.exe and click ok. a new shell window should appear. type hg --version in the new shell window. if you see a message about the version of mercurial (e.g. mercurial distributed s
cm (version 1.3.1)), you have installed mercurial successfully! more details for more details on installing hg on windows, refer to the instructions on mercurial's download page. mercurial on mac osx installing hg o...
...t install mercurial you can also install it by downloading the dmg package from the hg download page. it has an install dialog that will walk you through the process. if you prefer a graphical interface, you can download and install mercurialeclipse here. did it work? open a terminal window and type hg --version. if you see a message about the version of mercurial (e.g. mercurial distributed s
cm (version 1.3.1)), you have installed mercurial successfully! more details for more details on installing hg on mac osx, refer to the instructions on mercurial's download page. configuring mercurial once you've installed mercurial, you'll need to configure it before you can use it successfully. your mercurial configuration is contained within a config file which you must create yourself. your...
Localizing without a specialized tool
l10n.ini l10n-mozilla-1.9.2 x-testing > ~/desktop/x-testing.compare open the x-testing.compare file that is on your desktop. ...
... > ~/desktop/x-testing.compare open the x-testing.compare file that is on your desktop. you should see something like this: x-testing browser chrome browser aboutcerterror.dtd // add and localize this file aboutdialog.dtd +aboutlink +aboutlink.accesskey +aboutversion +close
cmdgnome.accesskey +close
cmdgnome.label +copyright +copyright.accesskey +copyrightgnome.accesskey +copyrightinfo1 +copyrightinfo2 +licenselink +licenselinktext aboutprivatebrowsing.dtd // add and localize this file aboutrobots.dtd // add and localize this file ... ... ... x-test...
...cp mozilla-1.9.2/browser/locales/chrome/browser/searchbar.dtd l10n-mozilla-1.9.2/x-testing/browser/chrome/browser/ open the file in your x-testing directory and translate the words inside the quotation marks. be sure to only translate what is in the quotation marks. for the purposes of this tutorial, we will just convert all letters to uppercase, so that the change is visible in the ui. <!entity
cmd_enginemanager.label "manage search engines..."> <!entity searchendcap.label "search"> save the file. .properties files the property file "search.properties" contains the string "add %s". this string can easily be found in the browser ui by visiting a website that provides a search plugin (like http://developer.mozilla.org/) and clicking on the drop-down arrow in the search b...
...check the path by typing pwd once you are in the root working directory with both en-us source and the l10n base, copy the searchbar.dtd file by typing cp mozilla-1.9.2/browser/locales/chrome/browser/search.properties l10n-mozilla-1.9.2/x-testing/browser/chrome/browser/ open that file and translate the strings that follow the "=". for instance, enter the proper translation for the line "add %s"
cmd_addfoundengine=add "%s" with these two string examples translated, you can now test your work to see immediately where you have translated. refer to the building and testing section of the create a new localization page. going one-by-one with your compare-locales output open for review, we will start with the first file with "// add and localize this file" note. you should see // add and loca...
An overview of NSS Internals
rtion of your own certificates, the certificates of peers or cas, and a list of trust decisions (such as to not trust a built-in ca, or to explicitly trust other cas). examples for the database files are key3.db and cert8.db, where the numbers are file version numbers. a third file contains the list of external pkcs#11 modules that have been registered to be used by nss. the file could be named se
cmod.db, but in newer database generations a file named pkcs11.txt is used. only nss is allowed to access and manipulate these database files directly; a programmer using nss must go through the apis offered by nss to manipulate the data stored in these files. the programmer's task is to initialize nss with the required parameters (such as a database), and nss will then transparently manage the d...
...time if data elements are still being referenced. in addition to the freebl, softoken, and ckbi modules, there is an utility library for general operations (e.g., encoding/decoding between data formats, a list of standardized object identifiers (oid)). nss has an ssl/tls module that implements the secure sockets layer/transport layer security network protocols, an s/mime module that implements
cms messaging used by secure email and some instant messaging implementations, a dbm library that implements the classic database storage, and finally a core nss library for the big set of “everything else”. newer generations of the database use the sqlite database to allow concurrent access by multiple applications. all of the above are provided as shared libraries. the crmf library, which i...
...e sqlite database to allow concurrent access by multiple applications. all of the above are provided as shared libraries. the crmf library, which is used to produce certain kinds of certificate requests, is available as a library for static linking only. when dealing with certificates (x.509), file formats such as pkcs#12 (certificates and keys), pkcs#7 (signed data), and message formats as
cms, we should mention asn.1, which is a syntax for storing structured data in a very efficient (small sized) presentation. it was originally developed for telecommunication systems at times where it was critical to minimize data as much as possible (although it still makes sense to use that principle today for good performance). in order to process data available in the asn.1 format, the usual appr...
... free the resources. this line is a placeholder for future sections that should explain how libpkix works and is designed. if you want to work with nss, it's often helpful to use the command line utilities that are provided by the nss developers. there are tools for managing nss databases, for dumping or verifying certificates, for registering pkcs#11 modules with a database, for processing
cms encrypted/signed messages, etc. for example, if you wanted to create your own pair of keys and request a new certificate from a ca, you could use certutil to create an empty database, then use certutil to operate on your database and create a certificate request (which involves creating the desired key pair) and export it to a file, submit the request file to the ca, receive the file from the...
Encrypt Decrypt MAC Keys As Session Objects
tf(pr_stderr, "write error\n"); rv = secfailure; break; } /* save last block of ciphertext */ memcpy(iv, decbuf, decbuflen); ivlen = decbuflen; blocknumber++; } if (rv != secsuccess) { goto cleanup; } rv = macfinal(ctxmac, newmac, &newmaclen, sizeof(newmac)); if (rv != secsuccess) { goto cleanup; } if (port_mem
cmp(macitem->data, newmac, newmaclen) == 0) { rv = secsuccess; } else { pr_fprintf(pr_stderr, "check mac : failure\n"); pr_fprintf(pr_stderr, "extracted : "); printashex(pr_stderr, macitem->data, macitem->len); pr_fprintf(pr_stderr, "computed : "); printashex(pr_stderr, newmac, newmaclen); rv = secfailure; } cleanup: if (ctxmac) { ...
...*argv) { secstatus rv; secstatus rvshutdown; pk11slotinfo *slot = null; ploptstate *optstate; ploptstatus status; char headerfilename[50]; char encryptedfilename[50]; prfiledesc *infile; prfiledesc *outfile; prbool ascii = pr_false; commandtype
cmd = unknown; const char *command = null; const char *dbdir = null; const char *infilename = null; const char *outfilename = null; const char *noisefilename = null; secupwdata pwdata = { pw_none, 0 }; char * progname = strrchr(argv[0], '/'); progname = prog...
... */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", infilename); return secfailure; } pr_close(infile); /* for intermediate header file, choose filename as inputfile na...
...ose filename as inputfile name with extension ".header" */ strcpy(headerfilename, infilename); strcat(headerfilename, ".header"); /* for intermediate encrypted file, choose filename as inputfile name with extension ".enc" */ strcpy(encryptedfilename, infilename); strcat(encryptedfilename, ".enc"); pr_init(pr_user_thread, pr_priority_normal, 0); switch (
cmd) { case encrypt: /* if the intermediate header file already exists, delete it */ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } /* if the intermediate encrypted already exists, delete it */ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilen...
Encrypt and decrypt MAC using token
tf(pr_stderr, "write error\n"); rv = secfailure; break; } /* save last block of ciphertext */ memcpy(iv, decbuf, decbuflen); ivlen = decbuflen; blocknumber++; } if (rv != secsuccess) { goto cleanup; } rv = macfinal(ctxmac, newmac, &newmaclen, sizeof(newmac)); if (rv != secsuccess) { goto cleanup; } if (port_mem
cmp(macitem->data, newmac, newmaclen) == 0) { rv = secsuccess; } else { pr_fprintf(pr_stderr, "check mac : failure\n"); pr_fprintf(pr_stderr, "extracted : "); printashex(pr_stderr, macitem->data, macitem->len); pr_fprintf(pr_stderr, "computed : "); printashex(pr_stderr, newmac, newmaclen); rv = secfailure; } cleanup: if (ctxmac) { ...
...*argv) { secstatus rv; secstatus rvshutdown; pk11slotinfo *slot = null; ploptstate *optstate; ploptstatus status; char headerfilename[50]; char encryptedfilename[50]; prfiledesc *infile; prfiledesc *outfile; prbool ascii = pr_false; commandtype
cmd = unknown; const char *command = null; const char *dbdir = null; const char *infilename = null; const char *outfilename = null; const char *noisefilename = null; secupwdata pwdata = { pw_none, 0 }; char * progname = strrchr(argv[0], '/'); progname = prog...
... */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", infilename); return secfailure; } pr_close(infile); /* for intermediate header file, choose filename as inputfile na...
...ose filename as inputfile name with extension ".header" */ strcpy(headerfilename, infilename); strcat(headerfilename, ".header"); /* for intermediate encrypted file, choose filename as inputfile name with extension ".enc" */ strcpy(encryptedfilename, infilename); strcat(encryptedfilename, ".enc"); pr_init(pr_user_thread, pr_priority_normal, 0); switch (
cmd) { case encrypt: /* if the intermediate header file already exists, delete it */ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } /* if the intermediate encrypted already exists, delete it */ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilen...
NSS 3.21 release notes
in ssl.h ssl_getpreliminary...
... in ssl.h ssl_getpreliminarychannelinfo - o...
... in ssl.h ssl_getpreliminarychannelinfo - obtains information about a tls channe...
... nss_optionset - sets nss global options nss_optionget - gets the current value of nss global options in se
cmod.h se
cmod_createmoduleex - create a new se
cmodmodule structure from module name string, module parameters string, nss specific parameters string, and nss configuration parameter string. the module represented by the module structure is not loaded. the difference with se
cmod_createmodule is the new function handles nss configuration parameter strings. in ssl.h ssl_getpreliminarychannelinfo - obtains information about a tls channel prior to the handshake being completed, for use with the callbacks that are invoked during the handshake ssl_signatureprefset - configures the enabled signature and hash algorithms for tls ssl_signatureprefget - retrieve...
NSS 3.41 release notes
re available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_41_rtm/src/ new in nss 3.41 new functionality bug 1252891 - implemented eku handling for ipsec ike. bug 1423043 - enable half-closed states for tls. ...
...re https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_41_rtm/src/ new in nss 3.41 new functionality bug 1252891 - implemented eku handling for ipsec ike. bug 1423043 - enable half-closed states for tls. ...
... https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_41_rtm/src/ new in nss 3.41 new functionality bug 1252891 - implemented eku handling for ipsec ike. bug 1423043 - enable half-closed states for tls. ...
...lla.org/security/nss/releases/nss_3_41_rtm/src/ new in nss 3.41 new functionality bug 1252891 - implemented eku handling for ipsec ike. bug 1423043 - enable half-closed states for tls. ...
NSS 3.47 release notes
early december: tls 1.3 will be the default maximum tls version. see bug 1573118 for details. tls extended master secret will be enabled by default, where possible. see bug 1575411 for details. ...
...asting to mechanism-specific structs bug 1577953 - support longer (up to rfc maximum) hkdf outputs bug 1508776 - remove refcounting from sftk_freesession (cve-2019-11756) bug 1494063 - support tls exporter in tstclnt and selfserv bug 1581024 - heap overflow in nss utility "derdump" bug 1582343 - soft token mac verification not constant time bug 1578238 - handle invald tag sizes for ckm_aes_g
cm bug 1576295 - check all bounds when encrypting with seed_cbc bug 1580286 - nss rejects tls 1.2 records with large padding with sha384 hmac bug 1577448 - create additional nested s/mime test messages for thunderbird bug 1399095 - allow nss-try to be used to test nspr changes bug 1267894 - libssl should allow selecting the order of cipher suites in clienthello bug 1581507 - fix unportable gre...
... bug 1542207 - limit policy check on signature algorithms to known algorithms bug 1560329 - drbg: add continuous self-test on entropy source bug 1579290 - asan builds s...
...d disable lsan while building bug 1385061 - build nspr tests with nss make; add gyp parameters to build/run nspr tests bug 1577359 - build atob and btoa for thunderbird bug 1579036 - confusing error when trying to export non-existent cert with pk12util bug 1578626 - [cid 1453375] ub: decrement nullptr. bug 1578751 - ensure a consistent style for pk11_find_certs_unittest.cc bug 1570501 - add
cmac to freebl and pkcs #11 libraries bug 657379 - nss uses the wrong oid for signaturealgorithm field of signerinfo in
cms for dsa and ecdsa bug 1576664 - remove -mms-bitfields from mingw nss build. bug 1577038 - add pk11_getcertsfromprivatekey to return all certificates with public keys matching a particular private key this bugzilla query returns all the bugs fixed in nss 3.47: https://bugz...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
e a cert in cert db and also used to input, store and trust ca cert. * 3. like sample 5, but puts cert in header * 4. ...
...e 'g': /* generate a csr */ case 'a': /* add cert to database */ case 'h': /* save cert to the header file */ case 'e': /* encrypt with public key from cert in header file */ case 's': /* sign with private key */ case 'd': /* decrypt with the matching private key */ case 'v': /* verify with the matching public key */
cmd = option2command(optstate->option); break; case 'd': dbdir = strdup(optstate->value); break; case 'f': pwdata.source = pw_fromfile; pwdata.data = strdup(optstate->value); break; case 'p': pwdata.source = pw_plaintext; pwdata.data = strdup(optstate->value); ...
...mberstr = strdup(optstate->value); serialnumber = atoi(serialnumberstr); break; case 't': truststr = strdup(optstate->value); break; case 'v': sigverify = pr_true; break; default: usage(progname); break; } } pl_destroyoptstate(optstate); if (
cmd == unknown || !dbdir) usage(progname); /* open db for read/write and authenticate to it */ pr_init(pr_user_thread, pr_priority_normal, 0); initialized = pr_true; rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot...
... } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } switch (
cmd) { case generate_csr: validategeneratecsrcommand(progname, dbdir, subject, subjectstr, certreqfilename); /* generate a csr */ rv = createcertrequest(slot, &pwdata, subject, certreqfilename, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "create certificate request: fai...
Encrypt Decrypt_MAC_Using Token
f(pr_stderr, "write error\n"); rv = secfailure; break; } /* save last block of ciphertext. ...
...*argv) { secstatus rv; secstatus rvshutdown; pk11slotinfo *slot = null; ploptstate *optstate; ploptstatus status; char headerfilename[50]; char encryptedfilename[50]; prfiledesc *infile; prfiledesc *outfile; prbool ascii = pr_false; commandtype
cmd = unknown; const char *command = null; const char *dbdir = null; const char *infilename = null; const char *outfilename = null; const char *noisefilename = null; secupwdata pwdata = { pw_none, 0 }; char * progname = strrchr(argv[0], '/'); progname = prog...
... */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", infilename); return secfailure; } pr_close(infile); /* for intermediate header file, choose filename as inputfile na...
...*/ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } /* if the intermediate encrypted already exists, delete it. */ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfil...
NSS Sample Code Sample_3_Basic Encryption and MACing
tf(pr_stderr, "write error\n"); rv = secfailure; break; } /* save last block of ciphertext */ memcpy(iv, decbuf, decbuflen); ivlen = decbuflen; blocknumber++; } if (rv != secsuccess) { goto cleanup; } rv = macfinal(ctxmac, newmac, &newmaclen, sizeof(newmac)); if (rv != secsuccess) { goto cleanup; } if (port_mem
cmp(macitem->data, newmac, newmaclen) == 0) { rv = secsuccess; } else { pr_fprintf(pr_stderr, "check mac : failure\n"); pr_fprintf(pr_stderr, "extracted : "); printashex(pr_stderr, macitem->data, macitem->len); pr_fprintf(pr_stderr, "computed : "); printashex(pr_stderr, newmac, newmaclen); rv = secfailure; } cleanup: if (ctxmac) { ...
...*argv) { secstatus rv; secstatus rvshutdown; pk11slotinfo *slot = null; ploptstate *optstate; ploptstatus status; char headerfilename[50]; char encryptedfilename[50]; prfiledesc *infile; prfiledesc *outfile; prbool ascii = pr_false; commandtype
cmd = unknown; const char *command = null; const char *dbdir = null; const char *infilename = null; const char *outfilename = null; const char *noisefilename = null; secupwdata pwdata = { pw_none, 0 }; char * progname = strrchr(argv[0], '/'); progname = prog...
... */ infile = pr_open(infilename, pr_rdonly, 0); if (!infile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for reading.\n", infilename); return secfailure; } pr_close(infile); /* for intermediate header file, choose filename as inputfile na...
...ose filename as inputfile name with extension ".header" */ strcpy(headerfilename, infilename); strcat(headerfilename, ".header"); /* for intermediate encrypted file, choose filename as inputfile name with extension ".enc" */ strcpy(encryptedfilename, infilename); strcat(encryptedfilename, ".enc"); pr_init(pr_user_thread, pr_priority_normal, 0); switch (
cmd) { case encrypt: /* if the intermediate header file already exists, delete it */ if (pr_access(headerfilename, pr_access_exists) == pr_success) { pr_delete(headerfilename); } /* if the intermediate encrypted already exists, delete it */ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilena...
nss tech note5
ac include headers #include "nss.h" #include "pk11pub.h" make sure nss is initialized.the simplest init function, in case you don't need a nss database is nss_nodb_init(".") choose a hmac mechanism. ...
...don't need a nss database is nss_nodb_init(".") choose a hmac mechanism. ...
...can use ckm_generic_secret_key_gen as the key gen mechanism. <big>prepare the parameter for crypto context. the param must be provided, but can be empty. secite...
...section generate a symmetric key. can use ckm_generic_secret_key_gen as the key gen mechanism. <big>prepare the parameter for crypto context. the param must be provided, but can be empty. ...
FC_Initialize
uld have the following values: createmutex should be null. destroymutex should be null. lockmutex should be null. unlockmutex should be null. flags should be ckf_os_locking_ok. libraryparameters should point to a string that contains the library parameters. preserved should be null. ...
...ags should be ckf_os_locking_ok. libraryparameters should point to a string that contains the library parameters. preserved should be null. the library parameters string has this format: "configdir='dir' certprefix='prefix1' keyprefix='prefix2' se
cmod='file' flags= " here are some examples. ...
...gs= " here are some examples. ...
...ere are some examples. ...
Utility functions
3.2 and later seckey_destroyencryptedprivatekeyinfo mxr 3.2 and later seckey_destroyprivatekeyinfo mxr 3.2 and later seckey_destroypublickey mxr 3.2 and later seckey_publickeystrength mxr 3.2 and later seckey_updatecertpqg mxr 3.2 and later se
cmod_addnewmodule mxr 3.3 and later se
cmod_addnewmoduleex mxr 3.4 and later se
cmod_deletemoduleex mxr 3.12 and later se
cmod_cancelwait mxr 3.9.3 and later se
cmod_candeleteinternalmodule mxr 3.5 and later se
cmod_createmodule mxr 3.4 and later ...
...odule mxr 3.3 and later se
cmod_addnewmoduleex mxr 3.4 and later se
cmod_deletemoduleex mxr 3.12 and later se
cmod_cancelwait mxr 3.9.3 and later se
cmod_candeleteinternalmodule mxr 3.5 and later se
cmod_createmodule mxr 3.4 and later se
cmod_deletemodule mxr 3.4 and later se
cmod_findmodule mxr 3.4 and later se
cmod_findslot mxr 3.4 and later se
cmod_freemodulespeclist mxr 3.4 and later se
cmod_getdbmodulelist mxr 3.9 and later se
cmod_getdeadmodulelist mxr 3.9 and later ...
..._deletemodule mxr 3.4 and later se
cmod_findmodule mxr 3.4 and later se
cmod_findslot mxr 3.4 and later se
cmod_freemodulespeclist mxr 3.4 and later se
cmod_getdbmodulelist mxr 3.9 and later se
cmod_getdeadmodulelist mxr 3.9 and later se
cmod_getmodulespeclist mxr 3.4 and later se
cmod_hasremovableslots mxr 3.9.3 and later se
cmod_ismodulepresent mxr 3.2 and later se
cmod_loadmodule mxr 3.4 and later se
cmod_loadusermodule mxr 3.4 and later se
cmod_lookupslot mxr 3.2 and later ...
...odulespeclist mxr 3.4 and later se
cmod_hasremovableslots mxr 3.9.3 and later se
cmod_ismodulepresent mxr 3.2 and later se
cmod_loadmodule mxr 3.4 and later se
cmod_loadusermodule mxr 3.4 and later se
cmod_lookupslot mxr 3.2 and later se
cmod_pubcipherflagstointernal mxr 3.4 and later se
cmod_pubmechflagstointernal mxr 3.4 and later se
cmod_unloadusermodule mxr 3.4 and later se
cmod_updatemodule mxr 3.4 and later se
cmod_updateslotlist mxr 3.9.3 and later se
cmod_waitforanytokenevent mxr ...
Rhino overview
bjects or methods for manipulating html documents. rhino contains all the features of javascript 1.7 allows direct scripting of java a javascript shell for executing javascript scripts a javascript compiler to transform javascript source files into java class files a javascript debugger for scripts executed with rhino language the javascript language itself is standardized by standard e
cma-262 e
cmascript: a general purpose, cross-platform programming language. rhino 1.3 and greater conform to edition 3 of the standard. rhino 1.6 and greater implement e
cma-357 e
cmascript for xml (e4x). see the specification for more information on the standard, and rhino version 1.6r1 release notes for details on the implementation in rhino. in addition, rhino has implemented javaadapters, which ...
...perties. if other properties files with extensions corresponding to the current locale exist, they will be used instead. javascript language versions some behavior in the javascript engine is dependent on the language version. in browser embeddings, this language version is selected using the language attribute of the script tag with values such as "javascript1.2". version 1.3 and greater are e
cma conformant. operators == and != version 1.2 only uses strict equality for the == and != operators. in version 1.3 and greater, == and != have the same meanings as e
cma. the operators === and !== use strict equality in all versions. toboolean boolean(new boolean(false)) is false for all versions before 1.3. it is true (and thus e
cma conformant) for version 1.3 and greater. array.prototype.to...
...ators === and !== use strict equality in all versions. toboolean boolean(new boolean(false)) is false for all versions before 1.3. it is true (and thus e
cma conformant) for version 1.3 and greater. array.prototype.tostring and object.prototype.tostring version 1.2 only returns array or object literal notation ("[1]" or "{a:1, b:2}" for example). in version 1.3 and greater these functions are e
cma conformant. array constructor array(i) for a number argument i constructs an array with a single element equal to i for version 1.2 only. otherwise the e
cma conformant version is used (an array is constructed with no elements but with length property equal to i). string.prototype.substring for version 1.2 only, the two arguments are not swapped if the first argument is less than the second o...
...ctor array(i) for a number argument i constructs an array with a single element equal to i for version 1.2 only. otherwise the e
cma conformant version is used (an array is constructed with no elements but with length property equal to i). string.prototype.substring for version 1.2 only, the two arguments are not swapped if the first argument is less than the second one. all other versions are e
cma compliant. string.prototype.split for version 1.2 only, split performs the perl4 special case when given a single space character as an argument (skips leading whitespace, and splits on whitespace). all other versions split on the space character proper as specified by e
cma. security the security features in rhino provide the ability to track the origin of a piece of code (and any pieces of ...
JSClass.flags
the slots initially contain unspecified valid jsval values. they can be accessed using js_getreservedslot and js_setreservedslot. (the jsclass.reserveslots hook also allocates reserved slots to objects.) mxr id search for jsclass_has_reserved_slots jsclass_global_flags this flag is only relevant for the class of an object that is used as a global object. (e
cmascript specifies a single global object, but in spidermonkey the global object is the last object in the scope chain, which can be different objects at different times. this is actually quite subtle. js_executescript and similar apis set the global object for the code they execute. js_setglobalobject sets an object which is sometimes used as the global object, as a last resort.) enable stand...
...pt specifies a single global object, but in spidermonkey the global object is the last object in the scope chain, which can be different objects at different times. this is actually quite subtle. js_executescript and similar apis set the global object for the code they execute. ...
... mxr id search for jsclass_global_flags jsclass_foreground_finalize objects of this class must be finalized on the main thread. ...
...s, such as function objects. if the global object does not have this flag, then scripts may cause nonstandard behavior by replacing standard constructors or prototypes (such as function.prototype.) objects that can end up with the wrong prototype object, if this flag is not present, include: arguments objects (e
cma 262-3 §10.1.8 specifies "the original object prototype"), function objects (e
cma 262-3 §13.2 specifies "the original function prototype"), and objects created by many standard constructors (e
cma 262-3 §15.4.2.1 and others). mxr id search for jsclass_global_flags jsclass_foreground_finalize objects of this class must be finalized on the main thread. if this class has a finalizer that makes use of state shared with the main thread then this op...
JS_ConvertArguments
in for conversion. argv is a pointer to the array of js values to convert. format is a null-terminated c string. each element of the array indicates the c type into which to convert the next available js value. ...
...lues to convert. format is a null-terminated c string. each element of the array indicates the c type into which to convert the next available js value. ...
...minated c string. each element of the array indicates the c type into which to convert the next available js value. ...
...js value. ...
JS_SetOptions
ion jsoption_extra_warnings warn on dubious practice. mxr id search for jsoption_extra_warnings jsoption_werror convert warnings to errors. mxr id search for jsoption_werror jsoption_varobjfix make js_evaluatescript() use the last object on its obj param's scope chain (that is, the global object) as the e
cma "variables object". this flag is recommended. without it, the two scripts "x = 1" and "var x = 1", where no variable x is in scope, do two different things. the former creates a property on the global object. the latter creates a property on obj. with this flag, both create a global property. mxr id search for jsoption_varobjfix jsoption_private_is_nsisupports ...
...pilation and execution. this enables compile-time scope chain resolution of consts (a performance optimization). mxr id search for jsoption_compile_n_go jsoption_atline //@line number ["filename"] option supported for the xul preprocessor and kindred beasts. mxr id search for jsoption_atline jsoption_xml obsolete since jsapi 15 e
cmascript for xml (e4x) support: parse <!-- --> as a token, not backward compatible with the comment-hiding hack used in html script tags. mxr id search for jsoption_xml jsoption_allow_xml added in spidermonkey 15 if this is off, e4x syntax isn't supported no matter what version number is set. mxr id search for jsoption_allow_xml jsoption_moar_xml ad...
...pport: parse <!-- --> as a token, not backward compatible with the comment-hiding hack used in html script tags. mxr id search for jsoption_xml jsoption_allow_xml added in spidermonkey 15 if this is off, e4x syntax isn't supported no matter what version number is set. mxr id search for jsoption_allow_xml jsoption_moar_xml added in spidermonkey 15 e
cmascript for xml (e4x) support: parse <!-- --> as a token, not backward compatible with the comment-hiding hack used in html script tags. only used if jsoption_allow_xml is set. mxr id search for jsoption_moar_xml jsoption_native_branch_callback the branch callback set by js_setbranchcallback may be called with a null script parameter, by native code that loops inten...
... mxr id search for jsoption_dont_report_uncaught jsoption_relimit added in spidermonkey 1.8 throw an exception if a regular expression backtracks more than n3 times, where n is the length of the input string. mxr id search for jsoption_relimit jsoption_anonfunfix added in spidermonkey 1.8 disallow function () {} in statement context, per e
cma-262 edition 3. this behavior is the default in releases where this option has been removed. mxr id search for jsoption_anonfunfix jsoption_jit obsolete since jsapi 11 added in spidermonkey 1.8.1 enables the jit compilation of code in the context. note that you may currently (jan 2009) experience bugs with this option enabled. mxr id search for jsoption_jit ...
nsIDOMEvent
a type for all events in the document object model. inherits from: nsisupports last changed in gecko 16.0 (firefox 16.0 / thunderbird 16.0 / seamonkey 2.13) note: as of gecko 16.0, the nsiprivatedomevent interface was merged into this interface. everything marked as gecko 16.0 was previously available in that interface. see bug 761613. ...
... void settrusted(in boolean atrusted); native code only! void stopimmediatepropagation(); void stoppropagation(); attributes attribute type description bubbles boolean ...
... violates the xpcom interface guidelines getinternalnsevent() nseventptr getinternalnsevent(); parameters none. return value getpreventdefault() note: use the defaultprevented attribute instead. this...
...ociated with the event will not occur. calling this method for a non-cancelable event has no effect. once preventdefault has been called it will remain in effect throughout the remainder of the event's propagation. this method may be used during any stage of event flow. void preventdefault(); parameters none. ...
nsIFrameMessageManager
this interface is obsolete and was removed in firefox 17. you should use nsimessagelistenermanager or nsimessagesender instead. method overview void addmessagelistener(in astring amessage, in nsiframemessagelistener alistener, [optional] in boolean listenwhenclosed); void removemessagelistener(in astring amessage, in nsiframemessagelistener alistener); void sendasyn
cmessage(in astring amessage, in astring json); methods addmessagelistener() adds a message listener to the local frame. this listener will receive messages sent from the remote frame. void addmessagelistener( in astring amessage, in nsiframemessagelistener alistener [optional in boolean listenwhenclosed ); parameters amessage the name of the message for which to add a listener...
...ns :: message manager. removemessagelistener() removes a message listener previously added by calling addmessagelistener(). void removemessagelistener( in astring amessage, in nsiframemessagelistener alistener ); parameters amessage the name of the message for which to remove a listener. alistener an object implementing nsiframemessagelistener to stop receiving messages. ...
...r previously added by calling addmessagelistener(). void removemessagelistener( in astring amessage, in nsiframemessagelistener alistener ); parameters amessage the name of the message for which to remove a listener. alistener an object implementing nsiframemessagelistener to stop receiving messages. sendasyn
cmessage() asynchronously sends a message to the listeners. ...
...to stop receiving messages. sendasyn
cmessage() asynchronously sends a message to the listeners. void sendasyn
cmessage( in astring amessage, in astring json ); parameters amessage the name of the message to send to the listeners. json optional a json object containing data to be delivered to the listeners. ...
Web console keyboard shortcuts - Firefox Developer Tools
command windows macos linux scroll to start of console output (only if the c...
... command windows macos linux scroll to start of console output (only if the c...
...windows macos linux open the web console ctrl + shift + k
cmd + opt + k ctrl + shift + k search in the message display pane ctrl + f
cmd + f ctrl + f open the object inspector pane ctrl + click ctrl + click ctrl + click clear the object inspector pane esc esc esc focus on the command line ctrl + shift + k
cmd + opt + k ctrl + shift + k clear output ctrl + shift + l ctrl + l from firefox 67:
cmd + k ctrl + shift + l command line interpreter these shortcuts apply when you're in the command line interpreter. command windows macos linux scroll to start of console output (only if the command line is empty) hom...
...ugh autocomplete suggestions page down page down page down scroll to start of autocomplete suggestions home home home scroll to end of autocomplete suggestions end end end global shortcuts these shortcuts work in all tools that are hosted in the toolbox. command windows macos linux increase font size ctrl + +
cmd + + ctrl + + decrease font size ctrl + -
cmd + - ctrl + - reset font size ctrl + 0
cmd + 0 ctrl + 0 ...
SubtleCrypto.decrypt() - Web APIs
hm, key, data); parameters algorithm is an object specifying the algorithm to be used, and any extra parameters as required. the values given for the extra parameters must match those passed into the corresponding encrypt() call. to use rsa-oaep, pass an rsaoaepparams object. to use aes-ctr, pass an aesctrparams object. to use aes-cbc, pass an aescbcparams object. to use aes-g
cm, pass an aesg
cmparams object. key is a cryptokey containing the key to be used for decryption. if using rsa-oaep, this is the privatekey property of the cryptokeypair object. data is a buffersource containing the data to be decrypted (also known as ciphertext). return value result is a promise that fulfills with an arraybuffer containing the plaintext. exceptions the promise is rej...
... counter, length: 64 }, key, ciphertext ); } aes-cbc this code decrypts ciphertext using aes in cbc mode. note that iv must match the value that was used for encryption. see the complete code on github. ...
... ciphertext ); } aes-cbc this code decrypts ciphertext using aes in cbc mode. note that iv must match the value that was used for encryption. see the complete code on github. function decryptmessage(key, ciphertext) { return window.crypto.subtle.decrypt( { name: "aes-cbc", iv: iv }, key, ciphertext ); } aes-g
cm this code decrypts ciphertext using aes in g
cm mode. ...
...ciphertext) { return window.crypto.subtle.decrypt( { name: "aes-cbc", iv: iv }, key, ciphertext ); } aes-g
cm this code decrypts ciphertext using aes in g
cm mode. note that iv must match the value that was used for encryption. see the complete code on github. function decryptmessage(key, ciphertext) { return window.crypto.subtle.decrypt( { name: "aes-g
cm", iv: iv }, key, ciphertext ); } specifications specification status comment web cryptography apithe definition of 'subtlecrypto.decrypt()' in that specification. recommendation initial definition. ...
SubtleCrypto.deriveKey() - Web APIs
m is ecdh, then this will be the ecdh private key. otherwise it will be the initial key material for the derivation function: for example, for pbkdf2 it might be a password, imported as a cryptokey using subtlecrypto.importkey(). derivedkeyalgorithm is an object defining the algorithm the derived key will be used for. for hmac: pass an hmackeygenparams object. for aes-ctr, aes-cbc, aes-g
cm, or aes-kw: pass an aeskeygenparams object. extractable is a boolean indicating whether it will be possible to export the key using subtlecrypto.exportkey() or subtlecrypto.wrapkey(). keyusages is an array indicating what can be done with the derived key. note that the key usages must be allowed by the algorithm set in derivedkeyalgorithm. possible values of the array are: encrypt:...
...ys. they then use derivekey() to derive a shared aes key, that they could use to encrypt messages. see the complete code on github. ...
... recommendation initial definition. ...
... recommendation initial definition. ...
TypeError: invalid Array.prototype.sort argument - JavaScript
r undefined or a function which compares its operands. ...
...ror: argument is not a function object (edge) typeerror: invalid array.prototype.sort argument (firefox) error type typeerror what went wrong? the argument of array.prototype.sort() is expected to be either undefined or a function which compares its operands. ...
...t (firefox) error type typeerror what went wrong? the argument of array.prototype.sort() is expected to be either undefined or a function which compares its operands. ...
...array.prototype.sort() is expected to be either undefined or a function which compares its operands. ...
Arrow function expressions - JavaScript
// the person() constructor defines `this` as an instance of itself. this.age = 0; setinterval(function growup() { // in non-strict mode, the growup() function defines `this` // as the global object (because it's where growup() is executed.), // which is different from the `this` // defined by the person() constructor. this.age++; }, 1000); } var p = new person(); in e
cmascript 3/5, the this issue was fixable by assigning the value in this to a variable that could be closed over. function person() { var that = this; that.age = 0; setinterval(function growup() { // the callback refers to the `that` variable of which // the value is the expected object. that.age++; }, 1000); } alternatively, a bound function could be created so that a preassi...
...anonymous>:1:1 f2 @ vm51712:1 (anonymous) @ vm51800:1 > f3 = x => (z1 = x + 1) x => (z1 = x + 1) > z1 vm51891:1 uncaught referenceerror: z1 is not defined at <anonymous>:1:1 (anonymous) @ vm51891:1 > f3(10) 11 > z1 11 f2 illustrates that when explicitly setting the arrow function to apply strict mode, it does throw an error when attempting to assign an undeclared variable. https://www.e
cma-international.org/e
cma-262/10.0/index.html#sec-strict-mode-code https://www.e
cma-international.org/e
cma-262/10.0/index.html#sec-arrow-function-definitions-runtime-semantics-evaluation correction: end invoked through call or apply since arrow functions do not have their own this, the methods call() and apply() can only pass in parameters. any this argument is ignored. var adder = { base: 1...
... ...
...2); // [10, 12, 26, 0, 2, 36, 46] // more concise promise chains promise.then(a => { // ... }).then(b => { // ... }); // parameterless arrow functions that are visually easier to parse settimeout( () => { console.log('i happen sooner'); settimeout( () => { // deeper code console.log('i happen later'); }, 1); }, 1); specifications specification e
cmascript (e
cma-262)the definition of 'arrow function definitions' in that specification. ...
arguments.callee - JavaScript
nts.callee property contains the currently executing function. description callee is a property of the arguments object. it can be used to refer to the currently executing function inside the function body of that function. this is useful when the name of the function is unknown, such as within a function expression with no name (also called "anonymous functions"). warning: the 5th edition of e
cmascript (es5) forbids use of arguments.callee() in strict mode. avoid using arguments.callee() by either giving function expressions a name or use a function declaration where a function must call itself. why was arguments.callee removed from es5 strict mode? (adapted from a stack overflow answer by olliej) early versions of javascript did not allow named function expressions, and for this reas...
...for example: [1, 2, 3, 4, 5].map(function factorial(n) { return !(n > 1) ? 1 : factorial(n - 1)*n; }); this has numerous benefits: the function can be called like any other from inside your code it does not create a variable in the outer scope (except for ie 8 and below) it has better performance than accessing the ...
... ...
... ...
Array.prototype[@@unscopables] - JavaScript
the @@unscopable symbol property contains property names that were not included in the e
cmascript standard prior to the es2015 version. these properties are excluded from with statement bindings. description the default array properties that are excluded from with bindings are: copywithin() entries() fill() find() findindex() includes() keys() values() see symbol.unscopables for how to set unscopables for your own objects. ...
...x() includes() keys() values() see symbol.unscopables for how to set unscopables for your own objects. property attributes of array.prototype[@@unscopables] writable no enumerable no configurable yes examples use in with environments the following code works fine in es5 and below. however, in e
cmascript 2015 and later, the array.prototype.keys() method was introduced. that means that inside with environments, "keys" would now be the method and not the variable. this is where now the built-in @@unscopables array.prototype[@@unscopables] symbol property comes into play and prevents that some of the array methods are being scoped into the with statement. var keys = []; with (array.prototyp...
... ...
... ...
Array.prototype.reduce() - JavaScript
first call 10 0 0 [0, 1, 2, 3, 4] 10 second call 10 1 1 [0, 1, 2, 3, 4] 11 third call 11 2 2 [0, 1, 2, 3, 4] 13 fourth call 13 3 3 [0, 1, 2, 3, 4] 16 fifth call 16 4 4 [0, 1, 2, 3, 4] 20 the value returned by reduce() in this case would be 20. ...
... 3, 4] 11 third call 11 2 2 [0, 1, 2, 3, 4] 13 fourth call 13 3 3 [0, 1, 2, 3, 4] 16 fifth call 16 4 4 [0, 1, 2, 3, 4] 20 the value returned by reduce() in this case would be 20. ...
... ...
... ...
Array.prototype.reduceRight() - JavaScript
4 4 [0, 1, 2, 3, 4] 14 second call 14 3 3 [0, 1, 2, 3, 4] 17 third call 17 2 2 [0, 1, 2, 3, 4] 19 fourth call 19 1 1 [0, 1, 2, 3, 4] 20 fifth call 20 0 0 [0, 1, 2, 3, 4] 20 the value returned by reduceright this time would be, of course, 20. ...
...ned by reduceright this time would be, of course, 20. polyfill reduceright was added to the e
cma-262 standard in the 5th edition; as such it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of reduceright in implementations which do not natively support it. ...
... ...
... ...
Array.prototype.every() - JavaScript
sting elements of the array are changed, their value as passed to callback will be the value at the time every visits them. elements that are deleted are not visited. every acts like the "for all" quantifier in mathematics. in particular, for an empty array, it returns true. ...
...the empty set satisfy any given condition.) polyfill every was added to the e
cma-262 standard in the 5th edition, and it may not be present in other implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of every in implementations which do not natively support it. this algorithm is exactly the one specified in e
cma-262, 5th edition, assuming object and typeerror have their original values, and that callbackfn.call evaluates to the original value of function.prototype.call. if (!array.prototype.every) { array.prototype.every = function(callbackfn, thisarg) { 'use strict'; var t, k; if (this == null) { throw new typeerror('this is null or not defined'); } // 1. let o be the res...
... ...
... ...
Array.prototype.filter() - JavaScript
ilter() does not mutate the array on which it is called. the range of elements processed by filter() is set before the first invocation of callback. elements which are appended to the array (from callback) after the call to filter() begins will not be visited by callback. if existing elements of the array are deleted in the same way they will not be visited. ...
...() begins will not be visited by callback. if existing elements of the array are deleted in the same way they will not be visited. polyfill filter() was added to the e
cma-262 standard in the 5th edition. therefore, it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of filter() in e
cma-262 implementations which do not natively support it. this algorithm is exactly equivalent to the one specified in e
cma-262, 5th edition, assuming that fn.call evaluates to the original value of function.prototype.bind(), and that array.prototype.push() has its original value. if (!array.prototype.filter){ array.prototype.filter = function(func, thisarg) { 'use strict'; if ( ! ((typeo...
... ...
... ...
Array.from() - JavaScript
y would necessarily have values truncated to fit into the appropriate type. the length property of the from() method is 1. in es2015, the class syntax allows sub-classing of both built-in and user-defined classes. as a result, static methods such as array.from() are "inherited" by subclasses of array, and create new instances of the subclass, not array. ...
...ray. polyfill array.from() was added to the e
cma-262 standard in the 6th edition (es2015). as such, it may not be present in other implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of array.from() in implementations that don't natively support it. polyfill notes: this algorithm is exactly as specified in e
cma-262 6th edition (assuming object and typeerror have their original values and that callback.call() evaluates to the original value of function.prototype.call()). in addition, since true iterables cannot be polyfilled, this implementation does not support generic iterables as defined in the 6th edition of e
cma-262. ...
...ll notes: this algorithm is exactly as specified in e
cma-262 6th edition (assuming object and typeerror have their original values and that callback.call() evaluates to the original value of function.prototype.call()). in addition, since true iterables cannot be polyfilled, this implementation does not support generic iterables as defined in the 6th edition of e
cma-262. ...
...// [1, 3, 5, 7, 9] // generate the alphabet using array.from making use of it being ordered as a sequence range('a'.charcodeat(0), 'z'.charcodeat(0), 1).map(x => string.fromcharcode(x)); // ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"] specifications specification initial publication e
cmascript (e
cma-262)the definition of 'array.from' in that specification. e
cmascript 2015 ...
Array.prototype.indexOf() - JavaScript
array will be searched. default: 0 (entire array is searched). return value the first index of the element in the array; -1 if not found. description indexof() compares searchelement to elements of the array using strict equality (the same method used by the === or triple-equals operator). note: for the string method, see string.prototype.indexof(). polyfill indexof() was added to the e
cma-262 standard in the 5th edition; as such it may not be present in all browsers. you can work around this by utilizing the following code at the beginning of your scripts. this will allow you to use indexof() when there is still no native support. this algorithm matches the one specified in e
cma-262, 5th edition, assuming typeerror and math.abs() have their original values. // this version tries...
...= member) { // nan return -1 // since nan !== nan, it will never be found. fast-path it. } else // all else for (; i !== len; ++i) if (that[i] === member) return i return -1 // if the value was not found, then return -1 } })(object, math.max, math.min) however, if you are more interested in all the little technical bits defined by the e
cma standard, and are less concerned about performance or conciseness, then you may find this more descriptive polyfill to be more useful. // production steps of e
cma-262, edition 5, 15.4.4.14 // reference: http://es5.github.io/#x15.4.4.14 if (!array.prototype.indexof) { array.prototype.indexof = function(searchelement, fromindex) { "use strict"; var k; // 1. let o be the result of c...
... ...
... ...
Date.prototype.toISOString() - JavaScript
source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.toisostring() return value a string representing the given date in the iso 8601 format according to universal time. polyfill this method was standardized in e
cma-262 5th edition. engines which have not been updated to support this method can work around the absence of this method using the following shim: if (!date.prototype.toisostring) { (function() { function pad(number) { if (number < 10) { return '0' + number; } return number; } date.prototype.toisostring = function() { return this.getutcfullyear() + ...
...hich have not been updated to support this method can work around the absence of this method using the following shim: if (!date.prototype.toisostring) { (function() { function pad(number) { if (number < 10) { return '0' + number; } return number; } date.prototype.toisostring = function() { return this.getutcfullyear() + '-' + pad(this.getut
cmonth() + 1) + '-' + pad(this.getutcdate()) + 't' + pad(this.getutchours()) + ':' + pad(this.getut
cminutes()) + ':' + pad(this.getutcseconds()) + '.' + (this.getut
cmilliseconds() / 1000).tofixed(3).slice(2, 5) + 'z'; }; })(); } examples using toisostring() let today = new date('05 october 2011 14:48 utc') console.log(today.toisostring()) ...
... ...
... ...
EvalError - JavaScript
the evalerror object indicates an error regarding the global eval() function. this exception is not thrown by javascript anymore, however the evalerror object remains for compatibility. constructor evalerror() creates a new evalerror object. instance properties evalerror.prototype.message error message. although e
cma-262 specifies that evalerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. evalerror.prototype.name error name. inherited from error. evalerror.prototype.filename path to file that raised this error. inherited from error. evalerror.prototype.linenumber line number in file that raised this error. inherited from error. evalerror.prototype.columnnumber column number in line that raised this error. inherited from e...
...error.prototype.filename path to file that raised this error. inherited from error. evalerror.prototype.linenumber line number in file that raised this error. inherited from error. evalerror.prototype.columnnumber column number in line that raised this error. inherited from error. evalerror.prototype.stack stack trace. inherited from error. examples evalerror is not used in the current e
cmascript specification and will thus not be thrown by the runtime. however, the object itself remains for backwards compatibility with earlier versions of the specification. creating an evalerror try { throw new evalerror('hello', 'somefile.js', 10); } catch (e) { console.log(e instanceof evalerror); // true console.log(e.message); // "hello" console.log(e.name); ...
... ...
... ...
Function.name - JavaScript
ymous". (new function).name; // "anonymous" anonymous function expression anonymous function expressions that were created using the keyword function or arrow functions would have ""(an empty string) as their name. (function() {}).name; // "" (() => {}).name; // "" inferred function names variables and methods can infer the name of an anonymous function from its syntactic position (new in e
cmascript 2015). let f = function() {}; let object = { somemethod: function() {} }; console.log(f.name); // "f" console.log(object.somemethod.name); // "somemethod" you can define a function with a name in a function expression: let object = { somemethod: function object_somemethod() {} }; console.log(object.somemethod.name); // logs "object_somemethod" try { object_somemethod } catch(e) {...
... therefore we can't obtain the class name for virtually any class with a static method property name(): class foo { constructor() {} static name() {} } with a static name() method f...
...; console.log(fooinstance.constructor.name); // logs "foo" warning: the script interpreter will set the built-in function.name property only if a function does not have an own property called name (see section 9.2.11 of the e
cmascript2015 language specification). however, es2015 specifies the static keyword such that static methods will be set as ownproperty of the class constructor function (e
cmascript2015, 14.5.14.21.b + 12.2.6.9). therefore we can't obtain the class name for virtually any class with a static method property name(): class foo { constructor() {} static name() {} } with a static name() method foo.name no longer holds the actual class name but a reference to the name() function object. above class definition in es2015 syntax will behave in chrome or firefox simila...
...perty to always hold a class's name. symbols as function names if a symbol is used a function name and the symbol has a description, the method's name is the description in square brackets. let sym1 = symbol("foo"); let sym2 = symbol(); let o = { [sym1]: function(){}, [sym2]: function(){} }; o[sym1].name; // "[foo]" o[sym2].name; // "" specifications specification e
cmascript (e
cma-262)the definition of 'name' in that specification. ...
Map - JavaScript
r a key or a value. description a map object iterates its elements in insertion order — a for...of loop returns an array of [key, value] for each iteration. key equality key equality is based on the samevaluezero algorithm. nan is considered the same as nan (even though nan !== nan) and all other values are considered equal according to the semantics of the === operator. in the current e
cmascript specification, -0 and +0 are considered equal, although this was not so in earlier drafts. see "value equality for -0 and 0" in the browser compatibility table for details. objects vs. maps object is similar to map—both let you set keys to values, retrieve those values, delete keys, and detect whether something is stored at a key. for this reason (and because there were no built-in al...
...s is seldom done. key types a map's keys can be any value (including functions, objects, or any primitive). the keys of an object must be either a string or a symbol. key order the keys in map are ordered. thus, when iterating over it, a map object returns keys in order of insertion. the keys of an object are not ordered. note: since e
cmascript 2015, objects do preserve creation order for string and symbol keys. in javascript engines that comply with the e
cmascript 2015 spec, iterating over an object with only string keys will yield the keys in order of insertion. size the number of items in a map is easily retrieved from its size property. the number of items in an object must be determined manually. ...
... ...
... ...
Object.prototype.__proto__ - JavaScript
to any code that has access to any object whose [[prototype]] has been altered. if you care about performance you should avoid setting the [[prototype]] of an object. instead, create a new object with the desired [[prototype]] using object.create(). warning: while object.prototype.__proto__ is supported today in most browsers, its existence and exact behavior has only been standardized in the e
cmascript 2015 specification as a legacy feature to ensure compatibility for web browsers. for better support, use object.getprototypeof() instead. the __proto__ property of object.prototype is an accessor property (a getter function and a setter function) that exposes the internal [[prototype]] (either an object or null) of the object through which it is accessed. the use of __proto__ is contro...
...lity for web browsers. for better support, use object.getprototypeof() instead. the __proto__ property of object.prototype is an accessor property (a getter function and a setter function) that exposes the internal [[prototype]] (either an object or null) of the object through which it is accessed. the use of __proto__ is controversial and discouraged. it was never originally included in the e
cmascript language spec, but modern browsers implemented it anyway. only recently was the __proto__ property standardized by the e
cmascript 2015 specification for compatibility with web browsers, so it will be supported into the future. it is deprecated in favor of object.getprototypeof/reflect.getprototypeof and object.setprototypeof/reflect.setprototypeof (though still, setting the [[prototype]] o...
... ...
... ...
TypedArray - JavaScript
s, listed below. on the following pages you will find common properties and methods that can be used with any typed array containing elements of any type. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. description e
cmascript 2015 defines a typedarray constructor that serves as the [[prototype]] of all typedarray constructors. this constructor is not directly exposed: there is no global %typedarray% or typedarray property. it is only directly accessible through object.getprototypeof(int8array) and similar. all typedarrays constructors inherit common properties from the %typedarray% constructor function. add...
...ocalized string representing the array and its elements. see also array.prototype.tolocalestring(). typedarray.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). typedarray.prototype[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples new is required starting with e
cmascript 2015, typedarray constructors must be constructed with the new operator. calling a typedarray constructor as a function without new will throw a typeerror. var dv = int8array([1, 2, 3]); // typeerror: calling a builtin int8array constructor // without new is forbidden var dv = new int8array([1, 2, 3]); property access you can reference elements in the array using standard array index s...
... ...
... ...
isNaN() - JavaScript
syntax isnan(value) parameters value the value to be tested. return value true if the given value is nan; otherwise, false. ...
..., the "false" returned value may be unexpected; the empty string, for example, is surely "not a number." the confusion stems from the fact that the term, "not a number", has a specific meaning for numbers represented as ieee-754 floating-point values. the function should be interpreted as answering the question, "is this value, when coerced to a numeric value, an ieee-754 'not a number' value?" e
cmascript 2015 contains the number.isnan() function. number.isnan(x) is a reliable way to test whether x is nan or not. even with number.isnan, however, the meaning of nan remains the precise numeric meaning and not simply, "not a number". alternatively, in the absence of number.isnan, the expression (x != x) is a more reliable way to test whether variable x is nan or not, as the result is not subje...
... ...
... ...
typeof - JavaScript
imitive whose type is to be returned. description the following table summarizes the possible return values of typeof. for more information about types and primitives, see also the javascript data structure page. type result undefined "undefined" null "object" (see below) boolean "boolean" number "number" bigint (new in e
cmascript 2020) "bigint" string "string" symbol (new in e
cmascript 2015) "symbol" function object (implements [[call]] in e
cma-262 terms) "function" any other object "object" note: e
cmascript 2019 and older permitted implementations to have typeof return any implementation-defined string value for non-callable non-standard exotic objects. t...
...ull // this stands since the beginning of javascript typeof null === 'object'; in the first implementation of javascript, javascript values were represented as a type tag and a value. the type tag for objects was 0. null was represented as the null pointer (0x00 in most platforms). consequently, null had 0 as type tag, hence the "object" typeof return value. (reference) a fix was proposed for e
cmascript (via an opt-in), but was rejected. it would have resulted in typeof null === 'null'. using new operator // all constructor functions, with the exception of the function constructor, will always be typeof 'object' let str = new string('string'); let num = new number(100); typeof str; // it will return 'object' typeof num; // it will return 'object' let func = new function(); typeof fun...
... func; // it will return 'function' need for parentheses in syntax // parentheses can be used for determining the data type of expressions. let idata = 99; typeof idata + ' wisen'; // 'number wisen' typeof (idata + ' wisen'); // 'string' regular expressions callable regular expressions were a non-standard addition in some browsers. typeof /s/ === 'function'; // chrome 1-12 non-conform to e
cmascript 5.1 typeof /s/ === 'object'; // firefox 5+ conform to e
cmascript 5.1 errors before e
cmascript 2015, typeof was always guaranteed to return a string for any operand it was supplied with. even with undeclared identifiers, typeof will return 'undefined'. using typeof could never generate an error. but with the addition of block-scoped let and statements/const using typeof on let and con...
...ent browsers expose a non-standard host object document.all with type undefined. typeof document.all === 'undefined'; although the specification allows custom type tags for non-standard exotic objects, it requires those type tags to be different from the predefined ones. the case of document.all having type 'undefined' is classified in the web standards as a "willful violation" of the original e
cma javascript standard. specifications specification e
cmascript (e
cma-262)the definition of 'the typeof operator' in that specification. ...
Trailing commas - JavaScript
meters, or properties to javascript code. if you want to add a new property, you can simply add a new line without modifying the previously last line if that line already uses a trailing comma. this makes version-control diffs cleaner and editing code might be less troublesome. javascript has allowed trailing commas in array literals since the beginning, and later added them to object literals (e
cmascript 5) and most recently (e
cmascript 2017) to function parameters. json, however, disallows trailing commas. syntax , examples trailing commas in literals arrays javascript ignores trailing commas in arrays: var arr = [ 1, 2, 3, ]; arr; // [1, 2, 3] arr.length; // 3 if more than one trailing comma is used, an elision (or hole) is produced. an array with holes is called sparse (...
...rays: var arr = [ 1, 2, 3, ]; arr; // [1, 2, 3] arr.length; // 3 if more than one trailing comma is used, an elision (or hole) is produced. an array with holes is called sparse (a dense array has no holes). when iterating arrays for example with array.prototype.foreach() or array.prototype.map(), array holes are skipped. var arr = [1, 2, 3,,,]; arr.length; // 5 objects starting with e
cmascript 5, trailing commas in object literals are legal as well: var object = { foo: "bar", baz: "qwerty", age: 42, }; trailing commas in functions e
cmascript 2017 allows trailing commas in function parameter lists. parameter definitions the following function definition pairs are legal and equivalent to each other. trailing commas don't affect the length property of function declaratio...
...as json is based on javascript's syntax prior to es5, trailing commas are not allowed in json. both lines will throw a syntaxerror: json.parse('[1, 2, 3, 4, ]'); json.parse('{"foo" : 1, }'); // syntaxerror json.parse: unexpected character // at line 1 column 14 of the json data omit the trailing commas to parse the json correctly: json.parse('[1, 2, 3, 4 ]'); json.parse('{"foo" : 1...
... to es5, trailing commas are not allowed in json. both lines will throw a syntaxerror: json.parse('[1, 2, 3, 4, ]'); json.parse('{"foo" : 1, }'); // syntaxerror json.parse: unexpected character // at line 1 column 14 of the json data omit the trailing commas to parse the json correctly: json.parse('[1, 2, 3, 4 ]'); json.parse('{"foo" : 1 }'); specifications specification e
cmascript (e
cma-262) ...
Web audio codec guide - Web media technologies
to support additional codecs not included on this list. ...
... no licensing fully open and free of any licensing requirements g.711 (pulse code modulation of voice frequencies) the g.711 specification, published by the international telecommunications union (itu), was initially created in 1972 to define standards for encoding the voice frequencies on telephone lines into digital form. the audio is encoded using pulse code modulation (p
cm) with either µ-law or a-law encoding. the primary benefit to µ-law encoding is that the byte 0x00 never appears in the encoded audio, which may be beneficial in certain applications or networking environments. µ-law is primarily used in north america and japan, with a-law being predominant elsewhere. the drawbacks to g.711 are obvious: small 8-bit samples and narrow audio frequency bandwidth...
...u), the g.722 codec is designed specifically for voice compression. its audio coding bandwidth is limited to the 50 hz to 7,000 hz range, which covers most of the frequency range of typical human vocalization. this makes it ill-suited for handling any audio that might range outside the human speech range, such as music. g.722 audio is encoded using adaptive differential pulse code modulation (adp
cm), in which each sample is represented not by its absolute value, but as a value indicating how much the new sample differs from the previous sample. g.722 is primarily used with webrtc connections, as it's one of the audio codecs mandated by the webrtc specification. supported bit rates g.722: 48 kbps, 56 kbps, and 64 kbps; however, in practice 64 kbps is always used g.722 annex...
... kbps; however, in practice 64 kbps is always used g.722 annex b super wide-band: 64 kbps, 80 kbps, and 96 kbps g.722 annex d stereo wide-band: 64 kbps and 80 kbps g.722 annex d stereo super wide-band: 80 kbps, 96 kbps, 112 kbps, and 128 kbps variable bit rate (vbr) support no supported sample formats 14-bit integer supported sample rates 16 khz (adp
cm is specified to allow 8 khz, 11.025 khz, 22.05 khz, 44.1 khz, but g.722 uses 16 khz) recommended minimum bit rate for stereo sound 128 kbps at 44.1 khz sample rate compression lossy maximum audio channels 2 audio frequency bandwidth 50 hz - 7 khz latency 4 ms browser compatibility feature chro...
Media container formats (file types) - Web media technologies
ns. on mac os, the quicktime framework not only supported quicktime format movie files and codecs, but supported a vast array of popular and specialty audio and video codecs, as well as still image formats. through quicktime, mac applications (including web browsers, through the quicktime plugin or direct quicktime integration) were able to read and write audio formats including aac, aiff, mp3, p
cm, and qualcomm purevoice; and video formats including avi, dv, pixlet, prores, flac, cinepak, 3gp, h.261 through h.265, mjpeg, mpeg-1 and mpeg-4 part 2, sorenson, and many more. in addition, a number of third-party components are available for quicktime, some of which add support for additional codecs. because quicktime support is, for all intents and purposes, primarily available on apple devic...
... it is derived from the resource interchange file format (riff), and as such is similar to other formats such as apple's aiff. ...
...dio file format (wave), usually referred to simply as wav due to its filename extension being .wav, is a format developed by microsoft and ibm to store audio bitstream data. it is derived from the resource interchange file format (riff), and as such is similar to other formats such as apple's aiff. the wav codec registry can be found at rfc 2361; however, because nearly all wav files use linear p
cm, support for the other codecs is sparse. the wave format was first released in 1991. wave media mime types audio audio/wave1 audio/wav audio/x-wav audio/x-pn-wav [1] the audio/wave mime type is the standard type, and is preferred; however, the others have been used by various products over the years and may be used as well in some environ...
... audio/wave1 audio/wav audio/x-wav audio/x-pn-wav [1] the audio/wave mime type is the standard type, and is preferred; however, the others have been used by various products over the years and may be used as well in some environments. audio codecs supported by wave codec browser support chrome edge firefox safari adp
cm (adaptive differential pulse code modulation) no gsm 06.10 no lp
cm (linear pulse code modulation) yes mpeg-1 audio layer iii (mp3) no µ-law (u-law) no webm webm (web media) is a format based on matroska which is designed specifically for use in modern web environments. it's base...
Codecs used by WebRTC - Web media technologies
peer to another, without a container or even a mediastream associated with the tracks. which codecs can be within those tracks is not mandated by the webrtc specification. however, rfc 7742 specifies that all webrtc-compatible browsers must support vp8 and h.264's constrained baseline profile for video, and rfc 7874 specifies that browsers must support at least the opus codec as well as g.711's p
cma and p
cmu formats. these two rfcs also lay out options that must be supported for each codec, as well as specific user comfort features such as echo cancelation. this guide reviews the codecs that browsers are required to implement as well as other codecs that some or all browsers support for webrtc. while compression is always a necessity when dealing with media on the web, it's of additional ...
...d" and "full frame freeze" sei messages; these are used to support switching among multiple input streams seamlessly. supported audio codecs the audio codecs which rfc 7874 mandates that all webrtc-compatible browsers must support are shown in the table below. mandatory audio codecs codec name browser compatibility opus chrome, edge, firefox, safari g.711 p
cm (a-law) chrome, firefox, safari g.711 p
cm (µ-law) chrome, firefox, safari see below for more details about any webrtc-specific considerations that exist for each codec listed above. it's useful to note that rfc 7874 defines more than a list of audio codecs that a webrtc-compliant browser must support; it also provides recommendations and requirements for special audio feat...
...d monaural music (fb mono) 48 to 64 kbps full-band stereo music (fb stereo) 64 to 128 kbps the bit rate may be adjusted at any time. in order to avoid network congestion, the average audio bit rate should not exceed the available network bandwidth (minus any other known or anticipated added bandwidth requirements). g.711 g.711 defines the format for pulse code modulation (p
cm) audio as a series of 8-bit integer samples taken at a sample rate of 8,000 hz, yielding a bit rate of 64 kbps. both µ-law and a-law encodings are allowed. g.711 is defined by the itu and its payload format is defined in rfc 3551: 4.5.14. webrtc requires that g.711 use 8-bit samples at the standard 64 kbps rate, even though g.711 supports some other variations. neither g.711.0 (lossless compre...
...tc are shown in the table below. preferred codecs for webrtc in major web browsers audio video chrome edge firefox vp9 (firefox 46 and later) vp8 opera safari choosing the right codec before choosing a codec that isn't one of the mandatory codecs (vp8 or avc for video and opus or p
cm for audio), you should seriously consider the potential drawbacks: in particular, only these codecs can be generally assumed to be available on essentially all devices that support webrtc. if you choose to prefer a codec other than the mandatory ones, you should at least allow for fallback to one of the mandatory codecs if support is unavailable for the codec you prefer. audio in general, if i...
Modules - Archive of obsolete content
as an option to the loader constructor. this is useful if the api to be exposed does not have a corresponding js file, or is written in an incompatible format. ...
...as a result, we don't have to give modules chrome privileges on a case by case basis. more importantly, however, any module that wants access to components has to explicitly express its intent via a call to require("chrome"). ...
...as a result, we don't have to give modules chrome privileges on a case by case basis. more importantly, however, any module that wants access to components has to explicitly express its intent via a call to require("chrome"). ...
Custom about: URLs - Archive of obsolete content
work. this example can be easily modified, just modify the global const at in the // globals section. in bug 1254752 things changed for firefox 48 and up. services.io.newchannel was deprecated, and the signature of the newchannel method changed. this change is reflected in the code below. this code will work for all versions of firefox 4 and up. ...
...e global const at in the // globals section. in bug 1254752 things changed for firefox 48 and up. services.io.newchannel was deprecated, and the signature of the newchannel method changed. this change is reflected in the code below. this code will work for all versions of firefox 4 and up. ...
...nnel = services.io.newchannel(aboutpage_uri, null, null); } channel.originaluri = auri; return channel; } } class factory { constructor(component) { this.component = component; this.register(); object.freeze(this); } createinstance(outer, iid) { if (outer) { throw cr.ns_error_no_aggregation; } return new this.component(); } register() {
cm.registerfactory(this.component.classid, this.component.classdescription, this.component.contractid, this); } unregister() {
cm.unregisterfactory(this.component.prototype.classid, this); } } instantiation firefox 4+ now in the startup procedure of your bootstrapped addon make sure to do register the factory, for ex...
JXON - Archive of obsolete content
also shows how the ideal jxon document is an xml document designed specifically to be converted in json format, though our algorithms work fine with any kind of xml document. note: despite the term jxon suggesting "lossless" conversions, these techniques are not actually lossless if one needs to preserve ordering of elements, as is common with many xml dialects (including of course xhtml). the e
cmascript standard (javascript) indicates that object iteration order is implementation dependent. appendix: a complete, bidirectional, jxon library now we can create a more complete, bidirectional, jxon library based on all our algorithms (see: #1, #2, #3, #4, reverse). its usage is modeled on the json native object. before implementing it in a working environment, please read the note about the ...
...similar to variables declared with the let statement, constants declared with const will be block-scoped. we used it only for didactic ...
...similar to variables declared with the let statement, constants declared with const will be block-scoped. we used it only for didactic purpose. ...
List of Mozilla-Based Applications - Archive of obsolete content
desktop 2 internal browser and portal client expeditors international of washington, inc. dogtag certificate system uses nss dojo javascript toolkit uses mozilla rhino in shrinksafe eclipse platform open development platform the ajax toolkit framework, standard widget toolkit and eclipsemozilla projects make use of mozilla elixon w
cms/xul web content management system fully remote xul w
cms (no need to install extensions). entelechy chat bot uses xulrunner epic browser web browser based on chromium uses mozilla nss and npapi libraries emusic download manager music downloader for emusic emusic remote music manager enlis genome personal genome brows...
...nux distro mozcards, jolistopwatch, jolitimer simple apps for maemo uses xulrunner moznet .net control embeddable gecko for .net applications wraps xulrunner for use in .net applications my internet browser localized browser uses gecko myna application server javascript application server for java uses mozilla rhino next
cms (fr)
cms nightingale music player community run effort to continue songbird support for linux olpc web browser browser oneteam jabber client opendocument viewer viewer opengate's tools cd burner, file browser, and hardware diagnostic softwares opengate is the opensource side of the easyneuf project, “a free so...
...xul and the mozilla framework are heavily used in the gui snapstick internet on ...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
many browsers, such as internet explorer, also support pre-w3c apis and have never added extensive support for the w3c-compliant ones. before i go into the differenc...
...many browsers, such as internet explorer, also support pre-w3c apis and have never added extensive support for the w3c-compliant ones. before i go into the differences between mozilla and internet explore...
...differences most differences between mozilla and internet explorer are usually blamed on javascript. however, the issues usually lie in the apis that a browser exposes to javascript, such as the dom hooks. the two browsers possess few core javascript differences; issues encountered are often timing related. javascript date differences the only date difference is the getyear method. as per the e
cmascript specification (which is the specification javascript follows), running new date().getyear() in 2004 will return "104". per the e
cmascript specification, getyear returns the year minus 1900, originally meant to return "98" for 1998. getyear was deprecated in e
cmascript version 3 and replaced with getfullyear(). internet explorer uses an obsolete behavior for getyear(), similar to netscape 4...
LIR - Archive of obsolete content
subtract double 102 muld double multiply double 103 divd double divide double 104 modd double modulo double lir_modd is just a place-holder opcode, ie. the back-ends cannot generate code for it.it's used in tracemonkey briefly but is always demoted to a lir_modl or converted to a function call before nanojit has to do anything serious with it. ...
...ply double 103 divd double divide double 104 modd double modulo double lir_modd is just a place-holder opcode, ie. the back-ends cannot generate code for it.it's used in tracemonkey briefly but is always demoted to a lir_modl or converted to a function call before nanojit has to do anything serious with it. ...
... 104 modd double modulo double lir_modd is just a place-holder opcode, ie. the back-ends cannot generate code for it.it's used in tracemonkey briefly but is always demoted to a lir_modl or converted to a function call before nanojit has to do anything serious with it. ...
command - Archive of obsolete content
« xul reference home command type: id set to the id of a command element that is being observed by the element. ...
... « xul reference home command type: id set to the id of a command element that is being observed by the element. ...
... « xul reference home command type: id set to the id of a command element that is being observed by the element. ...
Providing Command-Line Options - Archive of obsolete content
rtup;1?type=myapp", _xpcom_categories: [{ category: "command-line-handler", // changeme: // category names are sorted alphabetically. typical command-line handlers use a // category that begins with the letter "m". ...
...rted alphabetically. typical command-line handlers use a // category that begins with the letter "m". ...
...p" }], 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);
cm...
Updating Commands - Archive of obsolete content
ted by a controller. in addition, you will need to do this when creating your own menu commands, for instance to implement the edit menu commands in your own application. fortunately, the extra code is fairly simple. all we need to do is get the needed controller and call the command. a simple way of doing this is the following: var controller = document.commanddispatcher.getcontrollerforcommand("
cmd_paste"); if (controller && controller.iscommandenabled("
cmd_paste")){ controller.docommand(command); } the code above first retrieves the controller for the '
cmd_paste' command from the command dispatcher. then, it checks to see whether the command is enabled, and then executes the command using the docommand method of the controller. note that we don't need to figure out which element to use...
... if you include the script 'chrome://global/content/globaloverlay.js' in a xul file, you can call the godocommand method which executes the command passed as the argument. the code for this function is only a few lines long so you could include it directly in your code if for some reason you didn't want to include the library. <script src="chrome://global/content/globaloverlay.js"/> <command id="
cmd_paste" oncommand="godocommand('
cmd_paste');"/> <button label="paste" command="
cmd_paste"/> the example above will implement a paste button. it is attached to the command which will invoke the command on the necessary controller when called. the code above is all you need to implement the functionality of the paste command in your application. the only other thing you need to do is ensure that t...
...d will become enabled whenever a textbox is focused and when the clipboard contents change. a command updater will listen for these situations and code can be executed which enables and disables commands as necessary. a simple command updater looks like this: <commandset id="updatepasteitem" commandupdater="true" events="focus" oncommandupdate="goupdatecommand('
cmd_paste');"/> a command updater is indicated by using the commandupdater attribute, which should be set to true. the events attribute is used to list the events that the command updater listens for. you can specify multiple events by separating them with commas. in the example above, the command updater listens for the focus event. this causes commands to be updated when an element receives the f...
Browser Detection and Cross Browser Support - Archive of obsolete content
termine if a visitor is using a gecko-based browser, simply test navigator.product == 'gecko' or look for the string 'gecko/' in the navigator.useragent. note that some other browsers such as safari are reporting (like gecko) in their user agent strings and can confuse simple tests. introduction in an ideal world, we could author html, xml, css and javascript and only worry about the w3c and e
cma standards. however, we don't quite live in such a world yet. due to bugs, incomplete implementations of the standards and legacy browsers, web developers must be able to determine which browser a visitor is using and provide the appropriate content and scripting code path. although browser detection is perhaps the most common scripting task that every web developer faces, it seems that the vari...
...fox, mozilla, and netscape browsers, far fewer are aware that these browsers are members of an entire family of user agents based upon the gecko layout engine which includes the commercial browser compuserve 7, and open source browsers such as epiphany, galeon, camino, kmeleon, and seamonkey. gecko was designed from the ground up to be compliant with the w3c html, w3c css, w3c xml, w3c dom, and e
cmascript (javascript) standards. it also includes compatibility features which allow it to reasonably handle legacy content which was developed for earlier generations of browsers such as netscape navigator 4 as well as features which provide compatibility with internet explorer 5 and 6. unlike other browsers, gecko is truly cross platform and provides consistent behavior across all supported opera...
...ile some users may have scripting support turned off in their browser. use the noscript tag to provide these users with alternative unscripted versions of your pages or to at least notify them of the need to use scripting in order to view your content properly. since browsers such as netscape navigator 4 and internet explorer 4 do not support some of the most recent additions to the javascript (e
cmascript) standard, it is often necessary to limit the use of advanced javascript features such as exception processing. one approach is to require that users of browsers which do not support the level of javascript used in your content to turn off javascript in order to be able to use your content. you can do this by providing an error message for users of older browsers as well as alternative con...
E4X - Archive of obsolete content
re is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. warning: e4x is obsolete. it has been disabled by default for webpages (content) in firefox 17, disabled by default for chrome in firefox 20, and has been removed in firefox 21. use domparser/domserializer or a non-native jxon algorithm instead. e
cmascript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a form that feels natural for e
cmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algorithm. e4x is standardized b...
...ript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a form that feels natural for e
cmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algorithm. e4x is standardized by e
cma international in e
cma-357 standard (currently in its second edition, december 2005). e4x is implemented (at least partially) in spidermonkey (gecko's javascript engine) and in rhino (javascript engine written in java). note: in gecko 1.8 based browsers such as firefox 1.5, e4x is already partially enabled for web page authors. to fully enable e4x, the <script> element needs to have the mime ty...
...ntaxerror "xml is a reserved identifier" (despite the xml being in a string). ...
New in JavaScript 1.8.5 - Archive of obsolete content
n array. bug 510537 date.prototype.tojson() returns a json format string for a date object. function.prototype.bind() creates a new function that, when called, itself calls this function in the context provided (with a given sequence of arguments). bug 429507 new e
cmascript5 features get and set operators now allows the identifier to be numeric or a string. bug 520696 function.apply() can accept any array-like object as the arguments list, instead of only true arrays. strict mode support array.tostring() now works even on non-arrays by either returning the result of calling its join() method if one is avai...
...the arguments list, instead of only true arrays. strict mode support array.tostring() now works even on non-arrays by either returning the result of calling its join() method if one is available or by calling its tostring() method. other standardization work various non-standard syntaxes for defining getters and setters have been removed; e
cmascript 5 defined syntax has not been changed. these were all pretty esoteric and rarely used; if this affects you, see this blog post for details. new objects object description old proxy api offers support for creating object and function proxies that enable ...
...on proxies that enable meta-programming in javascript. changed functionality in javascript 1.8.5 iso 8601 support in date: the date object's parse() method now supports simple iso 8601 format date strings. global objects made read only: the nan, infinity, and undefined global objects have been made read only, per the e
cmascript 5 specification. obj.__parent__ and obj.__count__ become obsolete. some information about why: spidermonkey change du jour: the special __parent__ property has been removed bug 551529 & bug 552560. trailing commas no longer accepted in json.parse(). ...
Archived JavaScript Reference - Archive of obsolete content
ytelength is undefined, the bytelength of the oldbuffer is used. this operation leaves oldbuffer in a detached state.date.prototype.tolocaleformat()the non-standard tolocaleformat() method converts a date to a string using the specified formatting. intl.datetimeformat is an alternative to format dates in a standards-compliant way. see also the newer version of date.prototype.tolocaledatestring().e
cmascript 2016 to es.next support in mozillaexpression closuresexpression closures are a shorthand function syntax for writing simple functions.for each...inthe for each...in statement iterates a specified variable over all values of object's properties. for each distinct property, a specified statement is executed.function.aritynot part of any standard.function.prototype.isgenerator()the non-standa...
...ator comprehensionsthe generator comprehension syntax was a javascript expression which allowed you to quickly assemble a new generator function based on an existing iterable object. however, it has been removed from the standard and the firefox implementation. do not use it!handler.enumerate()the handler.enumerate() method used to be a trap for for...in statements, but has been removed from the e
cmascript standard in es2016 and is deprecated in browsers.legacy generator functionthe legacy generator function statement declares legacy generator functions with the specified parameters.legacy generator function expressionthe function keyword can be used to define a legacy generator function inside an expression. to make the function a legacy generator, the function body should contain at least ...
...when that occurs.object.unobserve()the object.unobserve() method was used to remove observers set by object.observe(), but has been deprecated and removed from browsers. you can use the more general proxy object instead.reflect.enumerate()the static reflect.enumerate() method used to return an iterator with the enumerable own and inherited properties of the target object, but has been removed in e
cmascript 2016 and is deprecated in browsers.string.prototype.quote()the non-standard quote() method returns a copy of the string, replacing various special characters in the string with their escape sequences and wrapping the result in double-quotes ("). ...
Cipher suite - MDN Web Docs Glossary: Definitions of Web-related terms
a cipher suite is a combination of a key exchange algorithm, authentication method, bulk encryption cipher, and message authentication code. in a cryptosystem like tls, the client and server must agree on a cipher suite before they can begin communicating securely. ...
... a cipher suite is a combination of a key exchange algorithm, authentication method, bulk encryption cipher, and message authentication code. in a cryptosystem like tls, the client and server must agree on a cipher suite before they can begin communicating securely. ...
...hentication code. in a cryptosystem like tls, the client and server must agree on a cipher suite before they can begin communicating securely. ...
MDN Web Docs Glossary: Definitions of Web-related terms
der canvas card sorting carddav caret cdn certificate authority certified challenge-response authentication character character encoding character set chrome cia cipher cipher suite ciphertext class client hints closure
cms code splitting codec compile compile time computer programming conditional constant constructor continuous media control flow cookie copyleft cors cors-safelisted request header cors-safelisted response header crawler crlf cross axis ...
... doctype document directive document environment dom (document object model) domain domain name domain sharding dominator dos attack dtls (datagram transport layer security) dtmf (dual-tone multi-frequency signaling) dynamic programming language dynamic typing e e
cma e
cmascript effective connection type element empty element encapsulation encryption endianness engine entity entity header event exception expando f fallback alignment falsy favicon fetch directive fetch metadata request...
...esign rest rgb ril robots.txt round trip time (rtt) routers rss rtcp (rtp control protocol) rtf rtl (right to left) rtp (real-time transport protocol) and srtp (secure rtp) rtsp: real-time streaming protocol ruby s safe same-origin policy s
cm scope screen reader script-supporting element scroll container scrollport sctp sdp search engine second-level domain secure sockets layer (ssl) selector (css) self-executing anonymous function semantics seo serialization server server timing ...
CSS values and units - Learn web development
x (pixels) or 30em. there are two types of lengths used in css — relative and absolute. it's important to know the difference in order to understand how big things will become. absolute length units the following are all absolute length units — they are not relative to anything else and are generally considered to always be the same size. ...
...ere are two types of lengths used in css — relative and absolute. it's important to know the difference in order to understand how big things will become. absolute length units the following are all absolute length units — they are not relative to anything else and are generally considered to always be the same size. unit name equivalent to
cm centimeters 1
cm = 96px/2.54 mm millimeters 1mm = 1/10th of 1
cm q quarter-millimeters 1q = 1/40th of 1
cm in inches 1in = 2.54
cm = 96px pc picas 1pc = 1/6th of 1in pt points 1pt = 1/72th of 1in px pixels 1px = 1/96th of 1in most of these values are more useful when used for print, rather than screen output. for example...
...the only value that you will commonly use is px (pixels). relative length units relative length units are relative to something else, perhaps the size of the parent element's font, or the size of the viewport. ...
Inheritance in JavaScript - Learn web development
previous overview: objects next with most of the gory details of oojs now explained, this article shows how to create "child" object classes (constructors) that inherit features from their "parent" classes. in addition, we present some advice on when and where you might use oojs, and look at how classes are dealt with in modern e
cmascript syntax. prerequisites: basic computer literacy, a basic understanding of html and css, familiarity with javascript basics (see first steps and building blocks) and oojs basics (see introduction to objects). objective: to understand how it is possible to implement inheritance in javascript. prototypal inheritance so far we have seen some inheritance in action — we have seen how prototype chains work, and how membe...
...ry accesses that member. note: if you have trouble getting this to work, compare your code to our finished version (see it running live also). the technique we covered here is not the only way to create inheriting classes in javascript, but it works ok, and it gives you a good idea about how to implement inheritance in javascript. you might also be interested in checking out some of the new e
cmascript features that allow us to do inheritance more cleanly in javascript (see classes). we didn't cover those here, as they are not yet supported very widely across browsers. all the other code constructs we discussed in this set of articles are supported as far back as ie9 or earlier, and there are ways to achieve earlier support than that. a common way is to use a javascript library — most...
..., which can either be an object created when a constructor is instantiated like we saw above (so for example var teacher1 = new teacher( name = 'chris' ); and then teacher1.name), or an object literal (let teacher1 = { name = 'chris' } and then teacher1.name). if you are not sure which is which, don't worry about it just yet — you are still learning, and familiarity will come with practice. e
cmascript 2015 classes e
cmascript 2015 introduces class syntax to javascript as a way to write reusable classes using easier, cleaner syntax, which is more similar to classes in c++ or java. in this section we'll convert the person and teacher examples from prototypal inheritance to classes, to show you how it's done. note: this modern way of writing classes is supported in all modern browsers, b...
Object prototypes - Learn web development
t objects inherit features from one another. in this article, we explain how prototype chains work and look at how the prototype property can be used to add methods to existing constructors. note: this article covers traditional javascript constructors and classes. in the next article, we talk about the modern way of doing things, which provides easier syntax to achieve the same things — see e
cmascript 2015 classes. prerequisites: understanding javascript functions, familiarity with javascript basics (see first steps and building blocks), and oojs basics (see introduction to objects). objective: to understand javascript object prototypes, how prototype chains work, and how to add new methods onto the prototype property. a prototype-based language? javasc...
...rototype object has a valueof() method available on it. it doesn't, then the browser checks person1's prototype object's prototype object, and it has. so the method is called, and all is good! note: we want to reiterate that the methods and properties are not copied from one object to another in the prototype chain. they are accessed by walking up the chain as described above. note: before e
cmascript 2015, there wasn't officially a way to access an object's prototype directly — the "links" between the items in the chain are defined in an internal property, referred to as [[prototype]] in the specification for the javascript language (see e
cmascript). most modern browsers, however, do offer property available called __proto__ (that's 2 underscores either side), which contains the obj...
...nal property, referred to as [[prototype]] in the specification for the javascript language (see e
cmascript). most modern browsers, however, do offer property available called __proto__ (that's 2 underscores either side), which contains the object's constructor's prototype object. for example, try person1.__proto__ and person1.__proto__.__proto__ to see what the chain looks like in code! since e
cmascript 2015, you can access an object's prototype object indirectly via object.getprototypeof(obj). the prototype property: where inherited members are defined so, where are the inherited properties and methods defined? if you look at the object reference page, you'll see listed in the left hand side a large number of properties and methods — many more than the number of inherited members we...
NSS 3.14 release notes
the nss license has changed to mpl 2.0. previous releases were released under a mpl 1.1/gpl 2.0/lgpl 2.1 tri-license. for more information about mpl 2.0, please see http://www.mozilla.org/mpl/2.0/faq.html. for an additional explantation on gpl/lgpl compatibility,...
...erability testing is not yet at the same level as other nss code, this feature should be considered "experimental" and may contain bugs. the following functions have been added to the libssl library included in nss 3.14: dtls_importfd (in ssl.h) dtls_gethandshaketimeout (in ssl.h) ssl_getsrtpcipher (in ssl.h) ssl_setrtpciphers (in ssl.h) support for aes-g
cm support for aes-g
cm has been added to the nss pkcs #11 module (softoken), based upon the draft 7 of pkcs #11 v2.30. warning: because of ambiguity in the current draft text, applications should only use g
cm in single-part mode (c_encrypt/c_decrypt). they should not use multi-part apis (c_encryptupdate/c_decryptupdate). support for application-defined certificate chain va...
... 3.14 certchainverifycallback (in certt.h) certchainverifycallbackfunc (in certt.h) cert_pi_chainverifycallback, a new option for certvalparamintype (in certt.h) a new error code: sec_error_application_callback_error (in secerr.h) new for pkcs #11 pkcs #11 mechanisms: ckm_aes_cts ckm_aes_ctr ckm_aes_g
cm (see warnings against using c_encryptupdate/c_decryptupdate above) ckm_sha224_key_derivation ckm_sha256_key_derivation ckm_sha384_key_derivation ckm_sha512_key_derivation changes in nss 3.14 bug 333601 - performance enhancements for intel macs when building for intel macs, nss will now take advantage of optimized assembly code for common...
NSS 3.16.1 release notes
rc/ new in nss 3.16.1 new functionality added the "ecc" flag for modutil to select the module used for elliptic curve cryptography (ecc) operations. new functions in pk11pub.h pk11_exportderprivatekeyinfo and pk11_exportprivkeyinfo - exports a private key in a der-encoded asn.1 privatekeyinfo type or a seckeyprivatekeyinfo structure. only rsa private keys are supported now. ...
... 3.16.1 new functionality added the "ecc" flag for modutil to select the module used for elliptic curve cryptography (ecc) operations. new functions in pk11pub.h pk11_exportderprivatekeyinfo and pk11_exportprivkeyinfo - exports a private key in a der-encoded asn.1 privatekeyinfo type or a seckeyprivatekeyinfo structure. only rsa private keys are supported now. in se
cmod.h se
cmod_internaltopubmechflags - converts from nss-internal to public representation of mechanism flags. new types in sslt.h ssl_padding_xtn - the value of this enum constant changed from the experimental value 35655 to the iana-assigned value 21. . new macros in se
cmod.h public_mech_ecc_flag - a public mechanism flag for elliptic curve cryptography (ecc) operations. i...
...lags - converts from nss-internal to public representation of mechanism flags. new types in sslt.h ssl_padding_xtn - the value of this enum constant changed from the experimental value 35655 to the iana-assigned value 21. . new macros in se
cmod.h public_mech_ecc_flag - a public mechanism flag for elliptic curve cryptography (ecc) operations. in utilmodt.h se
cmod_ecc_flag - an nss-internal mechanism flag for elliptic curve cryptography (ecc) operations. this macro has the same numeric value as public_mech_ecc_flag. notable changes in nss 3.16.1 imposed name constraints on the french government root ca anssi (dciss). bugs fixed in nss 3.16.1 this bugzilla query returns all the bugs fixed in nss 3.16.1: https://bugzilla.mozilla.org/buglist.cgi?re...
NSS 3.22 release notes
o ckm_rsa_pkcs. the ck_rsa_pkcs_pss mechanism takes a parameter of type ck_rsa_pkcs_pss_params. ...
...sa_pkcs_pss mechanism takes a parameter of type ck_rsa_pkcs_pss_params. ...
...es a parameter of type ck_rsa_pkcs_pss_params. ...
NSS 3.42 release notes
are available in nss releases. ...
...thanks to hanno böck and damian poddebniak for the discovery and fixes. note: this was mistakenly not in release 3.42, and is instead in nss 3.42.1. ...
... bug 1508673 - added chacha20-poly1305 test cases bug 1514999 - added the curve25519 test cases thanks to jonas allmann for adapting these tests. bugs fixed in nss 3.42 bug 1490006 - reject invalid ch.legacy_version in tls 1.3 bug 1507135 and bug 1507174 - add additional null checks to several
cms functions to fix a rare
cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. note: this was mistakenly not in release 3.42, and is instead in nss 3.42.1. bug 1513913 - a fix for solaris where firefox 60 core dumps during start when using profile from version 52 this bugzilla query returns all the bugs fixed in nss 3.42: https://bugzilla.mozilla.org/buglist.cgi?resolution=...
NSS 3.46 release notes
tp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_46_rtm/src/ other releases are available in nss releases. new in nss 3.46 this release contains no significant new functionality, but concentrates on providing improved performance, stability, and security. of particular note are significant improvements to aes-g
cm performance on arm. notable changes in nss 3.46 certificate authority changes the following ca certificates were removed: bug 1574670 - remove expired class 2 primary root certificate sha-256 fingerprint: 0f993c8aef97baaf5687140ed59ad1821bb4afacf0aa9a58b5d57a338a3afbcb bug 1574670 - remove expired utn-userfirst-client root certificate sha-256 finger...
... in nss 3.47, which will be released in october: tls 1.3 will be the default maximum tls version. see bug 1573118 for details. tls extended master secret will be enabled by default, where possible. see bug 1575411 for details. ...
...rning in httpserv.c bug 1561556 - remove -wmaybe-uninitialized warning in tls13esni.c bug 1561332 - ec.c:28 warning: comparison of integers of different signs: 'int' and 'unsigned long' bug 1564714 - print certutil commands during setup bug 1565013 - hacl image builder times out while fetching gpg key bug 1563786 - update hacl-star docker image to pull specific commit bug 1559012 - improve g
cm perfomance using pmull2 bug 1528666 - correct resumption validation checks bug 1568803 - more tests for client certificate authentication bug 1564284 - support profile mobility across windows and linux bug 1573942 - gtest for pkcs11.txt with different breaking line formats bug 1575968 - add strsclnt option to enforce the use of either ipv4 or ipv6 bug 1549847 - fix nss builds on ios bug 14...
NSS Sample Code Sample_1_Hashing
nss sample code 1: hashing a file. this is an example program that demonstrates how to compute the hash of a file and save it to another file. this program illustrates the use of nss message apis. sample code 1 /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> /* nss headers */ #include <secoid.h> #include <se
cmodt.h> #include <sechash.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */ static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* * maps a hash name to a secoidtag. * returns n...
..."sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* * maps a hash name to a secoidtag. ...
... progname, hashname); usage(progname); } /* digest it and print the result */ rv = digestfile(pr_stdout, pr_stdin, hashoidtag); if (rv != secsuccess) { fprintf(stderr, "%s: problem digesting data (%d)\n", progname, port_geterror()); } rv = nss_shutdown(); if (rv != secsuccess) { exit(-1); } return 0; } </sechash.h></se
cmodt.h></secoid.h></prio.h></plgetopt.h></prtypes.h></prprf.h> ...
NSS_Initialize
name nss_initialize - initialize nss. syntax secstatus nss_initialize(const char *configdir, const char *certprefix, const char *keyprefix, const char *se
cmodname, pruint32 flags); parameters nss_initialize has five parameters: configdir [in] the directory where the certificate, key, and module databases live. to-do: document the "sql:" prefix. certprefix [in] prefix added to the beginning of the certificate database, for example, "https-server1-". keyprefix [in] prefix added to the beginning of the key database, for example, "https-server1-". se
cmodname [in] name of the security module database, usually "se
cmod.db". flags [in] bit flags that specify how nss should be initialized. d...
...for example, java sunpkcs11 provider. nss_init_nopk11finalize - never call c_finalize on any pkcs#11 module. this may be necessary in order to ensure continuous operation and proper shutdown sequence if another piece of code is using the same pkcs#11 modules that nss is accessing without going through nss, for example, java sunpkcs11 provider. the following limitation applies when this is set : se
cmod_waitforanytokenevent will not use c_waitforslotevent, in order to prevent the need for c_finalize. this call will be emulated instead. nss_init_reserved - currently has no effect, but may be used in the future to trigger better cooperation between pkcs#11 modules used by both nss and the java sunpkcs11 provider. this should occur after a new flag is defined for c_initialize by the pkcs#11 worki...
...ize by the pkcs#11 working group. ...
sslcrt.html
5 certificate functions this chapter describes the functions and related types used to work with a certificate database such as the cert7.db database provided with communicator. validating certificates manipulating certificates getting certificate information comparing secitem objects validating certificates cert_verifycertnow cert_verifycertname cert_checkcertvalidtimes nss_
cmpcertchainwcanames cert_verifycertnow checks that the current date is within the certificate's validity period and that the ca signature on the certificate is valid. syntax #include <cert.h> secstatus cert_verifycertnow( certcertdbhandle *handle, certcertificate *cert, prbool checksig, seccertusage certusage, void *wincx); parameters this function has the following param...
...ant to check against. t the time to check against the certificate's validity period. for more information, see the nspr header pr_time.h. ...
.... returns the function returns an enumerator of type seccerttimevalidity: typedef enum { seccerttimevalid, seccerttimeexpired, seccerttimenotvalidyet } seccerttimevalidity; nss_
cmpcertchainwcanames determines whether any of the signers in the certificate chain for a specified certificate are on a specified list of ca names. syntax #include <nss.h> secstatus nss_
cmpcertchainwcanames( certcertificate *cert, certdistnames *canames); parameters this function has the following parameters: cert a pointer to the certificate structure for the certificate whose certificate chain is to be checked. canames a pointer to a structure that contains a list of...
64-bit Compatibility
tform specific code, these opcodes have aliases decorated with a "p". the following table contains the most relevant opcodes: platform alias 32-bit op 64-bit op ldp ld ldq ldcp ldc ldcq piadd add qiadd piand and qiand pilsh lsh qilsh pirsh rsh qirsh pursh ush qursh p
cmov
cmov q
cmov pior or qior pxor xor qxor addp iaddp qaddp peq - puge eq - uge qeq - quge pcall icall qcall the 32-bit versions have the following inputs and outputs. i32 means "32-bit integer". 32-bit op inputs output ld i32, i32 i32 ldc i32, i32 i32 add ...
... quge pcall icall qcall the 32-bit versions have the following inputs and outputs. i32 means "32-bit integer". 32-bit op inputs output ld i32, i32 i32 ldc i32, i32 i32 add i32, i32 i32 and i32, i32 i32 lsh i32, i32 i32 rsh i32, i32 i32 ush i32
cmov i32, i32, i32 i32 or i32, i32 i32 xor i32, i32 i32 iaddp i32, i32 i32 eg - uge i32, i32 i32 icall n/a i32 the 64-bit versions have the following inputs and outputs. i64 means "64-bit integer". 64-bit op inputs output ldq i64, i32 i64 ldcq i64, i32 i64 ...
...call n/a i32 the 64-bit versions have the following inputs and outputs. i64 means "64-bit integer". ...
Self-hosted builtins in SpiderMonkey
tent has access to, then callfunction(receiver.fun, receiver) wouldn't be guaranteed to work, because content might have changed the value of receiver.fun, so callcontentfunction(receiver.fun, receiver) has to be used. self-hosted functions by default are not constructors and do not have a prototype property, so that they meet the requirements for standard built-in functions as described in the e
cmascript language specification 5.1, clause 15. to make a self-hosted function a constructor, call makeconstructible(functionname) after the function declaration. a prototype property can be added from the self-hosted code itself. all self-hosted functions have direct access to each other and can rely on references being stable, i.e. not changeable by client js code. otoh, self-hosted code doesn'...
...function.prototype.apply directly. a select set of c++-implemented builtins is installed via the intrinsic_functions array in selfhosting.cpp, as described below. using the same mechanism, c++-implemented helper functions are made available to self-hosted code. some general-purpose functions provided in this way are: the abstract operations toobject, tointeger, and iscallable specified in the e
cmascript language specification. throwtypeerror, throwrangeerror, throwsyntaxerror, which self-hosted code should use instead of throw so that the error message is specified in js.msg and can be localized. the makeconstructible function described above. the file utilities.js provides some additional, js-implemented helper functions. of note, it provides implementations of list and record, types...
...specification. throwtypeerror, throwrangeerror, throwsyntaxerror, which self-hosted code should use instead of throw so that the error message is specified in js.msg and can be localized. the makeconstructible function described above. the file utilities.js provides some additional, js-implemented helper functions. of note, it provides implementations of list and record, types defined in the e
cmascript specifications that are similar to array and object, but can't be modified by application code. the selfhostingdefines.h header contains adding self-hosted functions to host objects first, the code has to be embedded into spidermonkey. the easiest way to accomplish that is to add the code to a pre-existing .js file in builtin/. if it doesn't fit into any of those, create a new .js file ...
Property attributes
any object property can have zero or more property attributes set. some property attributes are defined in the e
cmascript standard, in e
cma 262-3 §8.6.1. spidermonkey additionally defines several non-standard property attributes. the jsapi expresses property attributes as a value of type unsigned, the bitwise or of zero or more of the jsprop flags described below. an application can set property attributes when creating a property. see js_defineproperty, js_fs, and js_fn flag description jsprop_enumerate the property is visible to javascript for...in and for each ... in loops, as well as to js_enumerate. this is the inverse of the e
cma standard dontenum attribute. mxr id search for jsprop_enumerate jsprop_readonly the proper...
...visible to javascript for...in and for each ... in loops, as well as to js_enumerate. this is the inverse of the e
cma standard dontenum attribute. mxr id search for jsprop_enumerate jsprop_readonly the property's value cannot be set. in javascript 1.2 and lower, it is an error to attempt to assign a value to a read-only property. in javascript 1.3 and higher, as in e
cmascript, attempts to set a value on a read-only property are ignored. this is the e
cma standard readonly attribute. mxr id search for jsprop_readonly jsprop_permanent the property cannot be deleted. in javascript 1.2 and lower, it is an error to attempt to delete a permanent property. in javascript 1.3 and higher, as in e
cmascript, such attempts are ignored. thi...
... the javascript language does not provide any way for a script to delete a permanent property. ...
Parser API
of the spidermonkey parser, made available as a javascript api. this makes it easier to write tools in javascript that manipulate javascript source programs, such as syntax highlighters, static analyses, translators, compilers, obfuscators, etc. note: this page describes spidermonkey-specific behavior and might be incomplete. visit estree spec for a community ast standard that includes latest e
cmascript features and is backward-compatible with spidermonkey format. example: > var expr = reflect.parse("obj.foo + 42").body[0].expression > expr.left.property ({loc:null, type:"identifier", name:"foo"}) > expr.right ({loc:{source:null, start:{line:1, column:10}, end:{line:1, column:12}}, type:"literal", value:42}) it is also available since firefox 7; it can be imported into the global obj...
...ght: expression; body: statement; } a for/of statement. interface letstatement <: statement { type: "letstatement"; head: [ variabledeclarator ]; body: statement; } a let statement. note: the let statement form is spidermonkey-specific. interface debuggerstatement <: statement { type: "debuggerstatement"; } a debugger statement. note: the debugger statement is new in e
cmascript 5th edition, although spidermonkey has supported it for years. declarations interface declaration <: statement { } any declaration node. note that declarations are considered statements; this is because declarations can appear in any statement context in the language recognized by the spidermonkey parser. note: declarations in arbitrary nested scopes are spidermonkey-specific. interf...
...mentoperator { "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" } an assignment operator token. enum updateoperator { "++" | "--" } an update (increment or decrement) operator token. e4x this section describes node types that are provided for e4x support. e4x has since been removed as of gecko 21. note: e4x is not part of the e
cmascript standard (e
cma-262), but is a separate standard of its own (e
cma-357). declarations interface xmldefaultdeclaration <: declaration { type: "xmldefaultdeclaration"; namespace: expression; } a default xml namespace declaration. expressions interface xmlanyname <: expression { type: "xmlanyname"; } the special e4x wildcard pseudo-identifier *. interface xmlqualifiedidenti...
nsDirectoryService
is component is a singleton and should therefore be accessed via the xpcom service manager. example code #include "nsxpcom.h" #include "nscomptr.h" #include "nsdirectoryservicedefs.h" #include "nsiservicemanager.h" #include "nsiproperties.h" /** * get the location of the system's "temp" directory. ...
... accessed via the xpcom service manager. example code #include "nsxpcom.h" #include "nscomptr.h" #include "nsdirectoryservicedefs.h" #include "nsiservicemanager.h" #include "nsiproperties.h" /** * get the location of the system's "temp" directory. ...
...nscomptr.h" #include "nsdirectoryservicedefs.h" #include "nsiservicemanager.h" #include "nsiproperties.h" /** * get the location of the system's "temp" directory. ...
nsICategoryManager
tegory's entry. this pointer must be released using nsimemory.free() when it is no longer needed. exceptions thrown ns_error_not_available indicates that either the category or entry is undefined. examples print out a list of all categories this snippet shows how to print out a list of all categories in c++. ...
... nsimemory.free() when it is no longer needed. exceptions thrown ns_error_not_available indicates that either the category or entry is undefined. examples print out a list of all categories this snippet shows how to print out a list of all categories in c++. ...
...indicates that either the category or entry is undefined. examples print out a list of all categories this snippet shows how to print out a list of all categories in c++. ...
DOM Inspector internals - Firefox Developer Tools
besides the dom inspector's primary ui, there are a couple other top-level inspectors which differ slightly (the object inspector and dom inspector sidebar used in seamonkey). ...
...ects of development changes can be seen by simply switching away from the current viewer and back. knowing this about the way viewers are written, we should now be at a place where we can look at the way the dom inspector source is organized. source code organization the contents of the top-level directory for the dom inspector repository should look like base/ js/ inspector-
cmdline.js makefile.in build/ install.js makefile.in resources/ content/ … locale/ … skin/ … makefile.in install.rdf jar.mn makefile.in makefiles.sh almost all the interesting stuff is in resources/content/. its contents should resemble the following: extensions/ … ...
...on overlays, and others as shared structure overlays. host-integration overlays dom inspector is a general-purpose extension, suitable for use with any mozilla toolkit host application. in order for dom inspector to be useful with its host application, though, there should be a way to launch dom inspector within it, e.g., by a menu item and an optional keyboard shortcut such as ctrl+shift+i (or
cmd+shift+i). either the host applications must provide these themselves (usually bundling dom inspector with the application, too), or dom inspector must explicitly support them by providing its own menu items and keyboard shortcuts with host-integration overlays. dom inspector explicitly supports several mozilla project applications by providing its own host-integration overlays. these overlays a...
Set a breakpoint - Firefox Developer Tools
unconditional breakpoints an unconditional breakpoint is one where the code will always pause execution when it is reached. you can set an unconditional breakpoint using the context menu (see above), or by: clicking on the line number for the line you want to break at in the source pane. highlighting the line you want to break at in the source pane and pressing ctrl + b (windows/linux) or
cmd + b (macos). the line number is highlighted in blue: in addition, if the line contains multiple function calls, each one will be given a small blue arrow icon to the left of it. these are called column breakpoints, and allow you to set the breakpoint to happen exactly on any one of the function calls in the line (or multiple calls), by clicking on each relevant one. conditional breakpoints...
...nt one. conditional breakpoints a conditional breakpoint is one where the code will pause execution when it is reached, only if a certain condition is met, such a variable having a certain value at the time. you can set a conditional breakpoint using the context menu (see above), or by highlighting the line you want to break at in the source pane and pressing ctrl + shift + b (windows/linux) or
cmd + shift + b (macos). when you first choose to set a conditional breakpoint, a text entry line will appear into which you add the condition you want it to break on: once you've entered your condition and pressed enter/return, the line number will be highlighted in orange: breakpoints list once you've set some breakpoints, the breakpoints list in the right-hand column shows the filename an...
...ighted in orange: breakpoints list once you've set some breakpoints, the breakpoints list in the right-hand column shows the filename and line number for each one: unsetting a breakpoint once a breakpoint has been set, you can unset it again in various ways: click on the line number highlight. highlight the line of code the breakpoint is set on and pressing ctrl + b (windows/linux) or
cmd + b (macos). bring up the context menu over the line highlight and choose the remove breakpoint option. other context menu options worth mentioning are: disable breakpoint: turn it off, but don't remove it completely. disable breakpoints on line and remove breakpoints on line: remove or disable column breakpoints. if the breakpoint is an unconditional breakpoint, you'll get an option a...
Debugger.Frame - Firefox Developer Tools
ns, the location is a call. when an onpop call reports the completion of a construction call (that is, a function called via the new operator), the completion value passed to the handler describes the value returned by the function body. if this value is not an object, it may be different from the value produced by the new expression, which will be the value of the frame’s this property. (in e
cmascript terms, the onpop handler receives the value returned by the [[call]] method, not the value returned by the [[construct]] method.) when a debugger handler function forces a frame to complete early, by returning a { return:... }, { throw:... }, or null resumption value, spidermonkey calls the frame’s onpop handler, if any. the completion value passed in this case reflects the resumption ...
...ndler methods, breakpoints, and so on remain active during the call. this function follows the invocation function conventions. codeis interpreted as strict mode code when it contains a use strict directive, or the code executing in this frame is strict mode code. ifcode is not strict mode code, then variable declarations incode affect the environment of this frame. (in the terms used by the e
cmascript specification, the variableenvironment of the execution context for the eval code is the variableenvironment of the execution context that this frame represents.) if implementation restrictions prevent spidermonkey from extending this frame’s environment as requested, this call throws an error exception. if given,options should be an object whose properties specify details of how the e...
...de to introduce temporary bindings that are visible to the given debuggee code and which refer to debugger-held debuggee values, and do so without mutating any existing debuggee environment. note that, like eval, declarations in thecode passed to evalwithbindings affect the environment of this frame, even as that environment is extended by bindings visible withincode. ...
Debugger.Object - Firefox Developer Tools
properties of the debugger.object prototype a debugger.object instance inherits the following accessor properties from its prototype: proto the referent’s prototype (as a new debugger.object instance), or null if it has no prototype. this accessor may throw if the referent is a scripted proxy or some other sort of exotic object (an opaque wrapper, for example). class a string naming the e
cmascript [[class]] of the referent. callable true if the referent is a callable object (such as a function or a function proxy); false otherwise. name the name of the referent, if it is a named function. if the referent is an anonymous function, or not a function at all, this is undefined. this accessor returns whatever name appeared after the function keyword in the source code, regardless...
...bject it was bound to. if the referent is either not a bound function, not a debuggee function, or not a function at all, this is undefined. isproxy if the referent is a (scripted) proxy, either revoked or not, return true. if the referent is not a (scripted) proxy, return false. proxytarget if the referent is a non-revoked (scripted) proxy, return a debugger.object instance referring to the e
cmascript [[proxytarget]] of the referent. if the referent is a revoked (scripted) proxy, return null. if the referent is not a (scripted) proxy, return undefined. proxyhandler if the referent is a non-revoked (scripted) proxy, return a debugger.object instance referring to the e
cmascript [[proxyhandler]] of the referent. if the referent is a revoked (scripted) proxy, return null. if the referent ...
...bugger code to introduce temporary bindings that are visible to the given debuggee code and which refer to debugger-held debuggee values, and do so without mutating any existing debuggee environment. note that, like executeinglobal, any declarations it contains affect the referent global object, even ascode is evaluated in an environment extended according tobindings. (in the terms used by the e
cmascript specification, the variableenvironment of the execution context forcode is the referent, and thebindings appear in a new declarative environment, which is the eval code’s lexicalenvironment.) theoptions argument is as for debugger.frame.prototype.eval. asenvironment() if the referent is a global object, return the debugger.environment instance representing the referent’s global l...
Debugger.Object - Firefox Developer Tools
, the referent remains live. this means that garbage collection has no visible effect on debugger.object instances. accessor properties of the debugger.object prototype a debugger.object instance inherits the following accessor properties from its prototype: proto the referent's prototype (as a new debugger.object instance), or null if it has no prototype. class a string naming the e
cmascript [[class]] of the referent. callable true if the referent is a callable object (such as a function or a function proxy); false otherwise. name the name of the referent, if it is a named function. if the referent is an anonymous function, or not a function at all, this is undefined. this accessor returns whatever name appeared after the function keyword in the source code, rega...
...ints, watchpoints, and so on remain active during the call. this function follows the invocation function conventions. if the referent is not a global object, throw a typeerror exception. codeis interpreted as strict mode code when it contains a use strict directive. ifcode is not strict mode code, then variable declarations incode affect the referent global object. (in the terms used by the e
cmascript specification, the variableenvironment of the execution context for the eval code is the referent.) theoptions argument is as for debugger.frame.prototype.eval. evalinglobalwithbindings(code,bindings, [options]) like evalinglobal, but evaluatecode using the referent as the variable object, but with a lexical environment extended with bindings from the objectbindings. for each own e...
...debuggee code and which refer to debugger-held debuggee values, and do so without mutating any existing debuggee environment. note that, like evalinglobal, if the code passed to evalinglobalwithbindings is not strict mode code, then any declarations it contains affect the referent global object, even ascode is evaluated in an environment extended according tobindings. (in the terms used by the e
cmascript specification, the variableenvironment of the execution context for non-strict eval code is the referent, and thebindings appear in a new declarative environment, which is the eval code's lexicalenvironment.) theoptions argument is as for debugger.frame.prototype.eval. asenvironment() if the referent is a global object, return the debugger.environment instance representing the refe...
The JavaScript input interpreter - Firefox Developer Tools
you to finish your input. for example, if you type: function foo() { and then enter, the console does not immediately execute the input, but behaves as if you had pressed shift+enter , so you can finish entering the function definition. multi-line mode for multi-line entry, click the "split pane" icon at the right hand side of the single-line entry field, or press ctrl+b (windows/linux) or
cmd+b (macos). the multi-line editing pane opens on the left side the of web console. you can enter multiple lines of javascript by default in this mode, pressing enter after each one. to execute the snippet that is currently in the editing pane, click the run button or press ctrl+enter (or
cmd+return on macos). the snippet is echoed under the input prompt (in the right-side pane), followed by th...
...only the first five lines are echoed in the console, preceeded by a disclosure triangle (or "twistie"), and followed by an ellipsis (…). click anywhere in the area containing the echoed code to show the whole snippet; click again in that area to collapse it. you can open files when in multi-line mode, and save the current contents of the editing pane to a file. to open a file, press ctrl+o (
cmd+o on macos). a file dialog box opens so you can select the file to open. to save the contents of the editing pane, press ctrl+s (
cmd+s on macos). a file dialog box opens so you can specify the location to save to. to switch back to single-line mode, click the x icon at the top of the multi-line editing pane, or press ctrl+b (windows/linux) or
cmd+b (macos). accessing variables you can acce...
...ws. in multi-line mode, use the ⋀ and ⋁ icons in the editing panel's toolbar. the expression history is persisted across sessions. to clear the history, use the clearhistory() helper function. you can initiate a reverse search through the expression history, much like you can in bash on linux and mac or powershell on windows. on windows and linux press f9. on mac press ctrl+r (note: not
cmd+r!) to initiate the reverse search. enter the text you want to search for in the input box at the bottom of the console. start typing part of the expression you are looking for and the first match is displayed in the console. repeatedly typing f9 on windows and linux ( ctrl+r on mac) cycles backwards through the matches. once you have initiated the reverse search, you can use shift + f9 o...
AudioBuffer - Web APIs
text.createbuffer(). once put into an audiobuffer, the audio can then be played by being passed into an audiobuffersourcenode. objects of these types are designed to hold small audio snippets, typically less than 45 s. for longer sounds, objects implementing the mediaelementaudiosourcenode are more suitable. the buffer contains data in the following format: non-interleaved ieee754 32-bit linear p
cm with a nominal range between -1 and +1, that is, 32bits floating point buffer, with each samples between -1.0 and 1.0. if the audiobuffer has multiple channels, they are stored in separate buffer. constructor audiobuffer() creates and returns a new audiobuffer object instance. properties audiobuffer.samplerate read only returns a float representing the sample rate, in samples per seco...
...nal range between -1 and +1, that is, 32bits floating point buffer, with each samples between -1.0 and 1.0. if the audiobuffer has multiple channels, they are stored in separate buffer. constructor audiobuffer() creates and returns a new audiobuffer object instance. properties audiobuffer.samplerate read only returns a float representing the sample rate, in samples per second, of the p
cm data stored in the buffer. audiobuffer.length read only returns an integer representing the length, in sample-frames, of the p
cm data stored in the buffer. audiobuffer.duration read only returns a double representing the duration, in seconds, of the p
cm data stored in the buffer. audiobuffer.numberofchannels read only returns an integer representing the number of discrete audio channels ...
...e buffer. audiobuffer.length read only returns an integer representing the length, in sample-frames, of the p
cm data stored in the buffer. audiobuffer.duration read only returns a double representing the duration, in seconds, of the p
cm data stored in the buffer. audiobuffer.numberofchannels read only returns an integer representing the number of discrete audio channels described by the p
cm data stored in the buffer. methods audiobuffer.getchanneldata() returns a float32array containing the p
cm data associated with the channel, defined by the channel parameter (with 0 representing the first channel). audiobuffer.copyfromchannel() copies the samples from the specified channel of the audiobuffer to the destination array. audiobuffer.copytochannel() copies the samples to the ...
DirectoryReaderSync - Web APIs
window.webkitresolvelocalfilesystemurl; // 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. console.log(fileentry.name); }); }); }; worker.postmessage({'
cmd': 'list'}); the following is worker.js code that gets the contents of the directory. // taking care of the browser-specific prefixes. self.requestfilesystemsync = self.webkitrequestfilesystemsync || self.requestfilesystemsync; // global for holding the list of entry file system urls. var paths = []; function getallentries(dirreader) { var entries = dirreader.r...
...y's filesystem in url paths.push(entry.tourl()); // if this is a directory, traverse. if (entry.isdirectory) { getallentries(entry.createreader()); } } } // forward the error to main app. function onerror(e) { postmessage('error: ' + e.tostring()); } self.onmessage = function(e) { var data = e.data; // ignore everything else except our 'list' command. ...
...em in url paths.push(entry.tourl()); // if this is a directory, traverse. if (entry.isdirectory) { getallentries(entry.createreader()); } } } // forward the error to main app. function onerror(e) { postmessage('error: ' + e.tostring()); } self.onmessage = function(e) { var data = e.data; // ignore everything else except our 'list' command. if (!data.
cmd || data.
cmd != 'list') { return; } try { var fs = requestfilesystemsync(temporary, 1024*1024 /*1mb*/); getallentries(fs.root.createreader()); self.postmessage({entries: paths}); } catch (e) { onerror(e); } }; method overview entrysync readentries () raises (fileexception); method readentries() returns a lost of entries from a specific directory. call this ...
SubtleCrypto.importKey() - Web APIs
jsonwebkey object containing the key in the given format. algorithm is a dictionary object defining the type of key to import and providing extra algorithm-specific parameters. for rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep: pass an rsahashedimportparams object. for ecdsa or ecdh: pass an eckeyimportparams object. for hmac: pass an hmacimportparams object. for aes-ctr, aes-cbc, aes-g
cm, or aes-kw: pass the string identifying the algorithm or an object of the form { "name": algorithm }, where algorithm is the name of the algorithm. for pbkdf2 : pass the string pbkdf2. extractable is a boolean indicating whether it will be possible to export the key using subtlecrypto.exportkey() or subtlecrypto.wrapkey(). keyusages is an array indicating what can be done with the key. ...
... on github. const rawkey = window.crypto.getrandomvalues(new uint8array(16)); /* import an aes secret key from an arraybuffer containing the raw bytes. takes an arraybuffer string containing the bytes, and returns a promise that will resolve to a cryptokey representing the secret key. */ function importsecretkey(rawkey) { return window.crypto.subtle.importkey( "raw", rawkey, "aes-g
cm", true, ["encrypt", "decrypt"] ); } pkcs #8 import this example imports an rsa private signing key from a pem-encoded pkcs #8 object. see the complete code on github. /* convert a string into an arraybuffer from https://developers.google.com/web/updates/2012/06/how-to-convert-arraybuffer-to-and-from-string */ function str2ab(str) { const buf = new arraybuffer(str.length); const b...
...i++) { bufview[i] = str.charcodeat(i); } return buf; } const pemencodedkey = `-----begin public key----- miibijanbgkqhkig9w0baqefaaocaq8amiibcgkcaqeay3xo3u13dc+xojwqywojlcboq5fovy8llnqcjm1w1bftxihoajwohihuirmctv7dzx47tllmarskvtrjd0df92jx/xy20lz+dxp8yl5yuwafga3xko3lsjgeoex10nb8jfkmgsb7qiudtvvbbudfd5fwibmctacwwx7nyewwdb7a9cfxj7ejrdrdak3ux/tomlhfxvlqsl341tkcf4zqoz96rfpugpplofvn0x66
cm1pqckdhzje6u5xge964zkkyuppsy6dcie4obhw4vdjgumlzv0z7ud010rlineugde2fqbfy/c+uwignpbpkkq+bv/uigs6dhqtcved5wgybqidaqab -----end public key-----`; function importrsakey(pem) { // fetch the part of the pem string between header and footer const pemheader = "-----begin public key-----"; const pemfooter = "-----end public key-----"; const pemcontents = pem.substring(pemheader.length, pe...
Color picker tool - CSS: Cascading Style Sheets
gba(x, c, m); return; } if (h >= 2 && h < 3) { this.setrgba(m, c, x); return; } if (h >= 3 && h < 4) { this.setrgba(m, x, c); return; } if (h >= 4 && h < 5) { this.setrgba(x, m, c); return; } if (h >= 5 && h < 6) { this.setrgba(c, m, x); return; } }; color.prototype.rgbtohsv = function rgbtohsv() { var red = this.r / 255; var green = this.g / 255; var blue = this.b / 255; var
cmax = math.max(red, green, blue); var
cmin = math.min(red, green, blue); var delta =
cmax -
cmin; var hue = 0; var saturation = 0; if (delta) { if (
cmax === red ) { hue = ((green - blue) / delta); } if (
cmax === green ) { hue = 2 + (blue - red) / delta; } if (
cmax === blue ) { hue = 4 + (red - green) / delta; } if (
cmax) saturation = delta /
cmax; } this.hue = 60 * hue |...
... var hue = 0; var saturation = 0; if (delta) { if (
cmax === red ) { hue = ((green - blue) / delta); } if (
cmax === green ) { hue = 2 + (blue - red) / delta; } if (
cmax === blue ) { hue = 4 + (red - green) / delta; } if (
cmax) saturation = delta /
cmax; } this.hue = 60 * hue | 0; if (this.hue < 0) this.hue += 360; this.saturation = (saturation * 100) | 0; this.value = (
cmax * 100) | 0; }; color.prototype.rgbtohsl = function rgbtohsl() { var red = this.r / 255; var green = this.g / 255; var blue = this.b / 255; var
cmax = math.max(red, green, blue); var
cmin = math.min(red, green, blue); var delta =
cmax -
cmin; var hue = 0; var saturation = 0; var lightness = (
cmax +
cmin) / 2; var x = (1 - math.abs(2 * lightness - 1)); if (delta) { ...
... 100) | 0; }; color.prototype.rgbtohsl = function rgbtohsl() { var red = this.r / 255; var green = this.g / 255; var blue = this.b / 255; var
cmax = math.max(red, green, blue); var
cmin = math.min(red, green, blue); var delta =
cmax -
cmin; var hue = 0; var saturation = 0; var lightness = (
cmax +
cmin) / 2; var x = (1 - math.abs(2 * lightness - 1)); if (delta) { if (
cmax === red ) { hue = ((green - blue) / delta); } if (
cmax === green ) { hue = 2 + (blue - red) / delta; } if (
cmax === blue ) { hue = 4 + (red - green) / delta; } if (
cmax) saturation = delta / x; } this.hue = 60 * hue | 0; if (this.hue < 0) this.hue += 360; this.saturation = (saturation * 100) | 0; this.lightness = (lightness * 100) | 0; }; /*========== get methods ========...
Linear-gradient Generator - CSS: Cascading Style Sheets
gba(x, c, m); return; } if (h >= 2 && h < 3) { this.setrgba(m, c, x); return; } if (h >= 3 && h < 4) { this.setrgba(m, x, c); return; } if (h >= 4 && h < 5) { this.setrgba(x, m, c); return; } if (h >= 5 && h < 6) { this.setrgba(c, m, x); return; } }; color.prototype.rgbtohsv = function rgbtohsv() { var red = this.r / 255; var green = this.g / 255; var blue = this.b / 255; var
cmax = math.max(red, green, blue); var
cmin = math.min(red, green, blue); var delta =
cmax -
cmin; var hue = 0; var saturation = 0; if (delta) { if (
cmax === red ) { hue = ((green - blue) / delta); } if (
cmax === green ) { hue = 2 + (blue - red) / delta; } if (
cmax === blue ) { hue = 4 + (red - green) / delta; } if (
cmax) saturation = delta /
cmax; } this.hue = 60 * hue |...
... var hue = 0; var saturation = 0; if (delta) { if (
cmax === red ) { hue = ((green - blue) / delta); } if (
cmax === green ) { hue = 2 + (blue - red) / delta; } if (
cmax === blue ) { hue = 4 + (red - green) / delta; } if (
cmax) saturation = delta /
cmax; } this.hue = 60 * hue | 0; if (this.hue < 0) this.hue += 360; this.saturation = (saturation * 100) | 0; this.value = (
cmax * 100) | 0; }; color.prototype.rgbtohsl = function rgbtohsl() { var red = this.r / 255; var green = this.g / 255; var blue = this.b / 255; var
cmax = math.max(red, green, blue); var
cmin = math.min(red, green, blue); var delta =
cmax -
cmin; var hue = 0; var saturation = 0; var lightness = (
cmax +
cmin) / 2; var x = (1 - math.abs(2 * lightness - 1)); if (delta) { ...
... 100) | 0; }; color.prototype.rgbtohsl = function rgbtohsl() { var red = this.r / 255; var green = this.g / 255; var blue = this.b / 255; var
cmax = math.max(red, green, blue); var
cmin = math.min(red, green, blue); var delta =
cmax -
cmin; var hue = 0; var saturation = 0; var lightness = (
cmax +
cmin) / 2; var x = (1 - math.abs(2 * lightness - 1)); if (delta) { if (
cmax === red ) { hue = ((green - blue) / delta); } if (
cmax === green ) { hue = 2 + (blue - red) / delta; } if (
cmax === blue ) { hue = 4 + (red - green) / delta; } if (
cmax) saturation = delta / x; } this.hue = 60 * hue | 0; if (this.hue < 0) this.hue += 360; this.saturation = (saturation * 100) | 0; this.lightness = (lightness * 100) | 0; }; /*========== get methods ========...
background-position - CSS: Cascading Style Sheets
examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...*/ .examplethree { background-image: url("https://mdn.mozillademos.org/files/11987/startransparent.gif"), ...
perspective() - CSS: Cascading Style Sheets
be represented on the plane. this transformation is not a linear transformation in ℝ3, and can't be represented using a cartesian-coordinate matrix. ...
...01000−1/d1 examples html <p>without perspective:</p> <div class="no-perspective-box"> <div class="face front">a</div> <div class="face top">b</div> <div class="face left">c</div> </div> <p>with perspective (9
cm):</p> <div class="perspective-box-far"> <div class="face front">a</div> <div class="face top">b</div> <div class="face left">c</div> </div> <p>with perspective (4
cm):</p> <div class="perspective-box-closer"> <div class="face front">a</div> <div class="face top">b</div> <div class="face left">c</div> </div> css .face { position: absolute; width: 100px; height: 100px; line-height: 100px; font-size: 100px; text-align: center; } p + div { width: 100px; height: 100px; transform-style: preserve-3d; margin-left: 100px; } .no-perspectiv...
...div> <div class="face left">c</div> </div> css .face { position: absolute; width: 100px; height: 100px; line-height: 100px; font-size: 100px; text-align: center; } p + div { width: 100px; height: 100px; transform-style: preserve-3d; margin-left: 100px; } .no-perspective-box { transform: rotatex(-15deg) rotatey(30deg); } .perspective-box-far { transform: perspective(9
cm) rotatex(-15deg) rotatey(30deg); } .perspective-box-closer { transform: perspective(4
cm) rotatex(-15deg) rotatey(30deg); } .top { background-color: skyblue; transform: rotatex(90deg) translate3d(0, 0, 50px); } .left { background-color: pink; transform: rotatey(-90deg) translate3d(0, 0, 50px); } .front { background-color: limegreen; transform: translate3d(0, 0, 50px); } result ...
transform-origin - CSS: Cascading Style Sheets
ue. this means, this definition transform-origin: -100% 50%; transform: rotate(45deg); results in the same transformation as transform-origin: 0 0; transform: translate(-100%, 50%) rotate(45deg) translate(100%, -50%); by default, the origin of a transform is center. ...
...offsets that are not explicitly defined are reset to their corresponding initial values...
...offsets that are not explicitly defined are reset to their corresponding initial values. if two or more values are defined and either no value is a keyword, or the only used ke...
MIME types (IANA media types) - HTTP
d valid, and using any of those may result in scripts that do not load or run. ...
...those may result in scripts that do not load or run. for historical reasons, the mime sniffing standard (the definition of how browsers should interpret media types and figure out what to do with content that doesn't have a valid one) allows javascript to be served using any mime type that essentially matches any of the following: application/javascript application/e
cmascript application/x-e
cmascript application/x-javascript text/javascript text/e
cmascript text/javascript1.0 text/javascript1.1 text/javascript1.2 text/javascript1.3 text/javascript1.4 text/javascript1.5 text/jscript text/livescript text/x-e
cmascript text/x-javascript note: even though any given user agent may support any or all of these, you should only use text/javascript. it's th...
...level, or other such information. the most commonly used mime types used for web content are listed below. this isn't a complete list of all the types that may be available, however. see the media container formats guide for that. mime type audio or video type audio/wave audio/wav audio/x-wav audio/x-pn-wav an audio file in the wave container format. the p
cm audio codec (wave codec "1") is often supported, but other codecs have limited support (if any). audio/webm an audio file in the webm container format. vorbis and opus are the codecs officially supported by the webm specification. video/webm a video file, possibly with audio, in the webm container format. vp8 and vp9 are the most common video codecs; vorbis and opus the mo...
Control flow and error handling - JavaScript
block statement the most basic statement is a block statement, which is used to group statements. the block is delimited by a pair of curly brackets: { statement_1; statement_2; ⋮ statement_n; } example block statements are commonly used with control flow statements (if, for, while). while (x < 10) { x++; } here, { x++; } is the block statement. important: javascript before e
cmascript2015 (6th edition) does not have block scope! in older javascript, variables introduced within a block are scoped to the containing function or script, and the effects of setting them persist beyond the block itself. in other words, block statements do not define a scope. "standalone" blocks in javascript can produce completely different results from what they would produce in c or java. ...
...t define a scope. "standalone" blocks in javascript can produce completely different results from what they would produce in c or java. for example: var x = 1; { var x = 2; } console.log(x); // outputs 2 this outputs 2 because the var x statement within the block is in the same scope as the var x statement before the block. (in c or java, the equivalent code would have outputted 1.) since e
cmascript2015, the let and const variable declarations are block-scoped. see the let and const reference pages for more information. conditional statements a conditional statement is a set of commands that executes if a specified condition is true. javascript supports two conditional statements: if...else and switch. if...else statement use the if statement to execute a statement if a logical c...
...hrow statement and handle them using the try...catch statements. throw statement try...catch statement exception types just about any object can be thrown in javascript. nevertheless, not all thrown objects are created equal. while it is common to throw numbers or strings as errors, it is frequently more effective to use one of the exception types specifically created for this purpose: e
cmascript exceptions domexception and domerror throw statement use the throw statement to throw an exception. a throw statement specifies the value to be thrown: throw expression; you may throw any expression, not just expressions of a specific type. the following code throws several exceptions of varying types: throw 'error2'; // string type throw 42; // number type throw true; ...
Character classes - JavaScript
cal tab. \f matches a form-feed. [\b] matches a backspace. if you're looking for the word-boundary character (\b), see boundaries. \0 matches a nul character. do not follow this with another digit. \cx matches a control character using caret notation, where "x" is a letter from a–z (corresponding to codepoints u+0001–u+001f). for example, /\
cm/ matches "\r" in "\r\n". \xhh matches the character with the code hh (two hexadecimal digits). \uhhhh matches a utf-16 code-unit with the value hhhh (four hexadecimal digits). \u{hhhh} or \u{hhhhh} (only when the u flag is set.) matches the character with the unicode value u+hhhh or u+hhhhh (hexadecimal digits). \ indicates that the followi...
... ...
... ...
Unicode property escapes - JavaScript
if a character is used in a limited set of scripts, the script property will only match for the "predominant" used script. if we want to match characters based on a "non-predominant" script, we could use the script_extensions property (scx for short). // ٢ is the digit 2 in arabic-indic notation // while it is predominantly written within the arabic script // it can also ...
... ...
... ...
Inheritance and the prototype chain - JavaScript
bags" of properties (referred to as own properties). javascript objects have a link to a prototype object. when trying to access a property of an object, the property will not only be sought on the object but on the prototype of the object, the prototype of the prototype, and so on until either a property with a matching name is found or the end of the prototype chain is reached. following the e
cmascript standard, the notation someobject.[[prototype]] is used to designate the prototype of someobject. since e
cmascript 2015, the [[prototype]] is accessed using the accessors object.getprototypeof() and object.setprototypeof(). this is equivalent to the javascript property __proto__ which is non-standard but de-facto implemented by many browsers. it should not be confused with the func.protot...
..."just" a function that happens to be called with the new operator. function graph() { this.vertices = []; this.edges = []; } graph.prototype = { addvertex: function(v) { this.vertices.push(v); } }; var g = new graph(); // g is an object with own properties 'vertices' and 'edges'. // g.[[prototype]] is the value of graph.prototype when new graph() is executed. with object.create e
cmascript 5 introduced a new method: object.create(). calling this method creates a new object. the prototype of this object is the first argument of the function: var a = {a: 1}; // a ---> object.prototype ---> null var b = object.create(a); // b ---> a ---> object.prototype ---> null console.log(b.a); // 1 (inherited) var c = object.create(b); // c ---> b ---> a ---> object.prototype ---> null ...
...the new keywords include class, constructor, static, extends, and super. 'use strict'; class polygon { constructor(height, width) { this.height = height; this.width = width; } } class square extends polygon { constructor(sidelength) { super(sidelength, sidelength); } get area() { return this.height * t...
Method definitions - JavaScript
it is a shorthand for a function assigned to the method's name. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... given the following code: const obj = { foo: function() { // ... }, bar: function() { // ... } } you are now able to shorten this to: const obj = { foo() { // ... }, bar() { // ... } } generator methods generator methods can be defined using the shorthand syntax as well. when doing so: the asterisk (*) in the shorthand syntax must be befor...
...syntax also supports computed property names. const bar = { foo0: function() { return 0 }, foo1() { return 1 }, ['foo' + 2]() { return 2 } } console.log(bar.foo0()) // 0 console.log(bar.foo1()) // 1 console.log(bar.foo2()) // 2 // a global function function foo() { return 1 } let name = 'foo' console.log(window[name]()) // 1 specifications specification e
cmascript (e
cma-262)the definition of 'method definitions' in that specification. ...
getter - JavaScript
ed up. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax {get prop() { ... } } {get [expression]() { ... } } parameters prop the name of the property to bind to the given function. expression starting with e
cmascript 2015, you can also use expressions for a computed property name to bind to the given function. description sometimes it is desirable to allow access to a property that returns a dynamically computed value, or you may want to reflect the status of an internal variable without requiring the use of explicit method calls. in javascript, this can be accomplished with the use of a getter. it...
... ...
... ...
setter - JavaScript
ke to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax {set prop(val) { . . . }} {set [expression](val) { . . . }} parameters prop the name of the property to bind to the given function. val an alias for the variable that holds the value attempted to be assigned to prop. expression starting with e
cmascript 2015, you can also use expressions for a computed property name to bind to the given function. description in javascript, a setter can be used to execute a function whenever a specified property is attempted to be changed. setters are most often used in conjunction with getters to create a type of pseudo-property. it is not possible to simultaneously have a setter on a property that hol...
... ...
... ...
Array.prototype.find() - JavaScript
he first invocation of callback. therefore: callback will not visit any elements added to the array after the call to find begins. if an existing, yet-unvisited element of the array is changed by callback, its value passed to the callback will be the value at the time find visits that element's index. elements that are deleted are still visited. polyfill this method has been added to the e
cmascript 2015 specification and may not be available in all javascript implementations yet. however, you can polyfill array.prototype.find with the following snippet: // https://tc39.github.io/e
cma262/#sec-array.prototype.find if (!array.prototype.find) { object.defineproperty(array.prototype, 'find', { value: function(predicate) { // 1. let o be ? toobject(this value). if (this ...
... ...
... ...
Array.prototype.findIndex() - JavaScript
t before the first invocation of callback. callback will not process the elements appended to the array after the call to findindex() begins. if an existing, unvisited element of the array is changed by callback, its value passed to the callback will be the value at the time findindex() visits the element's index. elements that are deleted are still visited. polyfill // https://tc39.github.io/e
cma262/#sec-array.prototype.findindex if (!array.prototype.findindex) { object.defineproperty(array.prototype, 'findindex', { value: function(predicate) { // 1. let o be ? toobject(this value). if (this == null) { throw new typeerror('"this" is null or not defined'); } var o = object(this); // 2. let len be ? tolength(? get(o, "length")). var len = ...
... ...
... ...
Array.of() - JavaScript
y of 7 empty slots, not slots with actual undefined values). array.of(7); // [7] array.of(1, 2, 3); // [1, 2, 3] array(7); // array of 7 empty slots array(1, 2, 3); // [1, 2, 3] syntax array.of(element0[, element1[, ...[, elementn]]]) parameters elementn elements used to create the array. return value a new array instance. description this function is part of the e
cmascript 2015 standard. for more information, see: array.of() array.from() proposal array.of() polyfill polyfill running the following code before any other code will create array.of() if it's not natively available. if (!array.of) { array.of = function() { return array.prototype.slice.call(arguments); // or let vals = []; for(let prop in arguments){ vals.push(a...
... ...
... ...
Array.prototype.sort() - JavaScript
n (all undefined elements are sorted to the end of the array, with no call to comparefunction). if a and b are two elements being compared, then: if comparefunction(a, b) returns less than 0, sort a to an index lower than b (i.e. a comes first). if comparefunction(a, b) returns 0, leave a and b unchanged with respect to each other, but sorted with respect to all different elements. note: the e
cmascript standard does not guarantee this behavior, thus, not all browsers (e.g. mozilla versions dating back to at least 2003) respect this. if comparefunction(a, b) returns greater than 0, sort b to an index lower than a (i.e. b comes first). comparefunction(a, b) must always return the same value when given a specific pair of elements a and b as its two arguments. if inconsistent results are r...
... ...
... ...
Date() constructor - JavaScript
er than a date object. parameters there are four basic forms for the date() constructor: no parameters when no parameters are provided, the newly-created date object represents the current date and time as of the time of instantiation. time value or timestamp number value an integer value representing the number of milliseconds since january 1, 1970, 00:00:00 utc (the e
cmascript epoch, equivalent to the unix epoch), with leap seconds ignored. keep in mind that most unix timestamp functions are only accurate to the nearest second. timestamp string datestring a string value representing a date, specified in a format recognized by the date.parse() method. (these formats are ietf-compliant rfc 2822 timestamps, and also strings in a version of iso860...
... ...
... ...
Date.prototype.setUTCFullYear() - JavaScript
s january through december. dayvalue optional. an integer between 1 and 31 representing the day of the month. if you specify the dayvalue parameter, you must also specify the monthvalue. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the monthvalue and dayvalue parameters, the values returned from the getut
cmonth() and getutcdate() methods are used. if a parameter you specify is outside of the expected range, setutcfullyear() attempts to update the other parameters and the date information in the date object accordingly. for example, if you specify 15 for monthvalue, the year is incremented by 1 (yearvalue + 1), and 3 is used for the month. examples using setutcfullyear() var thebigday = new date(...
... ...
... ...
Date.prototype.setUTCHours() - JavaScript
svalue optional. a number between 0 and 999, representing the milliseconds. if you specify the msvalue parameter, you must also specify the minutesvalue and secondsvalue. return value the number of milliseconds between january 1, 1970 00:00:00 utc and the updated date. description if you do not specify the minutesvalue, secondsvalue, and msvalue parameters, the values returned from the getut
cminutes(), getutcseconds(), and getut
cmilliseconds() methods are used. if a parameter you specify is outside of the expected range, setutchours() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes will be incremented by 1 (minutesvalue + 1), and 40 will be used for seconds. examples using setutchours() var thebigday ...
... ...
... ...
Date.prototype.setUTCSeconds() - JavaScript
eobj.setutcseconds(secondsvalue[, msvalue]) parameters secondsvalue an integer between 0 and 59, representing the seconds. msvalue optional. a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if you do not specify the msvalue parameter, the value returned from the getut
cmilliseconds() method is used. if a parameter you specify is outside of the expected range, setutcseconds() attempts to update the date information in the date object accordingly. for example, if you use 100 for secondsvalue, the minutes stored in the date object will be incremented by 1, and 40 will be used for seconds. examples using setutcseconds() var thebigday = new date(); thebigday.setut...
... ...
... ...
Date.prototype.toString() - JavaScript
e interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.tostring() return value a string representing the given date. description date instances inherit their tostring() method from date.prototype, not object.prototype. date.prototype.tostring() returns a string representation of the date in the format specified in e
cma-262 which can be summarised as: week day: 3 letter english week day name, e.g. "sat" space month name: 3 letter english month name, e.g. "sep" space date: 2 digit day in month, e.g. "01" space year: 4 digit year, e.g. "2018" space hour: 2 digit hour of day, e.g. "14" colon minute: 2 digit minute of hour, e.g. "53" colon second: 2 digit second of minute, e.g. "26" space the strin...
...set, e.g. "00" optionally, a timezone name consisting of: space left bracket, i.e. "(" an implementation dependent string representation of the timezone, which might be an abbreviation or full name (there is no standard for names or abbreviations of timezones), e.g. "line islands time" or "lint" right bracket, i.e. ")" e.g. "sat sep 01 2018 14:53:26 gmt+1400 (lint)" until e
cmascript 2018 (edition 9), the format of the string returned by date.prototype.tostring was implementation dependent. therefore it should not be relied upon to be in the specified format. the tostring() method is automatically called when a date is to be represented as a text value, e.g. console.log(new date()), or when a date is used in a string concatenation, such as var today = 'today is ' + ne...
... date instances. if called on a non–date instance, a typeerror is thrown. examples using tostring() the following assigns the tostring() value of a date object to myvar: var x = new date(); var myvar = x.tostring(); // assigns a string value to myvar in the same format as: // mon sep 08 1998 14:36:22 gmt-0700 (pdt) specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.tostring' in that specification. ...
Date.prototype.toTimeString() - JavaScript
readable form in american english. in spidermonkey, this consists of the date portion (day, month, and year) followed by the time portion (hours, minutes, seconds, and time zone). sometimes it is desirable to obtain a string of the time portion; such a thing can be accomplished with the totimestring() method. the totimestring() method is especially useful because compliant engines implementing e
cma-262 may differ in the string obtained from tostring() for date objects, as the format is implementation-dependent; simple string slicing approaches may not produce consistent results across multiple engines. examples a basic usage of totimestring() var d = new date(1993, 6, 28, 14, 39, 7); console.log(d.tostring()); // wed jul 28 1993 14:39:07 gmt-0600 (pdt) console.log(d.totimestring())...
... ...
... ...
Date.prototype.toUTCString() - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.toutcstring() return value a string representing the given date using the utc time zone. ...
...as two digits with leading zero if required mmm month, as three letters (e.g. jan, feb, ...) yyyy year, as four or more digits with leading zeroes if required hh hour, as two digits with leading zero if required mm minute, as two digits with leading zero if required ss seconds, as two digits with leading zero if required prior to e
cmascript 2018, the format of the return value varied according to the platform. the most common return value was an rfc-1123 formatted date stamp, which is a slightly updated version of rfc-822 date stamps. examples using toutcstring() let today = new date('wed, 14 jun 2017 00:00:00 pdt'); let utcstring = today.toutcstring(); // wed, 14 jun 2017 07:00:00 gmt specifications specificat...
...format of the return value varied according to the platform. the most common return value was an rfc-1123 formatted date stamp, which is a slightly updated version of rfc-822 date stamps. examples using toutcstring() let today = new date('wed, 14 jun 2017 00:00:00 pdt'); let utcstring = today.toutcstring(); // wed, 14 jun 2017 07:00:00 gmt specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.toutcstring' in that specification. ...
EvalError() constructor - JavaScript
the evalerror object remains for compatibility. syntax new evalerror([message[, filename[, linenumber]]]) parameters message optional. human-readable description of the error filename optional. the name of the file containing the code that caused the exception linenumber optional. the line number of the code that caused the exception examples evalerror is not used in the current e
cmascript specification and will thus not be thrown by the runtime. however, the object itself remains for backwards compatibility with earlier versions of the specification. creating an evalerror try { throw new evalerror('hello', 'somefile.js', 10); } catch (e) { console.log(e instanceof evalerror); // true console.log(e.message); // "hello" console.log(e.name); ...
... ...
... ...
Function.prototype.apply() - JavaScript
l value seen by the method: if the method is a function in non-strict mode code, null and undefined will be replaced with the global object, and primitive values will be boxed. this argument is required. argsarray optional an array-like object, specifying the arguments with which func should be called, or null or undefined if no arguments should be provided to the function. starting with e
cmascript 5 these arguments can be a generic array-like object instead of an array. see below for browser compatibility information. return value the result of calling the function with the specified this value and arguments. description note: while the syntax of this function is almost identical to that of call(), the fundamental difference is that call() accepts an argument list, while app...
...also use arguments for the argsarray parameter. arguments is a local variable of a function. it can be used for all unspecified arguments of the called object. thus, you do not have to know the arguments of the called object when you use the apply method. you can use arguments to pass all the arguments to the called object. the called object is then responsible for handling the arguments. since e
cmascript 5th edition, you can also use any kind of object which is array-like. in practice, this means it's going to have a length property, and integer ("index") properties in the range (0..length - 1). for example, you could use a nodelist, or a custom object like { 'length': 2, '0': 'eat', '1': 'bananas' }. note: many older browsers—including chrome <17 and internet explorer <9—don't accep...
...ype.bind method. for example, imagine having an array like the following, to be used with date constructor: [2012, 11, 4]; in this case you have to write something like: new (function.prototype.bind.apply(date, [null].concat([2012, 11, 4])))(). this is not the best way to do things, and probably not to be used in any production environment. specifications specification e
cmascript (e
cma-262)the definition of 'function.prototype.apply' in that specification. ...
Intl.NumberFormat() constructor - JavaScript
he formatting style to use , the default is "decimal". "decimal" for plain number formatting. "currency" for currency formatting. "percent" for percent formatting "unit" for unit formatting unit the unit to use in unit formatting, possible values are core unit identifiers, defined in uts #35, part 2, section 6. a subset of units from the full list was selected for use in e
cmascript. pairs of simple units can be concatenated with "-per-" to make a compound unit. there is no default value; if the style is "unit", the unit property must be provided. unitdisplay the unit formatting style to use in unit formatting, the defaults is "short". "long" (e.g., 16 litres) "short" (e.g., 16 l) "narrow" (e.g., 16l) usegrouping whether to use grouping separ...
... ...
... ...
Intl - JavaScript
the intl object provides access to several constructors as well as functionality common to the internationalization constructors and other language sensitive functions. constructor properties intl.collator() constructor for collators, which are objects that enable language-sensitive string comparison. intl.datetimeformat() constructor for objects that enable language-sensitive date and time formatting. intl.displaynames() constructor for objects that enable the consistent translation of language, region and script display names. ...
... ...
... ...
Number.prototype.toPrecision() - JavaScript
.tofixed() method, which also applies to toprecision(). if the precision argument is omitted, behaves as number.prototype.tostring(). if the precision argument is a non-integer value, it is rounded to the nearest integer. exceptions rangeerror if precision is not between 1 and 100 (inclusive), a rangeerror is thrown. implementations are allowed to support larger and smaller values as well. e
cma-262 only requires a precision of up to 21 significant digits. examples using toprecision let numobj = 5.123456 console.log(numobj.toprecision()) // logs '5.123456' console.log(numobj.toprecision(5)) // logs '5.1235' console.log(numobj.toprecision(2)) // logs '5.1' console.log(numobj.toprecision(1)) // logs '5' numobj = 0.000123 console.log(numobj.toprecision()) // logs '0.0001...
... ...
... ...
Number - JavaScript
iables: const biggestnum = number.max_value const smallestnum = number.min_value const infinitenum = number.positive_infinity const neginfinitenum = number.negative_infinity const notanum = number.nan integer range for number the following example shows the minimum and maximum integer values that can be represented as number object. (more details on this are described in the e
cmascript standard, chapter 6.1.6 the number type.) const biggestint = number.max_safe_integer // (253 - 1) => 9007199254740991 const smallestint = number.min_safe_integer // -(253 - 1) => -9007199254740991 when parsing data that has been serialized to json, integer values falling outside of this range can be expected to become corrupted when json parser coerces them to number type. a possib...
... ...
... ...
Object.prototype.__defineGetter__() - JavaScript
this method should not be used since better alternatives exist. the __definegetter__ method binds an object's property to a function to be called when that property is looked up. syntax obj.__definegetter__(prop, func) parameters prop a string containing the name of the property to bind to the given function. ...
... ...
... ...
Object.create() - JavaScript
this way now look very much like ordinary objects. polyfill this polyfill covers the main use case, which is creating a new object for which the prototype has been chosen but doesn't take the second argument into account. note that while the setting of null as [[prototype]] is supported in the real es5 object.create, this polyfill cannot support it due to a limitation inherent in versions of e
cmascript lower than 5. if (typeof object.create !== "function") { object.create = function (proto, propertiesobject) { if (typeof proto !== 'object' && typeof proto !== 'function') { throw new typeerror('object prototype may only be an object: ' + proto); } else if (proto === null) { throw new error("this browser's implementation of object.create is a s...
... ...
... ...
Object.setPrototypeOf() - JavaScript
value the specified object. description throws a typeerror exception if the object whose [[prototype]] is to be modified is non-extensible according to object.isextensible(). does nothing if the prototype parameter isn't an object or null (i.e., number, string, boolean, or undefined). otherwise, this method changes the [[prototype]] of obj to the new value. object.setprototypeof() is in the e
cmascript 2015 specification. it is generally considered the proper way to set the prototype of an object, vs. the more controversial object.prototype.__proto__ property. appending prototype chains a combination of object.getprototypeof() and object.prototype.__proto__ permits appending a whole prototype chain to a new prototype object: /** *** object.appendchain(@object, @prototype) * * appends ...
... ...
... ...
Object - JavaScript
oolean indicating whether an object contains the specified property as a direct property of that object and not inherited through the prototype chain. object.prototype.isprototypeof() returns a boolean indicating whether the object this method is called upon is in the prototype chain of the specified object. object.prototype.propertyisenumerable() returns a boolean indicating if the internal e
cmascript [[enumerable]] attribute is set. object.prototype.tolocalestring() calls tostring(). object.prototype.tostring() returns a string representation of the object. object.prototype.unwatch() removes a watchpoint from a property of the object. object.prototype.valueof() returns the primitive value of the specified object. object.prototype.watch() adds a watchpoint to a property of the...
... ...
... ...
RangeError - JavaScript
ototype.normalize(), or when attempting to create an array of an illegal length with the array constructor, or when passing bad values to the numeric methods number.prototype.toexponential(), number.prototype.tofixed() or number.prototype.toprecision(). constructor rangeerror() creates a new rangeerror object. instance properties rangeerror.prototype.message error message. although e
cma-262 specifies that rangeerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. rangeerror.prototype.name error name. inherited from error. rangeerror.prototype.filename path to file that raised this error. inherited from error. rangeerror.prototype.linenumber line number in file that raised this error. inherited from error. rangeerror.prototyp...
... ...
... ...
ReferenceError - JavaScript
referenceerror.prototype.name error name. inherited from error. referenceerror.prototype.filename path to file that raised this error. inherited from error. ...
... ...
... ...
Set - JavaScript
e unique values of any type, whether primitive values or object references. description set objects are collections of values. you can iterate through the elements of a set in insertion order. a value in the set may only occur once; it is unique in the set's collection. value equality because each value in the set has to be unique, the value equality will be checked. in an earlier version of e
cmascript specification, this was not based on the same algorithm as the one used in the === operator. specifically, for sets, +0 (which is strictly equal to -0) and -0 were different values. however, this was changed in the e
cmascript 2015 specification. see "key equality for -0 and 0" in the browser compatibility table for details. nan and undefined can also be stored in a set. all nan values are...
... ...
... ...
String.prototype.charAt() - JavaScript
let str = 'a\ud87e\udc04z' // we could also use a non-bmp character directly for (let i = 0, chr; i < str.length; i++) { [chr, i] = ge...
... ...
... ...
String.prototype.codePointAt() - JavaScript
urn value a number representing the code point value of the character at the given pos. if there is no element at pos, returns undefined. description if there is no element at the specified position, undefined is returned. if no utf-16 surrogate pair begins at pos, the code unit at pos is returned. polyfill the following extends strings to include the codepointat() function as specified in e
cmascript 2015 for browsers without native support. /*! https://mths.be/codepointat v0.2.0 by @mathias */ if (!string.prototype.codepointat) { (function() { 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` var defineproperty = (function() { // ie 8 only supports `object.defineproperty` on dom elements try { var object = {}; var $definep...
... ...
... ...
String.prototype.endsWith() - JavaScript
s to be searched for at the end of str. length optional if provided, it is used as the length of str. defaults to str.length. return value true if the given characters are found at the end of the string; otherwise, false. description this method lets you determine whether or not a string ends with another string. this method is case-sensitive. polyfill this method has been added to the e
cmascript 6 specification and may not be available in all javascript implementations yet. however, you can polyfill string.prototype.endswith() with the following snippet: if (!string.prototype.endswith) { string.prototype.endswith = function(search, this_len) { if (this_len === undefined || this_len > this.length) { this_len = this.length; } return this.substring(this_len - search.length...
... ...
... ...
String.fromCodePoint() - JavaScript
rror is thrown if an invalid unicode code point is given (e.g. "rangeerror: nan is not a valid code point"). description this method returns a string (and not a string object). because fromcodepoint() is a static method of string, you must call it as string.fromcodepoint(), rather than as a method of a string object you created. polyfill the string.fromcodepoint() method has been added to e
cmascript 2015 and may not be supported in all web browsers or environments yet. use the code below for a polyfill: if (!string.fromcodepoint) (function(stringfromcharcode) { var fromcodepoint = function(_) { var codeunits = [], codelen = 0, result = ""; for (var index=0, len = arguments.length; index !== len; ++index) { var codepoint = +arguments[index]; // correct...
... ...
... ...
String.prototype.includes() - JavaScript
e true if the search string is found anywhere within the given string; otherwise, false if not. description this method lets you determine whether or not a string includes another string. case-sensitivity the includes() method is case sensitive. for example, the following expression returns false: 'blue whale'.includes('blue') // returns false polyfill this method has been added to the e
cmascript 2015 specification and may not be available in all javascript implementations yet. however, you can easily polyfill this method: if (!string.prototype.includes) { string.prototype.includes = function(search, start) { 'use strict'; if (search instanceof regexp) { throw typeerror('first argument must not be a regexp'); } if (start === undefined) { start = 0; } ...
... ...
... ...
String.prototype.repeat() - JavaScript
rameters count an integer between 0 and +infinity, indicating the number of times to repeat the string. return value a new string containing the specified number of copies of the given string. exceptions rangeerror: repeat count must be non-negative. rangeerror: repeat count must be less than infinity and not overflow maximum string size. polyfill this method has been added to the e
cmascript 2015 specification and may not be available in all javascript implementations yet. however, you can polyfill string.prototype.repeat() with the following snippet: if (!string.prototype.repeat) { string.prototype.repeat = function(count) { 'use strict'; if (this == null) throw new typeerror('can\'t convert ' + this + ' to object'); var str = '' + this; // to conver...
... ...
... ...
Symbol.unscopables - JavaScript
scope variables. setting a property to false will make it scopable and thus it will appear in lexical scope variables. property attributes of symbol.unscopables writable no enumerable no configurable no examples scoping in with statements the following code works fine in es5 and below. however, in e
cmascript 2015 and later, the array.prototype.keys() method was introduced. that means that inside with environment "keys" would now be the method and not the variable. that's when the unscopables symbol was introduced. a built-in unscopables setting is implemented as array.prototype[@@unscopables] to prevent that some of the array methods are being scoped into the with statement. var keys = []; w...
... ...
... ...
SyntaxError - JavaScript
the syntaxerror object represents an error when trying to interpret syntactically invalid code. it is thrown when the javascript engine encounters tokens or token order that does not conform to the syntax of the language when parsing code. constructor syntaxerror() creates a new syntaxerror object. instance properties syntaxerror.prototype.message error message. although e
cma-262 specifies that syntaxerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. syntaxerror.prototype.name error name. inherited from error. syntaxerror.prototype.filename path to file that raised this error. inherited from error. syntaxerror.prototype.linenumber line number in file that raised this error. inherited from error. syntaxerror.prototype.column...
... ...
... ...
TypeError - JavaScript
may be thrown when: an operand or argument passed to a function is incompatible with the type expected by that operator or function; or when attempting to modify a value that cannot be changed; or when attempting to use a value in an inappropriate way. constructor typeerror() creates a new typeerror object. instance properties typeerror.prototype.message error message. although e
cma-262 specifies that typeerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. typeerror.prototype.name error name. inherited from error. typeerror.prototype.filename path to file that raised this error. inherited from error. typeerror.prototype.linenumber line number in file that raised this error. inherited from error. typeerror.prototype.col...
... ...
... ...
TypedArray.prototype.fill() - JavaScript
the length of the this object. if start is negative, it is treated as length+start where length is the length of the array. if end is negative, it is treated as length+end. polyfill since there is no global object with the name typedarray, polyfilling must be done on an "as needed" basis. use the following "polyfill" along with the array.prototype.fill() polyfill. ...
... ...
... ...
TypedArray.prototype.join() - JavaScript
s separator optional. specifies a string to separate each element. the separator is converted to a string if necessary. if omitted, the typed array elements are separated with a comma (","). return value a string with all array elements joined. polyfill since there is no global object with the name typedarray, polyfilling must be done on an "as needed" basis. // https://tc39.github.io/e
cma262/#sec-%typedarray%.prototype.join if (!uint8array.prototype.join) { object.defineproperty(uint8array.prototype, 'join', { value: array.prototype.join }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable. examples using join var uint8 ...
... ...
... ...
TypedArray.prototype.some() - JavaScript
e undefined will be passed for use as its this value. the this value ultimately observable by callback is determined according to the usual rules for determining the this seen by a function. some does not mutate the typed array on which it is called. polyfill since there is no global object with the name typedarray, polyfilling must be done on an "as needed" basis. // https://tc39.github.io/e
cma262/#sec-%typedarray%.prototype.some if (!uint8array.prototype.some) { object.defineproperty(uint8array.prototype, 'some', { value: array.prototype.some }); } if you need to support truly obsolete javascript engines that don't support object.defineproperty, it's best not to polyfill array.prototype methods at all, as you can't make them non-enumerable. examples testing size of all ty...
... ...
... ...
URIError - JavaScript
urierror.prototype.name error name. inherited from error. urierror.prototype.filename path to file that raised this error. inherited from error. ...
... ...
... ...
Uint16Array() constructor - JavaScript
description the uint16array() typed array constructor creates an array of 16-bit unsigned integers in the platform byte order. if control over byte order is needed, use dataview instead. the contents are initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). starting with e
cmascript 2015, uint16array constructors require to be constructed with a new operator. calling a uint16array constructor as a function without new, will throw a typeerror from now on. var dv = uint16array([1, 2, 3]); // typeerror: calling a builtin uint16array constructor // without new is forbidden var dv = new uint16array([1, 2, 3]); examples different ways to create a uint16array // from a ...
... ...
... ...
escape() - JavaScript
… the escape() function computes a new string in which certain characters have been replaced by a hexadecimal escape sequence. ...
...… the escape() function computes a new string in which certain characters have been replaced by a hexadecimal escape sequence. note: this function was used mostly for url queries (the part of a url following ?)—not for escaping ordinary string literals, which use the format "\xhh". ...
...hose code unit value is 0xff or less, is a two-digit escape sequence: %xx. for characters with a greater code unit, the four-digit format %uxxxx is used. examples using escape escape('abc123'); // "abc123" escape('äöü'); // "%e4%f6%fc" escape('ć'); // "%u0107" // special characters escape('@*_+-./'); // "@*_+-./" specifications specification e
cmascript (e
cma-262)the definition of 'escape' in that specification. please do not add polyfills to reference pages. for more information, see https://discourse.mozilla.org/t/mdn-rfc-001-mdn-wiki-pages-shouldnt-be-a-distributor-of-polyfills/24500 ...
eval() - JavaScript
ing the string. eval(new string('2 + 2')); // returns a string object containing "2 + 2" eval('2 + 2'); // returns 4 you can work around this limitation in a generic fashion by using tostring(). var expression = new string('2 + 2'); eval(expression.tostring()); // returns 4 if you use the eval function indirectly, by invoking it via a reference other than eval, as of e
cmascript 5 it works in the global scope rather than the local scope. this means, for instance, that function declarations create global functions, and that the code being evaluated doesn't have access to local variables within the scope where it's being called. function test() { var x = 2, y = 4; console.log(eval('x + y')); // direct call, uses local scope, result is 6 var geval = eval; // ...
... ...
... ...
undefined - JavaScript
project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax undefined description undefined is a property of the global object. that is, it is a variable in global scope. the initial value of undefined is the primitive value undefined. in modern browsers (javascript 1.8.5 / firefox 4+), undefined is a non-configurable, non-writable property, per the e
cmascript 5 specification. (even when this is not the case, avoid overriding it.) a variable that has not been assigned a value is of type undefined. a method or statement also returns undefined if the variable that is being evaluated does not have an assigned value. a function returns undefined if a value was not returned. be careful. while it is possible to use it as an identifier (variable nam...
... ...
... ...
unescape() - JavaScript
… the unescape() function computes a new string in which hexadecimal escape sequences are replaced with the character that it represents. ...
...… the unescape() function computes a new string in which hexadecimal escape sequences are replaced with the character that it represents. the escape sequences might be introduced by a function like escape. usually, decodeuri or decodeuricomponent are preferred over unescape. ...
... syntax unescape(str) parameters str a string to be decoded. return value a new string in which certain characters have been unescaped. description the unescape function is a property of the global object. examples using unescape unescape('abc123'); // "abc123" unescape('%e4%f6%fc'); // "äöü" unescape('%u0107'); // "ć" specifications specification e
cmascript (e
cma-262)the definition of 'unescape' in that specification. ...
Iteration protocols - JavaScript
these protocols can be implemented by any object by simply following some conventions. there are two protocols: the iterable protocol and the iterator protocol. the iterable protocol the iterable protocol allows javascript objects to define or customize their iteration behavior, such as what values are looped over in a for...of construct. some built-in types are built-in iterables with a default iteration behavior, such as array or map, while other types (such as object) are not. ...
... ...
... ...
Destructuring assignment - JavaScript
og('name: ' + n + ', father: ' + f); } // "name: mike smith, father: harry smith" // "name: tom jones, father: richard jones" computed object property names and destructuring computed property names, like on object literals, can be used with destructuring. let key = 'z'; let {[key]: foo} = {z: 'bar'}; console.log(foo); // "bar" rest in object destructuring the rest/spread properties for e
cmascript proposal (stage 4) adds the rest syntax to destructuring. rest properties collect the remaining own enumerable property keys that are not already picked off by the destructuring pattern. let {a, b, ...rest} = {a: 10, b: 20, c: 30, d: 40} a; // 10 b; // 20 rest; // { c: 30, d: 40 } invalid javascript identifier as a property name destructuring can be used with property names that are not...
... ...
... ...
Property accessors - JavaScript
ties and methods. however, the property/method distinction is little more than a convention. a method is simply a property that can be called (for example, if it has a reference to a function instance as its value). there are two ways to access properties: dot notation and bracket notation. dot notation in the object.property syntax, the property must be a valid javascript identifier. (in the e
cmascript standard, the names of properties are technically "identifiernames", not "identifiers", so reserved words can be used but are not recommended). for example, object.$1 is valid, while object.1 is not. const variable = object.property_name; object.property_name = value; const object = {}; object.$1 = 'foo'; console.log(object.$1); // 'foo' object.1 = 'bar'; // syntaxerror conso...
... ...
... ...
delete operator - JavaScript
althis, 'variable2', { value: 10, configurable: false, }); // syntaxerror in strict mode. console.log(delete variable1); // true // syntaxerror in strict mode. console.log(delete variable2); // false function func(param) { // syntaxerror in strict mode. console.log(delete param); // false } // syntaxerror in strict mode. console.log(delete func); // false cross-browser notes although e
cmascript makes iteration order of objects implementation-dependent, it may appear that all major browsers support an iteration order based on the earliest added property coming first (at least for properties not on the prototype). however, in the case of internet explorer, when one uses delete on a property, some confusing behavior results, preventing other browsers from using simple objects like o...
... ...
... ...
this - JavaScript
nverted to an object using the related constructor, so the primitive number 7 is converted to an object as if by new number(7) and the string 'foo' to an object as if by new string('foo'), e.g. function bar() { console.log(object.prototype.tostring.call(this)); } bar.call(7); // [object number] bar.call('foo'); // [object string] bar.call(undefined); // [object global] the bind method e
cmascript 5 introduced function.prototype.bind(). calling f.bind(someobject) creates a new function with the same body and scope as f, but where this occurs in the original function, in the new function it is permanently bound to the first argument of bind, regardless of how the function is being used. function f() { return this.a; } var g = f.bind({a: 'azerty'}); console.log(g()); // azerty va...
... ...
... ...
export - JavaScript
description there are two different types of export, named and default. you can have multiple named exports per module but only one default expo...
... ...
... ...
switch - JavaScript
take a look at this example: const action = 'say_hello'; switch (action) { case 'say_hello': let message = 'hello'; console.log(message); break; case 'say_hi': let message = 'hi'; console.log(message...
... ...
... ...
var - JavaScript
t. javascript has automatic memory management, and it would make no sense to be able to use the delete operator on a global variable. 'use strict'; var x = 1; globalthis.hasownproperty('x'); // true delete globalthis.x; // typeerror in strict mode. fails silently otherwise. delete x; // syntaxerror in strict mode. fails silently otherwise. note that in both nodejs commonjs modules and native e
cmascript modules, top-level variable declarations are scoped to the module, and are not, therefore added as properties to the global object. unqualified identifier assignments the global object sits at the top of the scope chain. when attempting to resolve a name to a value, the scope chain is searched. this means that properties on the global object are conveniently visible from every scope, wit...
...ualified string. the corollary, in non-strict mode, is that assignment to unqualified identifiers will, if there is no variable of the same name declared in the scope chain, assume you want to create a property with that name on the global object. foo = 'f' // in non-strict mode, assumes you want to create a property named `foo` on the global object globalthis.hasownproperty('foo') // true in e
cmascript 5, this behavior was changed for strict mode. assignment to an unqualified identifier in strict mode will result in a referenceerror, to avoid the accidental creation of properties on the global object. note that the implication of the above, is that, contrary to popular misinformation, javascript does not have implicit or undeclared variables, it merely has a syntax that looks like it do...
...ng outer y. z = 5; // creates a new global variable z, and assigns it a value of 5. // (throws a referenceerror in strict mode.) } b(); // creates z as a global variable. console.log(x, y, z); // 3 4 5 } a(); // also calls b. console.log(x, z); // 3 5 console.log(typeof y); // "undefined", as y is local to function a specifications specification e
cmascript (e
cma-262)the definition of 'variable statement' in that specification. ...
with - JavaScript
taining that unqualified name. the 'with' statement adds the given object to the head of this scope chain during the evaluation of its statement body. if an unqualified name used in the body matches a property in the scope chain, then the name is bound to the property and the object containing the property. otherwise a referenceerror is thrown. using with is not recommended, and is forbidden in e
cmascript 5 strict mode. the recommended alternative is to assign the object whose properties you want to access to a temporary variable. performance pro & contra pro: the with statement can help reduce file size by reducing the need to repeat a lengthy object reference without performance penalty. the scope chain change required by 'with' is not computationally expensive. use of 'with' will relie...
...e x in the object you pass as the second argument, or if there's some similar bug or confusion, you won't get an error -- just unexpected results. contra: code using with may not be forward compatible, especially when used with something other than a plain object. consider this example: function f(foo, values) { with (foo) { console.log(values); } } if you call f([1,2,3], obj) in an e
cmascript 5 environment, then the values reference inside the with statement will resolve to obj. however, e
cmascript 2015 introduces a values property on array.prototype (so that it will be available on every array). so, in a javascript environment that supports e
cmascript 2015, the values reference inside the with statement could resolve to [1,2,3].values. however, in this particular example, arra...
...atement specifies that the math object is the default object. the statements following the with statement refer to the pi property and the cos and sin methods, without specifying an object. javascript assumes the math object for these references. var a, x, y; var r = 10; with (math) { a = pi * r * r; x = r * cos(pi); y = r * sin(pi / 2); } specifications specification e
cmascript (e
cma-262)the definition of 'with statement' in that specification. ...
JavaScript
hreaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles. read more about javascript. this section is dedicated to the javascript language itself, and not the parts that are specific to web pages or other host environments. for information about api specifics to web pages, please see web apis and dom. the standard for javascript is e
cmascript. as of 2012, all modern browsers fully support e
cmascript 5.1. older browsers support at least e
cmascript 3. on june 17, 2015, e
cma international published the sixth major version of e
cmascript, which is officially called e
cmascript 2015, and was initially referred to as e
cmascript 6 or es6. since then, e
cmascript standards are on yearly release cycles. this documentation refers to the lat...
... do not confuse javascript with the java programming language. both "java" and "javascript" are trademarks or registered trademarks of oracle in the u.s. and other countries. however, the two programming languages have a very different syntax, semantic, and use. ...
...) method. closures a closure is the combination of a function and the lexical environment within which that function was declared. advanced inheritance and the prototype chain explanation of the widely misunderstood and under-estimated prototype-based inheritance. strict mode strict mode defines that you can not use any variable before initializing it. it is a restricted variant of e
cmascript 5, for faster performance and easier debugging. javascript typed arrays javascript typed arrays provide a mechanism for accessing raw binary data. memory management memory life cycle and garbage collection in javascript. concurrency model and event loop javascript has a concurrency model based on an "event loop". reference browse the complete javascript reference documentation. ...
keySplines - SVG: Scalable Vector Graphics
the keysplines attribute defines a set of bézier curve control points associated with the keytimes list, defining a cubic bézier function that controls interval pacing. this attribute is ignored unless the cal
cmode attribute is set to spline. if there are any errors in the keysplines specification (bad values, too many or too few values), the animation will not occur. ...
...rrors in the keysplines specification (bad values, too many or too few values), the animation will not occur. ...
... default value none animatable no the attribute value is a semicolon-separated li...
Positions - SVG: Scalable Vector Graphics
ight and to the bottom. what are "pixels"? in the most basic case one pixel in an svg document maps to one pixel on the output device (a.k.a. the screen). but svg wouldn't have the "scalable" in its name, if there weren't several possibilities to change this behaviour. much like absolute and relative font sizes in css, svg defines absolute units (ones with a dimensional identifier like "pt" or "
cm") and so-called user units, that lack that identifier and are plain numbers. without further specification, one user unit equals one screen unit. to explicitly change this behaviour, there are several possibilities in svg. we start with the svg root element: <svg width="100" height="100"> the above element defines a simple svg canvas with 100x100px. one user unit equals one screen unit. <svg...
...ing (for a single element or the whole image) of user units to screen units is called user coordinate system. apart from scaling the coordinate system can also be rotated, skewed and flipped. the default user coordinate system maps one user pixel to one device pixel. ...
...ds as one pixel.) lengths in the svg file with specific dimensions, like "in" or "
cm", are then calculated in a way that makes them appear 1:1 in the resulting image. a quote from the svg 1.1 specification illustrates this: [...] suppose that the user agent can determine from its environment that "1px" corresponds to "0.2822222mm" (i.e., 90dpi). ...
core/heritage - Archive of obsolete content
osable pieces of functionality does a better job: var hex = class({ hex: function hex() { return '#' + this.color; } }); var rgb = class({ red: function red() { return parseint(this.color.substr(0, 2), 16); }, green: function green() { return parseint(this.color.substr(2, 2), 16); }, blue: function blue() { return parseint(this.color.substr(4, 2), 16); } }); var
cmyk = class({ black: function black() { var color = math.max(math.max(this.red(), this.green()), this.blue()); return (1 - color / 255).tofixed(4); }, magenta: function magenta() { var k = this.black(); return (((1 - this.green() / 255).tofixed(4) - k) / (1 - k)).tofixed(4); }, yellow: function yellow() { var k = this.black(); return (((1 - this.blue() / 255).tofix...
...) / (1 - k)).tofixed(4); }, cyan: function cyan() { var k = this.black(); return (((1 - this.red() / 255).tofixed(4) - k) / (1 - k)).tofixed(4); } }); such composable pieces can be combined into a single class definition by passing special implements option to a class function: // composing `color` prototype out of reusable components: var color = class({ implements: [ hex, rgb,
cmyk ], initialize: function initialize(color) { this.color = color; } }); var pink = color('ffc0cb'); // rgb pink.red() // => 255 pink.green() // => 192 pink.blue() // => 203 //
cmyk pink.magenta() // => 0.2471 pink.yellow() // => 0.2039 pink.cyan() // => 0.0000 pink instanceof color // => t...
cfx - Archive of obsolete content
this gives you access to that profile's history, bookmarks, and other add-ons. this enables you to run your add-on alongside debuggers like firebug. see "using --profiledir" for more information. -b binary, --binary=binary use the host application binary specified in binary. binary may be specified as a full path or as a path relative to the current directory. --binary-args=
cmdargs pass extra arguments to the binary being executed (for example, firefox). for example, to pass the -jsconsole argument to firefox, which will launch the javascript error console, try the following: cfx run --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: cfx run --binary-args '-url "www.mozilla.org" -jsconsole' ...
... host application binary version to use, and to select a profile. you can also control which tests are run: you can test dependent packages, filter the tests by name and run tests multiple times. -b binary, --binary=binary use the host application binary specified in binary. binary may be specified as a full path or as a path relative to the current directory. --binary-args=
cmdargs pass extra arguments to the binary being executed (for example, firefox). for example, to pass the -jsconsole argument to firefox, which will launch the javascript error console, try the following: cfx run --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: cfx run --binary-args '-url "www.mozilla.org" -jsconsole' ...
jpm - Archive of obsolete content
m run this command runs a new instance of firefox with the add-on installed: jpm run jpm run accepts the following options: -b --binary binary use the version of firefox specified in binary. binary may be specified as a full path or as a path relative to the current directory. jpm run -b /path/to/firefox/nightly see selecting a browser version. --binary-args
cmdargs pass extra arguments to firefox. for example, to pass the -jsconsole argument to firefox and launch the browser console, try the following: jpm run --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: jpm run --binary-args '-url mzl.la -jsconsole' --debug run the add-on debugger attached to the add-on. ...
...and the reference documentation for the assert module for more details on this. jpm test accepts the following options: -b --binary binary use the version of firefox specified in binary. binary may be specified as a full path or as a path relative to the current directory. jpm test -b /path/to/firefox/nightly see selecting a browser version. --binary-args
cmdargs pass extra arguments to firefox. for example, to pass the -jsconsole argument to firefox, which will launch the browser console, try the following: jpm test --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: jpm test --binary-args '-url mzl.la -jsconsole' --debug run the add-on debugger attached to the ...
Forms related code snippets - Archive of obsolete content
similar to variables declared with the let statement, constants declared with const will be block-scoped. we used it only for didactic ...
...similar to variables declared with the let statement, constants declared with const will be block-scoped. we used it only for didactic purpose. ...
Code snippets - Archive of obsolete content
to dom using a hidden browser element to parse html to a window's dom javascript libraries here are some javascript libraries that may come in handy. stringview a library that implements a stringview view for javascript typed arrays. this lets you access data in typed arrays using c-like string functions. ...
...u access data in typed arrays using c-like string functions. rosetta by default, the only possible standardized scripting language for html is e
cmascript. hence, if you are going to use another scripting language you might expect that most of the browsers will not recognize it. nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in e
cmascript allow us, in theory, to build full virtual machines in pure e
cmascript. therefore, it is also possible, in theory, to use e
cmascript for a smaller task: parsing exotic programming languages (i.e., creating compilers). this snippets shows a possible way to start from. browser-oriented code tabbed browser code (firefox/seamonkey) basic operations, such as page loading, with the tabbed ...
Java in Firefox Extensions - Archive of obsolete content
//set security policies using the above policyadd() function policyadd(cl, urlarray); now you can begin using liveconnect, including referencing the classes in your jars. be aware that if you have added a namespace within your classes (via "package"), you will need to reference the namespace as well. ...
...yadd(cl, urlarray); now you can begin using liveconnect, including referencing the classes in your jars. be aware that if you have added a namespace within your classes (via "package"), you will need to reference the namespace as well. ...
onFindAgainCommand - Archive of obsolete content
indagaincommand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" commands. ...
...ndle your application's "find next" and "find previous" commands. ...
XUL Parser in Python/source - Archive of obsolete content
zilla.org/keymaster/gatekeeper/there.is.only.xul window", etc. ...
...eturn t class xulparser(xmllib.xmlparser): def unknown_starttag(self, t, a): name = strip(t) if name not in el_list: el_list[name] = {} for attr,val in a.items(): el_list[name][strip(attr)] = strip(val) def syntax_error(self, message): pass p = xulparser()
cmd = 'dir /s /b *.xul' chrome_dir = 'c:\program files\netscape\netscape 6\chrome' os.chdir(chrome_dir) files = os.popen(
cmd).readlines() for file in files: file = file.strip() print '** ' + file + ' **' data = open(file).read() p.feed(data) w.write('<html><h3>periodic table of xul elements</h3>') w.write('<table><style>.head {font-weight: bold; background-color: lightgrey;}</style>') elements = el_list.keys() elements.sort() for item in elements: w.write('<tr><td class="head">' + item + '</td></tr>\n') for a ...
XUL Event Propagation - Archive of obsolete content
ne which element below the handler actually raised the event. ...
...nd take the appropriate action, as in the following example, where a javascript function determines which menuitem was selected and responds appropriately: <script> function do
cmd(el) { v = el.getattribute("value"); if (v == "new") alert("new clicked"); else if (v == "open") alert("open clicked"); else alert("close clicked"); } </script> ... <menu class="menu" value="file" oncommand="do
cmd(event.target)"> <menupopup> <menuitem oncommand="alert('new item alert')" value="new" /> <menuitem value="open" /> <menuitem oncommand="alert('close handler')" value="close" /> </menupopup> </menu> ... the event handler in the menu finds out which menuitem was actually clicked and takes different actions accordingly. event capturing event capturing is the compleme...
command - Archive of obsolete content
ommand will be sent to the part of the ui which will respond to it. typically, this will be the currently focused element. like a broadcaster, commands forward attributes to other elements. more information is available in the xul tutorial. ...
...ment. like a broadcaster, commands forward attributes to other elements. more information is available in the xul tutorial. see also: command attribute, commandset element attributes disabled, label, oncommand,reserved examples the following code will send a paste command (
cmd_paste) to the currently focused element: // first include chrome://global/content/globaloverlay.js godocommand("
cmd_paste"); example with two buttons <commandset><command id="
cmd_openhelp" oncommand="alert('help');"/></commandset> <button label="help" command="
cmd_openhelp"/> <button label="more help" command="
cmd_openhelp"/> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn wi...
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
my app allownoicons=yes outputdir=..\build\output outputbasefilename=myapp-1.0-win32 ; setupiconfile= compression=lzma solidcompression=yes [languages] name: english; messagesfile: compiler:default.isl [components] name: main; description: my app; types: full compact custom; flags: fixed name: runtime; description: xul runner runtime; types: full custom [tasks] name: desktopicon; description: {
cm:createdesktopicon}; groupdescription: {
cm:additionalicons}; flags: unchecked name: quicklaunchicon; description: {
cm:createquicklaunchicon}; groupdescription: {
cm:additionalicons}; flags: unchecked [files] source: c:\develop\xulrunnerinstaller\myapp\myapp.exe; destdir: {app}; components: main; flags: ignoreversion source: c:\develop\xulrunnerinstaller\myapp\application.ini; destdir: {app}; compo...
... .svn; destdir: {app}\defaults; components: main; flags: ignoreversion recursesubdirs createallsubdirs source: c:\develop\xulrunnerinstaller\myapp\xulrunner\*; destdir: {app}\xulrunner; components: runtime; flags: ignoreversion recursesubdirs createallsubdirs ; note: don't use "flags: ignoreversion" on any shared system files [icons] name: {group}\my app; filename: {app}\myapp.exe name: {group}\{
cm:uninstallprogram,xul explorer}; filename: {uninstallexe} name: {userdesktop}\my app; filename: {app}\myapp.exe; tasks: desktopicon name: {userappdata}\microsoft\internet explorer\quick launch\my app; filename: {app}\myapp.exe; tasks: quicklaunchicon [run] filename: {app}\myapp.exe; description: {
cm:launchprogram,my app}; onlybelowversion: 0,6; flags: nowait postinstall skipifsilent step 4: bu...
Array comprehensions - Archive of obsolete content
x [for (x of iterable) x] [for (x of iterable) if (condition) x] [for (x of iterable) for (y of iterable) x + y] description inside array comprehensions, these two kinds of components are allowed: for...of and if the for-of iteration is always the first component. multiple for-of iterations or if statements are allowed. array comprehension was previously proposed to be standardized in e
cmascript 2016, it provide a useful shortcut for constructing a new array based on the contents of another. comprehensions can often be used in place of calls to map() and filter(), or as a way of combining the two. the following comprehension takes an array of numbers and creates a new array of the double of each of those numbers. var numbers = [1, 2, 3, 4]; var doubled = [for (i of numbers) i * ...
...please see older revisions of es2015 for specification semantics. ...
LiveConnect Overview - Archive of obsolete content
va.lang.object javascript 1.4: a javascript string is converted to an instance of java.lang.string with a unicode value. javascript 1.3 and earlier: a javascript string is converted to an instance of java.lang.string with an ascii value. byte double float int long short all values are converted to numbers as described in e
cma-262. the javascript string value is converted to a number according to the rules described in e
cma-262. char javascript 1.4: one-character strings are converted to unicode characters. all other values are converted to numbers. javascript 1.3 and earlier: all values are converted to numbers. boolean the empty string bec...
...ed in a new instance of netscape.javascript.jsobject. java.lang.string the object is unwrapped, the tostring method of the unwrapped object is called, and the result is returned as a new instance of java.lang.string. byte char double float int long short the object is converted to a value using the logic of the toprimitive operator described in e
cma-262. the preferredtype hint used with this operator is number. boolean in javascript 1.3 and later versions, the object is unwrapped and either of the following situations occur: if the object is null, it is converted to false. if the object has any other value, it is converted to true. in javascript 1.2 and earlier versions, the object is unwrapped and either...
Old Proxy API - Archive of obsolete content
ydescriptor(proxy, name) getownpropertydescriptor: function(name) -> propertydescriptor | undefined should return a valid property descriptor object, or undefined to indicate that no property with name exists in the emulated object. ...
...like getownpropertynames, but should also return non-overridden inherited properties. object.defineproperty(proxy,name,pd) defineproperty: function(name, propertydescriptor) -> any define a new property whose attributes are determined by the given propertydescriptor. the return value of this method is ignored. ...
Archived open Web documentation - Archive of obsolete content
t for standards css obsolete css features displaying notifications (deprecated) firefox offers support for "desktop notifications"; these are notifications that are displayed to the user outside the context of the web content, using the standard notification system provided by the operating system. e4x e
cmascript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a form that feels natural for e
cmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algorithm. ...
...with e4x, programmers can manipulate an xml document with a syntax more familiar to javascript programming. ...
Tiles and tilemaps overview - Game development
cript and canvas (although the same high level techniques could be used in any programming language.) besides the performance gains, tilemaps can also be mapped to a logical grid, which can be used in other ways inside the game logic (for example creating a path-finding graph, or handling collisions) or to create a level editor. some popular games that use this technique are super mario bros, pa
cman, zelda: link's awakening, starcraft, and sim city 2000. think about any game that uses regularly repeating squares of background, and you'll probably find it uses tilemaps. the tile atlas the most efficient way to store the tile images is in an atlas or spritesheet. this is simply all of the required tiles grouped together in a single image file. when it's time to draw a tile, only a small se...
...rspectives: top-down (like many rpg's or strategy games like warcraft 2 or final fantasy's world view.) side-view (like platformers such as super mario bros.) static tilemaps a tilemap can either fit into the visible screen area screen or be larger. in the first case, the tilemap is static — it doesn't need to be scrolled to be fully shown. this case is very common in arcade games like pa
cman, arkanoid, or sokoban. rendering static tilemaps is easy, and can be done with a nested loop iterating over columns and rows. a high-level algorithm could be: for (var column = 0; column < map.columns; column++) { for (var row = 0; row < map.rows; row++) { var tile = map.gettile(column, row); var x = column * map.tilesize; var y = row * map.tilesize; drawtile(tile, x, y); ...
Visual typescript game engine - Game development
es/ | ├── imgs/ | ├── styles/ | | └── favicon.ico | ├── visualjs2.js | ├── app.html ├── src/ | ├── style/ | | ├── styles.css | ├── libs/ | | ├── class/ | | | ├── networking/ | | | | ├── rtc-multi-connection/ | | | | | ├── filebufferreader.js | | | | | ├── rt
cmulticonnection2.js | | | | | ├── rt
cmulticonnection3.js | | | | | ├── linkify.js | | | | | ├── gethtmlmediaelement.js | | | | | ├── socket.io.js | | | | ├── broadcaster-media.ts | | | | ├── broadcaster.ts | | | | ├── connector.ts | | | | ├── network.ts | | | ├── visua...
...a connector is our account session used for login, register etc. implemented video chat based on webrtc protocol. - running rtc3 server is also easy : command 'npm run broadcaster' is not necessary for beginners. features come with broadcaster: multiplatform video chat works with other hybrid frameworks or custom implementation t...
Gecko FAQ - Gecko Redirect 1
illa level 1 html dom 2 - most of it has already been implemented in gecko, including support for dom 2 events, the dom 2 style, and the dom2 core. dom 3 support is also planned for a future release. ...
...el 1 html dom 2 - most of it has already been implemented in gecko, including support for dom 2 events, the dom 2 style, and the dom2 core. dom 3 support is also planned for a future release. xml 1.0: full support, except for processing to manipulate default attributes rdf: full support, except for abouteach, abouteachprefix, and parsetype javascript 1.5, including e
cma-262 edition 3 (e
cmascript) compliance, except for date.todatestring and date.totimestring, which are not implemented transfer protocols: http 1.1 (including gzip compression), ftp ssl unicode oji (open java interface) image formats png gif jpeg, pjpeg does "full support" mean that gecko has zero bugs today or will have zero bugs at some point in the future? of course not. as robert o'callah...
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
ent of apis available in browsers. origins and history conceived as a server-side language by brendan eich (then employed by the netscape corporation), javascript soon came to netscape navigator 2.0 in september 1995. javascript enjoyed immediate success and internet explorer 3.0 introduced javascript support under the name jscript in august 1996. in november 1996, netscape began working with e
cma international to make javascript an industry standard. since then, the standardized javascript is called e
cmascript and specified under e
cma-262, whose latest (tenth, es2019) edition is available as of june 2019. recently, javascript's popularity has expanded even further through the successful node.js platform—the most popular cross-platform javascript runtime environment outside the browser...
...avascript as a scripting language to automate things on a computer and build fully functional http and web sockets servers. learn more general knowledge javascript on wikipedia learning javascript the javascript guide on mdn the "javascripting" workshop on nodeschool the javascript course on codecademy.com john resig's learning advanced javascript technical reference the latest e
cmascript standard the javascript reference on mdn the eloquent javascript book ...
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
m2 = symbol("sym") console.log(sym1 === sym2) // returns "false" // symbols are guaranteed to be unique. // even if we create many symbols with the same description, // they are different values. note: if you are familiar with ruby's (or another language) that also has a feature called "symbols", please don’t be misguided. javascript symbols are different. symbol type is a new feature in e
cmascript 2015. there is no e
cmascript 5 equivalent for symbol. in some programming languages, the symbol data type is referred to as an "atom." symbols don't "auto-convert" to strings most values in javascript support implicit conversion to a string. for instance, we can alert almost any value, and it will work. symbols are special. they don’t auto-convert. for example: let sym = symbol("sym...
... the method symbol.for(tokenstring) returns a symbol value from the registry, and symbol.keyfor(symbolvalue) returns a token string from the registry; each is the other's inverse, so the following is true: symbol.keyfor(symbol.for("tokenstring")) === "tokenstring" // true learn more general knowledge symbol (programming) on wikipedia javascript data types and data structures symbols in e
cmascript 6 symbol in the mdn js reference object.getownpropertysymbols() ...
How do you make sure your website works properly? - Learn web development
at doesn't matter very much when we're only serving one image, but it would be critical for a high-bandwidth website serving many thousands of images. ...
...but it would be critical for a high-bandwidth website serving many thousands of images. is the server responsive enough? ping is a useful shell tool that tests the domain name you provide and tells you if the server's responding or not: $ ping mozilla.org ping mozilla.org (63.245.215.20): 56 data bytes 64 bytes from 63.245.215.20: i
cmp_seq=0 ttl=44 time=148.741 ms 64 bytes from 63.245.215.20: i
cmp_seq=1 ttl=44 time=148.541 ms 64 bytes from 63.245.215.20: i
cmp_seq=2 ttl=44 time=148.734 ms 64 bytes from 63.245.215.20: i
cmp_seq=3 ttl=44 time=147.857 ms ^c --- mozilla.org ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 147.857/148.468/148.741/0.362 ms just keep in mind a handy keyboard shortcut: ctrl+c. ctrl+c sends an “inter...
Advanced text formatting - Learn web development
for example: <time datetime="2016-01-20"...
...for example: <time datetime="2016-01-20">20 january 2016</time> why is this useful? well, there are many different ways that humans write down dates. the above date could be written as: ...
Introduction to client-side frameworks - Learn web development
s to client-side frameworks if you’re looking for tools to expedite the web development process, and you know your project isn’t going to require intensive client-side javascript, you could reach for one of a handful of other solutions for building the web: a content management system server-side rendering a static site generator content management systems content-management systems (
cmses) are any tools that allow a user to create content for the web without directly writing code themselves. they're a good solution for large projects, especially projects that require input from content writers who have limited coding ability, or for programmers who want to save time. they do, however, require a significant amount of time to set up, and utilizing a
cms means that you surrender a...
...emselves. they're a good solution for large projects, especially projects that require input from content writers who have limited coding ability, or for programmers who want to save time. they do, however, require a significant amount of time to set up, and utilizing a
cms means that you surrender at least some measure of control over the final output of your website. for example: if your chosen
cms doesn't author accessible content by default, it's often difficult to improve this. popular examples include wordpress, joomla, and drupal. server-side rendering server-side rendering (ssr) is an application architecture in which it is the server's job to render a single-page application. this is the opposite of client-side rendering, which is the most common and most straightforward way to b...
Handling common accessibility problems - Learn web development
lt focus styling using css, make sure you replace it with something else that fits in with your design better — it is a very valuable accessiblity tool, and should not be removed. building in keyboard accessibility sometimes it is not possible to avoid losing keyboard accessibility. you might have inherited a site where the semantics are not very good (perhaps you've ended up with a horrible
cms that generates buttons made with <div>s), or you are using a complex control that does not have keyboard accessibility built in, like the html5 <video> element (amazingly, opera is the only browser that allows you to tab through the <video> element's default browser controls). you have a few options here: create custom controls using <button> elements (which we can tab to by default!) and jav...
...des some useful information about screenreader usage and what works best for screenreaders. also see screen reader user survey #6 results for some interesting screenreader usage statistics. voiceover voiceover (vo) comes free with your mac/iphone/ipad, so it's useful for testing on desktop/mobile if you use apple products. we'll be testing it on mac os x on a macbook pro. to turn it on, press
cmd + f5. if you've not used vo before, you will be given a welcome screen where you can choose to start vo or not, and run through a rather useful tutorial to learn how to use it. to turn it off again, press
cmd + f5 again. note: you should go through the tutorial at least once — it is a really useful way to learn vo. when vo is on, the display will look mostly the same, but you'll see a blac...
Handling common HTML and CSS problems - Learn web development
ention. if you insist on using prefixed features, make sure you use the right ones. you can look up what browsers require prefixes on mdn reference pages, and sites like caniuse.com. if you are unsure, you can also find out by doing some testing directly in browsers. try this simple example: open up google.com, or another site that has a prominent heading or other block-level element. right/
cmd + click on the element in question and choose inspect/inspect element (or whatever the option is in your browser) — this should open up the dev tools in your browser, with the element highlighted in the dom inspector. look for a feature you can use to select that element. for example, at the time of writing, the main google logo had an id of hplogo. store a reference to this element in a var...
...or sublime text. for example, in atom: you can install it by going to preferences > install, searching for autoprefixer, then hitting install. you can set a browser query by pressing the autoprefixer settings button and entering the query in the text field in the settings section on the page. in your code, you can select sections of css you want to add prefixes to, open the command pallette (
cmd/ctrl + shift + p), then type in autoprefixer and select the autoprefixer result that autocompletes. as an example, we entered the following code: body { display: flex; } we highlighted it and ran the autoprefixer command, and it replaced it with this: body { display: -webkit-box; display: -ms-flexbox; display: flex; } layout issues another problem that might come up is differences...
Creating MozSearch plugins
gin lets you easily search the mozilla developer center web site. ...
...oaaaansuheugaaabaaaaaqcayaaaaf8%2f9haaaabgdbtueaak%2finwwk6qaaabl0rvh0u29mdhdh
cmuaqwrvymugsw1hz2vszwfkexhjztwaaahwsurbvhjayvz%2f%2fz8djqaggjiqoe%2ffv2fv7oz8rays%2fn%2bvkfg%2fiynjfyd%2f1%2brvq7ffu3dpfpsbaaheahibcj85c8bn2nj4vwsdw%2f8zqlwkio8ccroqu0dxqlwrdshuwzbaaigjmtnnpgya9j8uqhfelwpxf2mideirksn9fwsjorkaeeam0dd4dzmaypi%2fg%2bqky4hh5waxgf8pdq0fgwj22d27cjadaaiirlmjo%2bmxa9r2kahvgba2wwx6b8w7od6ceqcggk
cmcel8bgwxycbuigtdvkhdbia%2bcuotgaccued3tdqn75d4xmavcok9armhbzaw0aecibhkalc0mdy7x9abna3obazxiaa6ikecglmvqhwwyjyul2d4v2cpg8vzswx7ghyaaak7aoif7saboq
cmn4ha3ahfsidtgpq%2fvlz8p4mskj2w9h8ggbjevxvhdo4fquqg%2fkdypqcg4h8luiacnq%2fsobmyi8basajfpcj1aaeejwvqqlpabxmh5bjjqi0gi9dtaagdbbccavlkgmq7ykczxpcqxquzhaeccj4xgml493ug21zd%2badaxh0wlm4a9mzpxjkjiiawtar5pqmalacabquulttbgccagcnnzgabbgamj5thwgvjlaaaaabjru5erkjggg...
Error codes returned by Mozilla APIs
05300 16) ns_error_dom_type_mismatch_err (0x805300 17) ns_error_dom_svg_wrong_type_err (0x805f0000) ns_error_dom_svg_invalid_value_err (0x805f0001) ns_error_dom_svg_matrix_not_invertable (0x805f0002) a matrix could not be computed. ...
... components.results ...
Frame script loading and lifetime
essage manager (which is the global this), and sending a message. if you did not set the third argument to true in bootstrap.js on services.mm.addmessagelistener, sending this message during, and after, the unloading event will do nothing. ...
... is a race condition here due to the asynchronous nature of the message passing: your add-on is disabled for an upgrade. your add-on broadcasts "disable" to your frame scripts. your add-on is upgraded, and the new code loads new frame scripts. the new frame scripts receive the "disable" message and stop working. in fact, the message manager guarantees that loadframescript and broadcastasyn
cmessage are guaranteed to affect frame scripts in the order that they are called, so in this case "disable" will be received and consumed before the new frame scripts are loaded. at the moment, frame scripts are cached until the browser restarts: this problem is tracked as bug 1051238. this is a problem especially for restartless add-ons; because when a new version of the add-on is installed, the...
Process scripts
this example also figures out whether it is running in the chrome or in a content process by looking at the process type in services.appinfo. in just about every respect, using process scripts is like using frame scripts: you can pass the allowdelayedload to loadprocess...
... whether it is running in the chrome or in a content process by looking at the process type in services.appinfo. in just about every respect, using process scripts is like using frame scripts: you can pass the allowdelayedload to loadprocessscript(). if you do, you must call removedelayedprocessscript() when your extension is disabled or removed the message-passing apis are the same: sendasyn
cmessage() is available in both directions, while sendsyn
cmessage() is available from content to chrome only process scripts are system-privileged, and have access to the components object. however, process scripts are subject to the same kinds of limitations as frame scripts (for example, no file system access). process scripts stay loaded until their host process is closed. the environment for ...
L10n Checks
heck-l10n-completeness -i dir en-us/ my/ files (file) mode l10n checks can compare two files. you pass both paths to the files, e.g.: check-l10n-completeness -i file en-us.dtd my.dtd the output the output of l10n checks shows the missing and obsolete strings in a pseudo-diff format. ...
... files (file) mode l10n checks can compare two files. you pass both paths to the files, e.g.: check-l10n-completeness -i file en-us.dtd my.dtd the output the output of l10n checks shows the missing and obsolete strings in a pseudo-diff format. ab-cd browser chrome/browser browser.dtd +backforwardmenu.tooltip +fullzoomenlarge
cmd.commandkey3 +fullzoomreduce
cmd.commandkey2 +fullzoomreset
cmd.commandkey2 +organizebookmarks.label -showallbookmarks
cmd2.label migration/migration.dtd -importfromfile.accesskey -importfromfile.label +importfromhtmlfile.accesskey +importfromhtmlfile.label you can assume changed strings when you see entities removed and added with a similar name. the fi...
Mozilla DOM Hacking Guide
d) { ... }: help me! nsresult docheckpropertyaccess(...): help me! (bug 90757) static jsclass sdomconstructorprotoclass: xpconnect fu to expose the dom objects constructors to javascript. static jsfunctionspec sdomjsclass_methods[];: help me! (bug 91557) static nsixpconnect *sxpconnect: used to call nsixpconnect methods that we need. initialized in init(). static nsiscriptsecuritymanager *sse
cman: used by the dom security engine. initialized in init(). static nsresult definestaticjsvals(jscontext *cx);: used to define all the static jsstring data members of nsdomclassinfo. static prbool sisinitialized: keeps track of wether class info was already initialized, because init() shouldn't be called twice. static jsval *sx_id: strings used in the global resolve methods for comparison wit...
.... they represent special words for the dom. initialized by definestaticjsvals(). static const jsclass *sobjectclass: help me! static prbool sdosecuritycheckinaddproperty;: help me! nsdomclassinfo::init() this method is to be called only once. its purpose is, well, to initialize... it does a lot of different things: fill the blanks in the sclassinfodata array, initialize the sxpconnect and sse
cman data members, create a new javascript context, define the jsstring data members, and register class names and class prototypes. finally it sets sisinitialized to true. the actions that concern the dom are described below. first, the call to callgetservice() initializes sxpconnect. then the script security manager (sse
cman) is initialized. getsafejscontext() grabs us a cool js context to run ou...
NSS 3.12.5 release_notes
ze softoken. memory for the strings are owned by the caller, who is free to free them once nss_contextinit returns. if the string parameter is null (as opposed to empty, zero length), then the softoken default is used. these are equivalent to the parameters for pk11_configurepkcs11(). see the following struct in nss.h for details: nssinitparametersstr other new functions in se
cmod.h: se
cmod_getskipfirstflag se
cmod_getdefaultmoddbflag in prlink.h nss_securemem
cmp port_loadlibraryfromorigin modified functions sgn_update (see cryptohi.h) the parameter "input" of this function is changed from unsigned char * to const unsigned char *. pk11_configurepkcs11 (see nss.h) the name of some parameters have been slightly changed ...
... bug 525056: timing attack against ssl3ext.c:ssl3_serverhandlesessionticketxtn() bug 526689: ssl3 & tls renegotiation vulnerability documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation. new and revised documents available since the release of nss 3.11 include the following: build instructions nss shared db ...
NSS 3.14.2 release notes
cribed in the "bugs fixed" section below. nss 3.14.2 should be used with nspr 4.9.5 or newer. the release is available for download from https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_2_rtm/src/ for the primary nss documentation pages please visit /docs/nss new in nss 3.14.2 nss will now make use of the intel aes-ni and avx instruction sets for hardware-accelerated aes-g
cm on 64-bit linux systems. note: the new assembly code requires gnu as version 2.19 or newer. on red hat enterprise linux 5.x systems, install the binutils220 package and add /usr/libexec/binutils220 to the beginning of your path environment variable. initial manual pages for some nss command line tools have been added. they are still under review, and contributions are welcome. the documentation...
...w, and contributions are welcome. the documentation is in the docbook format and can be rendered as html and unix-style manual pages using an optional build target. new types: in certt.h cert_pi_useonlytrustanchors in secoidt.h sec_oid_ms_ext_key_usage_ctl_signing notable changes in nss 3.14.2 bug 805604 - support for aes-ni and avx accelerated aes-g
cm was contributed by shay gueron of intel. if compiled on linux systems in 64-bit mode, nss will include runtime detection to check if the platform supports aes-ni and pclmulqdq. if so, nss uses the optimized code path, reducing the cpu cycles per byte to 1/20 of what was required before the patch (https://bugzilla.mozilla.org/show_bug.cgi?id=805604 and https://crypto.stanford.edu/realworldcrypto/s...
NSS 3.15.1 release notes
nss 3.15.1 new functionality tls 1.2: tls 1.2 (rfc 5246) is supported. hmac-sha256 cipher suites (rfc 5246 and rfc 5289) are supported, allowing tls to be used without md5 and sha-1. note the following limitations. the hash function used in the signature for tls 1.2 client authentication must be the hash function of the tls 1.2 prf, which is always sha-256 in nss 3.15.1. aes g
cm cipher suites are not yet supported. new functions none. new types in sslprot.h ssl_library_version_tls_1_2 - the protocol version of tls 1.2 on the wire, value 0x0303. tls_dhe_rsa_with_aes_256_cbc_sha256, tls_rsa_with_aes_256_cbc_sha256, tls_ecdhe_ecdsa_with_aes_128_cbc_sha256, tls_ecdhe_rsa_with_aes_128_cbc_sha256, tls_dhe_rsa_with_aes_128_cbc_sha256, tls_rsa_with_a...
...nss 3.15.1 bug 856060 - enforce name constraints on the common name in libpkix when no subjectaltname is present. bug 875156 - add const to the function arguments of sec_certnicknameconflict. bug 877798 - fix ssltap to print the certificate_status handshake message correctly. bug 882829 - on windows, nss initialization fails if nss cannot call the rtlgenrandom function. bug 875601 - se
cmod_closeuserdb/se
cmod_openuserdb fails to reset the token delay, leading to spurious failures. bug 884072 - fix a typo in the header include guard macro of se
cmod.h. bug 876352 - certutil now warns if importing a pem file that contains a private key. bug 565296 - fix the bug that shlibsign exited with status 0 even though it failed. the nss_survive_double_bypass_failure build option is rem...
NSS 3.15 release notes
itemv2 - replaces secitem_reallocitem, which is now obsolete. secitem_reallocitemv2 better matches caller expectations, in that it updates item->len on allocation. for more details of the issues with secitem_reallocitem, see bug 298649 and bug 298938. in pk11pub.h pk11_decrypt - performs decryption as a single pkcs#11 operation (eg: not multi-part). this is necessary for aes-g
cm. pk11_encrypt - performs encryption as a single pkcs#11 operation (eg: not multi-part). this is necessary for aes-g
cm. new types in secitem.h secitemarray - represents a variable-length array of secitems. new macros in ssl.h ssl_enable_ocsp_stapling - used with ssl_optionset to configure tls client sockets to request the certificate_status exten...
...rtificate status responses stapled by the tls server to the ocsp cache. applications that use ssl_authcertificatehook to override the default handler should add appropriate calls to ssl_peerstapledocspresponse and cert_cacheocspresponsefromsidechannel. bug 554369: fixed correctness of cert_cacheocspresponsefromsidechannel and other ocsp caching behaviour. bug 853285: fixed bugs in aes g
cm. bug 341127: fix the invalid read in rc4_wordconv. faster nist curve p-256 implementation. dropped (32-bit) sparc v8 processor support on solaris. the shared library libfreebl_32int_3.so is no longer produced. bugs fixed in nss 3.15 this bugzilla query returns all the bugs fixed in nss 3.15: https://bugzilla.mozilla.org/buglist.cgi?list_id=6278317&resolution=fixed&classification=components...
NSS 3.24 release notes
updated with the latest national institute of standards and technology (nist) guidance (as of 2015): software integrity checks and post functions are executed on shared library load. these checks have been disabled by default, as they can cause a performance regression. to enable these checks, you must define symbol nss_force_fips when building nss. counter mode and galois/counter mode (g
cm) have checks to prevent counter overflow. additional csps are zeroed in the code. nss softoken uses new guidance for how many rabin-miller tests are needed to verify a prime based on prime size. nss softoken has also been updated to allow nss to run in fips level 1 (no password). this mode is triggered by setting the database password to the empty string. in fips mode, you may move fr...
...e of the certificate, stapled ocsp responses, or signed certificate timestamps (used for certificate transparency). in secport.h portcheaparenapool - a stack-allocated arena pool, to be used for temporary arena allocations. new macros in pkcs11t.h ckm_tls12_mac in secoidt.h sec_oid_tls_ecdhe_psk - this oid governs the use of the tls_ecdhe_psk_with_aes_128_g
cm_sha256 cipher suite, which is used only for session resumption in tls 1.3. notable changes in nss 3.24 additions, deprecations, and other changes in nss 3.24 are listed below. deprecate the following functions. (applications should instead use the new ssl_configservercert function.) ssl_setstapledocspresponses ssl_setsignedcerttimestamps ssl_configsecureserver ssl_config...
NSS 3.50 release notes
bug 1547639 - update zlib in nss to 1.2.11 bug 1609181 - detect arm (32-bit) cpu features on freebsd bug 1602386 - fix build on freebsd/powerpc* bug 1608151 - introduce nss_disable_altivec bug 1612623 - depend on nspr 4.25 bug 1609673 - fix a crash when nss is com...
... bug 1547639 - update zlib in nss to 1.2.11 bug 1609181 - detect arm (32-bit) cpu features on freebsd bug 1602386 - fix build on freebsd/powerpc* bug 1608151 - introduce nss_disable_altivec bug 1612623 - depend on nspr 4.25 bug 1609673 - fix a crash when nss is compiled without libnssdbm support, but the nssdb...
NSS 3.51 release notes
d: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_51_rtm/src/ other releases are available in nss releases. notable changes in nss 3.51 updated dtls 1.3 implementation to draft-34. see bug 1608892 for details. bugs fixed in nss 3.51 bug 1608892 - update dtls 1.3 implementation to draft-34. bug 1611209 - correct swapped pkcs11 values of ckm_aes_
cmac and ckm_aes_
cmac_general bug 1612259 - complete integration of wycheproof ecdh test cases bug 1614183 - check if ppc __has_include(<sys/auxv.h>) bug 1614786 - fix a compilation error for ‘getfipsenv’ "defined but not used" bug 1615208 - send dtls version numbers in dtls 1.3 supported_versions extension to avoid an incompatibility. bug 1538980 - secu_readderfromfile calls strstr on a st...
...a program linked with older nss ...
NSS Config Options
future key words (not yet implemented): enable: turn on ciphersuites by default. disable: turn off ciphersuites by de...
...431r1 sect113r1 sect131r1 sect131r1 sect131r2 sect163k1 sect163r1 sect163r2 sect193r1 sect193r2 sect233k1 sect233r1 sect239k1 sect283k1 sect283r1 sect409k1 sect409r1 sect571k1 sect571r1 hashes md2 md4 md5 sha1 sha224 sha256 sha384 sha512 macs hmac-sha1 hmac-sha224 hmac-sha256 hmac-sha384 hmac-sha512 hmac-md5 ciphers aes128-cbc aes192-cbc aes256-cbc aes128-g
cm aes192-g
cm aes256-g
cm camellia128-cbc camellia192-cbc camellia256-cbc seed-cbc des-ede3-cbc des-40-cbc des-cbc null-cipher rc2 rc4 idea ssl key exchanges rsa rsa-export dhe-rsa dhe-dss dh-rsa dh-dss ecdhe-ecdsa ecdhe-rsa ecdh-ecdsa ecdh-rsa restrictions for asymmetric keys (integers) rsa-min dh-min dsa-min constraints on ssl protocols versions (integers) tls-version-...
NSS Sample Code Sample_2_Initialization of NSS
try again.\n"); } /* clear out the duplicate password string */ if (p1) { port_memset(p1, 0, port_strlen(p1)); port_free(p1); } fclose(input); fclose(output); return p0; } /* change the password */ secstatus changepw(pk11slotinfo *slot, char *oldpass, char *newpass, ...
... */ rv = changepw(slot, plainpass, 0, pwfile, 0); if (rv != secsuccess) { pr_fprintf(pr_stderr, "failed to change password\n"); } if (slot) { pk11_freeslot(slot); } rvshutdown = nss_shutdown(); if (rvshutdown != secsuccess)...
Hashing - sample 1
s illustrates the use of nss message apis. /* this source code form is subject to the terms of the mozilla public * license, v. 2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
..."sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* * maps a hash name to a secoidtag. ...
Initialize NSS database - sample 2
try again.\n"); } /* clear out the duplicate password string */ if (p1) { port_memset(p1, 0, port_strlen(p1)); port_free(p1); } fclose(input); fclose(output); return p0; } /* * changepw */ secstatus changepw(pk11slotinfo *slot, char *oldpass, char *newpass, ...
... */ rv = changepw(slot, plainpass, 0, pwfile, 0); if (rv != secsuccess) { pr_fprintf(pr_stderr, "failed to change password\n"); } if (slot) { pk11_freeslot(slot); } rvshutdown = nss_shutdown(); if (rvshutdown != secsuccess)...
sample1
1. a program to compute the hash of a file and save it to another file. /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> #include <prprf.h> /* nss headers */ #include <secoid.h> #include <se
cmodt.h> #include <sechash.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */ static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* maps a hash name to a secoidtag. * returns null if the name is not a supported algorithm */ static secoidtag hashnametooidtag(const char ...
...ec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* maps a hash name to a secoidtag. ...
NSS tools : pk12util
the security database to a pkcs#12 file. arguments -c keycipher specify the key encryption algorithm. -c certcipher specify the key cert (overall package) encryption algorithm. -d [sql:]directory specify the database directory into which to import to or export from certificates and keys. pk12util supports two types of databases: the legacy security databases (cert8.db, key3.db, and se
cmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. -h tokenname specify the name of the token to import into or export from. -k slotpasswordfile specify the text file containing the slot's password. -k slotpassword specify the slot's password. -m | --key-len keylength ...
... best fit will be selected (usually the default). if no suitable replacement for the desired algorithm can be found, the tool returns the error no security module can perform the requested operation. nss database types nss originally used berkeleydb databases to store security information. the last versions of these legacy databases are: o cert8.db for certificates o key3.db for keys o se
cmod.db for pkcs #11 module information berkeleydb has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. still, nss requires more flexibility to provide a truly share...
NSS reference
t nss_initreadwrite nss_nodb_init nss_initialize nss_shutdown utility functions based on "utility functions" in nss public functions. certificate functions based on certificate functions in the ssl reference and "certificate functions" in nss public functions. ...
...ers. random number generation this api consists of the two routines used for pseudorandom number generation -- pk11_generaterandomonslot and pk11_generaterandom -- and the two routines used for seeding pseudorandom number generation -- pk11_seedrandom and pk11_randomupdate. pkcs #11 functions based on pkcs #11 functions in the ssl reference and "crypto functions" in nss public functions. se
cmod_loadusermodule se
cmod_unloadusermodule se
cmod_closeuserdb se
cmod_openuserdb pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc ssl functions based on "ssl functions" in the ssl reference and "ssl functions" and "deprecated ssl functions" in nss public functions. ssl_configserversession...
gtstd.html
s operations. on any given server or client, one or more pkcs #11 modules may be available. figure 2.1 relationships among nss libraries, cryptographic modules, slots, and tokens as shown in the figure, ssl communicates with pkcs #11 modules through the pkcs #11 interface. any pkcs #11 module that supports pkcs #11 can be used with the nss libraries. netscape software uses a file called se
cmod.db to keep track of the modules available. a pkcs #11 module always has one or more slots, which may be implemented as physical hardware slots in some form of physical reader (for example, for smart cards) or as conceptual slots in software. each slot for a pkcs #11 module can in turn contain a token, which is the hardware or software device that actually provides cryptographic services and o...
...rtificates from either a public ca or from a certificate server such as netscape certificate management system. the instructions that follow assume you are using the certificate database tool to set up both the server and client databases for testing purposes. you can use the security module database tool, a command-line utility that comes with nss, to manage pkcs #11 module information within se
cmod.db files. the security module database tool allows you to add and delete pkcs #11 modules, change passwords, set defaults, list module contents, enable or disable slots, enable or disable fips-140-1 compliance, and assign default providers for cryptographic operations. setting up the certificate and key databases before you can run the sample programs (server.c and client.c) that come wit...
sslerr.html
specified template was invalid." sec_error_crl...
...specified template was invalid." sec_error_crl_not_found -8055 "no matching crl was found." sec_error_reused_issuer_and_serial -8054 "you are ...
sslfnc.html
configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code. description nss_init opens the certn.db, keyn.db, and se
cmod.db files (wheren is a numeric digit) in the specified directory. nss_init isnot idempotent, so call it only once. nss_init opens the database files read-only. if you are performing operations that require write permission, for example s/mime operations such as adding a certificate, use nss_initreadwrite instead. before calling nss_init, your program must call pr_init. the policy flags fo...
... configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code. description nss_initreadwrite opens the certn.db, keyn.db, and se
cmod.db files (wheren is a numeric digit) with both read and write permission in the specified directory. nss_initreadwrite isnot idempotent, so call it only once. use nss_initreadwrite rather than nss_init if you are performing operations that require write permission, such as some s/mime operations. before calling nss_initreadwrite, your program must call pr_init. the policy flags for all ci...
NSS_3.12.3_release_notes.html
nss_seed nss_seed_cbc seed_block_size seed_key_length in pkcs11t.h: ckk_seed ckm_seed_key_gen ckm_seed_ecb ckm_seed_cbc ckm_seed_mac ckm_seed_mac_general ckm_seed_cbc_pad ckm_seed_ecb_encrypt_data ckm_seed_cbc_encrypt_data in se
cmod.h: public_mech_seed_flag in se
cmodt.h: se
cmod_seed_flag in secoidt.h: sec_oid_seed_cbc in sslproto.h: tls_rsa_with_seed_cbc_sha in sslt.h: ssl_calg_seed new structure for seed support: (see blapit.h) seedcontextstr ...
... bugs fixed the following bugs have been fixed in nss 3.12.3. bug 159483: cert name matching: rfc 2818 vs. backwards compatibility (wildcards) bug 334678: prng_fips1861.c redefines the macro bsize on hp-ux bug ...
NSS tools : pk12util
atabase to a pkcs#12 file. arguments -n certname specify the nickname of the cert and private key to export. -d [sql:]directory specify the database directory into which to import to or export from certificates and keys. pk12util supports two types of databases: the legacy security databases (cert8.db, key3.db, and se
cmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. -p prefix specify the prefix used on the certificate and key databases. this option is provided as a special case. changing the names of the certificate and k...
... (usually the default). if no suitable replacement for the desired algorithm can be found, the tool returns the error no security module can perform the requested operation. nss database types nss originally used berkeleydb databases to store security information. the last versions of these legacy databases are: o cert8.db for certificates o key3.db for keys o se
cmod.db for pkcs #11 module information berkeleydb has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. still, nss requires more flexibility to provide a t...
NSS tools : signver
ts of the signed object. options -a displays all of the information in the pkcs#7 signature. -v verifies the digital signature. -d [sql:]directory specify the database directory which contains the certificates and keys. signver supports two types of databases: the legacy security databases (cert8.db, key3.db, and se
cmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). if the prefix sql: is not used, then the tool assumes that the given databases are in the old format. -a sets that the given signature file is in ascii format. -i input_file gives the input file for the object with signed data. -o output_file gives t...
...tained in a signature file. using the -o option prints the signature file information to the given output file rather than stdout. signver -a -s signature_file -o output_file nss database types nss originally used berkeleydb databases to store security information. the last versions of these legacy databases are: o cert8.db for certificates o key3.db for keys o se
cmod.db for pkcs #11 module information berkeleydb has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously. nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues. still, nss requires more flexibility to provide a t...
SpiderMonkey Internals
alk-through at heart, spidermonkey is a fast interpreter that runs an untyped bytecode and operates on values of type js::value—type-tagged values that represent the full range of javascript values. in addition to the interpreter, spidermonkey contains a just-in-time (jit) compiler, a garbage collector, code implementing the basic behavior of javascript values, a standard library implementing e
cma 262-5.1 §15 with various extensions, and a few public apis. interpreter like many portable interpreters, spidermonkey's interpreter is mainly a single, tremendously long function that steps through the bytecode one instruction at a time, using a switch statement (or faster alternative, depending on the compiler) to jump to the appropriate chunk of code for the current instruction. a js-to-js ...
...rty name hashing, and as members of the root gc set for exact gc. standard library the methods for arrays, booleans, dates, functions, numbers, and strings are implemented using the js api. most are jsfastnatives. most string methods are customized to accept a primitive string as the this argument. (otherwise, spidermonkey converts primitive values to objects before invoking their methods, per e
cma 262-3 §11.2.1.) error handling spidermonkey has two interdependent error-handling systems: javascript exceptions (which are not implemented with, or even compatible with, any kind of native c/c++ exception handling) and error reporting. in general, both functions inside spidermonkey and jsapi callback functions signal errors by calling js_reporterror or one of its variants, or js_setpendingex...
JSAPI User Guide
ate it and js_destroyruntime to clean it up when you're done. when your application is done with spidermonkey altogether, use js_shutdown to free any remaining cached resources. (this is a mere nicety if the process is about to exit anyway. but as that is not always the case, calling js_shutdown is a good habit to get into.) the context: use js_newcontext and js_destroycontext. for maximum e
cmascript standard compliance, applications should also use js_setoptions to enable jsoption_varobjfix. to get the latest javascript language features, applications may use js_setversion. error reporting is also per-context and is enabled using js_seterrorreporter. the global object: to create this object, you first need a jsclass with the jsclass_global_flags option. the example below defines...
... does not use c++ exceptions for anything. jsapi functions never throw c++ exceptions, and when spidermonkey calls an application callback, the callback must not throw a c++ exception. throwing and catching exceptions we have already seen one example of how to throw an exception from a jsnative function. simply call js_reporterror, with printf-style arguments, and return false. rc = system(
cmd); if (rc != 0) { /* throw a javascript exception. */ js_reporterror(cx, "command failed with exit code %d", rc); return false; } this is very much like the javascript statement throw new error("command failed with exit code " + rc);. again, note that calling js_reporterror does not cause a c++ exception to be thrown. it only creates a new javascript error object...
JSVersion
_0obsolete since jsapi 24 100 javascript 1.0 "1.0" jsversion_1_1obsolete since jsapi 24 110 javascript 1.1 "1.1" jsversion_1_2obsolete since jsapi 24 120 javascript 1.2 "1.2" jsversion_1_3obsolete since jsapi 24 130 javascript 1.3 "1.3" jsversion_1_4obsolete since jsapi 24 140 javascript 1.4 "1.4" jsversion_e
cma_3 148 e
cma 262 edition 3 "e
cmav3" jsversion_1_5obsolete since jsapi 24 150 javascript 1.5 "1.5" jsversion_1_6 160 javascript 1.6 "1.6" jsversion_1_7 170 javascript 1.7 "1.7" jsversion_1_8 180 javascript 1.8 "1.8" jsversion_e
cma_5 185 e
cma 262 edition 5 "e
cmav5" jsversion_default 0 la...
... jsversion_1_7 170 javascript 1.7 "1.7" jsversion_1_8 180 javascript 1.8 "1.8" jsversion_e
cma_5 185 e
cma 262 edition 5 "e
cmav5" jsversion_default 0 latest javascript version, but omitting web-incompatible extensions "default" jsversion_unknown -1 unknown javascript version null jsversion_latest jsversion_e
cma_5 latest javascript version null see also mxr id search for jsversion js_getversion js_setversion js_stringtoversion js_versiontostring bug 824312 ...
JS_DefaultValue
ct. hint must be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint. do not pass any other type. vp js::mutablehandle<js::value> out parameter. on success, *vp receives the converted value. description js_defaultvalue converts a javascript object, obj, to a primitive value using that object's [[defaultvalue]] hook. e
cmascript specifies that all objects have a [[defaultvalue]] hook. objects with classes defined by e
cmascript itself all use the [[defaultvalue]] algorithm specified in §8.12.8 (but note the algorithm's special case for date objects). objects with a custom jsclass specified by the embedder will invoke that class's convert hook, which must convert the object to a primitive value, to determine the pr...
...he [[defaultvalue]] algorithm specified in §8.12.8 (but note the algorithm's special case for date objects). objects with a custom jsclass specified by the embedder will invoke that class's convert hook, which must convert the object to a primitive value, to determine the primitive result of conversion. behavior when the convert hook is js_convertstub is identical to that for objects defined by e
cmascript. on success, js_defaultvalue stores the converted value in *vp and returns true. on error or exception, it returns false, and the value left in *vp is undefined. see also mxr id search for js_defaultvalue js::toprimitive bug 1054756 - renamed to js::toprimitive ...
JS_InitStandardClasses
d object classes. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> the global object to initialize. this object must be of a jsclass that has the jsclass_global_flags bits set. description js_initstandardclasses initializes the built-in javascript global properties. ...
... js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> the global object to initialize. this object must be of a jsclass that has the jsclass_global_flags bits set. description js_initstandardclasses initializes the built-in javascript global properties. ...
JS_IsIdentifier
syntax bool js_isidentifier(jscontext *cx, js::handlestring str, bool *isidentifier); bool js_isidentifier(const char16_t *chars, size_t length); // added in spidermonkey 38 name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str js::handlestring the string to test. chars const char16_t * the pointer of the string to test. ...
...quest on this jscontext. str js::handlestring the string to test. chars const char16_t * the pointer of the string to test. length size_t the length of chars. isidentifier bool * out parameter. on success, *isidentifier receives whether str is an identifier or not. description js_isidentifier tests if the given string is a valid e
cmascript identifier. on successful, js_isidentifier stores the test result to *isidentifier and returns true, otherwise returns false and the value of *isidentifier is undefined. js_isidentifier which takes chars and length is infallible, so just returns whether the chars are an identifier. see also mxr id search for js_isidentifier js_valuetoid bug 692627 bug 990484 ...
JS_ParseJSON
syntax jsbool js_parsejson(jscontext *cx, const jschar *chars, uint32 len, jsval *vp); jsbool js_parsejsonwithreviver(jscontext *cx, const jschar *chars, uint32 len, jsval reviver, jsval *vp); name type description cx jscontext * pointer to a js context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ch jsobject * the object to be searched. chars const jschar * the characters of the string. len uint32 the length of the string. ...
...a reviver function to apply to the created value after parsing; see json.parse. vp jsval * out parameter. *vp receives the value after parsing (and optionally, processing by the reviver). if an error occurs, the value left in *vp is undefined. description use these functions to parse a sequence of characters as json. the parsing rules applied by these methods are exactly those specified by e
cmascript 5. various json extensions like trailing commas, unquoted property names, more generous number parsing, and so on are not supported. mxr id search for js_parsejson mxr id search for js_parsejsonwithreviver ...
JS_PushArguments
nter to pass back to js_poparguments. format is a sequential character array, where each element of the array indicates the js type into which to convert the next c/c++ argument. ...
...character array, where each element of the array indicates the js type into which to convert the next c/c++ argument. format can contain one or more instances of the following characters, as appropriate: character argument type b jsbool c uint16 (16-bit, unsigned integer) i int32 (32-bit, e
cma-compliant signed integer) u uint32 (32-bit, e
cma-compliant, unsigned integer) j int32 (32-bit, signed integer) d jsdouble i jsdouble (converted to an integer value) s char * (c string) s jsstring * (unicode string) w jschar * (unicode null-terminated string) o jsobject * f jsfunction * * none. any asterisks (*) in format are ignored. ...
JS_SetDefaultLocale
note that the internationalization api encourages clients to specify their own locales. ...
... note that the internationalization api encourages clients to specify their own locales. the locale string remains owned by the caller. js_resetdefaultlocale resets the default locale to os defaults. ...
JS_StringToVersion
a jsversion value. ...
..._stringtoversion may return any of the following values: string enumeration "1.0" jsversion_1_0 obsolete since jsapi 24 "1.1" jsversion_1_1 obsolete since jsapi 24 "1.2" jsversion_1_2 obsolete since jsapi 24 "1.3" jsversion_1_3 obsolete since jsapi 24 "1.4" jsversion_1_4 obsolete since jsapi 24 "e
cmav3" jsversion_e
cma_3 "1.5" jsversion_1_5 obsolete since jsapi 24 "1.6" jsversion_1_6 "1.7" jsversion_1_7 "1.8" jsversion_1_8 other jsversion_unknown see also mxr id search for js_stringtoversion jsversion js_getversion js_setversionforcompartment js_versiontostring bug 824312 ...
JS_ValueToInt32
if the result is nan, an infinity, or a number outside the 32-bit range, js_valuetoint32 reports an error and conversion fails. otherwise, the floating-point number is rounded to the nearest integer value. on success, js_valuetoint32 stores the converted value in *ip and returns js_true. on error or exception, it returns js_false, and the value left in *ip is undefined. ...
...e 32-bit range, js_valuetoint32 reports an error and conversion fails. otherwise, the floating-point number is rounded to the nearest integer value. on success, js_valuetoint32 stores the converted value in *ip and returns js_true. on error or exception, it returns js_false, and the value left in *ip is undefined. js_valuetoint32 is pre-e
cma-262 edition 1, and rounds differently than js_valuetoe
cmaint32 and js::toint32. this routine was added for layers-based graphics programming in netscape 4, but unless you know you need its rounding behavior, it is best to avoid it in favour of js::toint32. js::toint32 rounds as specified in e
cma 262-3 §9.5, while this routine rounds by adding 0.5 to the converted float-point number and truncating the result at the decimal point. js::toint32 will also ...
JS_ValueToNumber
to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert. dp jsdouble * out parameter. on success, *dp receives the converted floating-point value. description js_valuetonumber converts a javascript value to a number. it implements the tonumber operator described in e
cma 262-3 §9.3. if v is already a number, conversion succeeds. if v is undefined, null, false, or true, conversion succeeds, and the result is nan, 0, 0, or 1 respectively. if v is a string, conversion proceeds as specified in e
cma 262-3 §9.3.1. js_valuetonumber always succeeds in this case, returning js_true. if the string is not a numeric string, *dp is set to nan. otherwise v is an object...
...converted to a number as described above and conversion succeeds. otherwise conversion fails with a typeerror. on success, js_valuetonumber stores the converted value in *dp and returns js_true. on error or exception, it returns js_false, and the value left in *dp is undefined. see also js_convertarguments js_convertvalue js_gettypename js_typeofvalue js_valuetoint32 js_valuetoe
cmaint32 bug 884410 ...
JS_VersionToString
entation. ...
...s_versiontostring may return any of the following values: enumeration string jsversion_1_0 "1.0" obsolete since jsapi 24 jsversion_1_1 "1.1" obsolete since jsapi 24 jsversion_1_2 "1.2" obsolete since jsapi 24 jsversion_1_3 "1.3" obsolete since jsapi 24 jsversion_1_4 "1.4" obsolete since jsapi 24 jsversion_e
cma_3 "e
cmav3" jsversion_1_5 "1.5" obsolete since jsapi 24 jsversion_1_6 "1.6" jsversion_1_7 "1.7" jsversion_1_8 "1.8" jsversion_e
cma_5 "e
cmav5" jsversion_default "default" other null see also mxr id search for js_stringtoversion jsversion js_getversion js_setversionforcompartment js_stringtoversion bug 824312 ...
SpiderMonkey 1.8.5
the source download page. the mozilla javascript team is pleased to announce the release of spidermonkey 1.8.5. you can download full source code here: http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz (md5 checksum: a4574365938222adca0a6bd33329cb32). spidermonkey 1.8.5 is the javascript engine that shipped in firefox 4.0. it is much faster than spidermonkey 1.8, implements es-5 (e
cma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 platform support spidermonkey 1.8.5 is supported on all the platforms where fi...
..._jsval, and uint_to_jsval, which are faster and can't fail. js_getstringbytes and js_getstringchars are gone. there is no longer an infallible way to examine string characters. applications must use js_getstringcharsandlength or js_encodestring/js_free and check for errors. these and other changes are explained in detail below. new javascript language features javascript 1.8.5 adds support for e
cmascript edition 5, including es5 strict mode. for details, see new in javascript 1.8.5. note that there are a very small number of incompatibilities between es5 and and es3, the version of e
cmascript supported by spidermonkey versions 1.5 through 1.8. these are discussed in annex e of the es5 specification. spidermonkey 1.8.5 also ships with js-ctypes, a foreign-function interface for privileged ...
SpiderMonkey 1.8.7
notes. xxx needs updating the mozilla javascript team is pleased to announce the release of spidermonkey 1.8.5. you can download full source code here: http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz (md5 checksum: a4574365938222adca0a6bd33329cb32). spidermonkey 1.8.5 is the javascript engine that shipped in firefox 4.0. it is much faster than spidermonkey 1.8, implements es-5 (e
cma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 platform support spidermonkey 1.8.7 is supported on all the platforms where fi...
...will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. xxx is there anything here? these and other changes are explained in detail below. new javascript language features xxx needs updating javascript 1.8.5 adds support for e
cmascript edition 5, including es5 strict mode. for details, see new in javascript 1.8.5. note that there are a very small number of incompatibilities between es5 and and es3, the version of e
cmascript supported by spidermonkey versions 1.5 through 1.8. these are discussed in annex e of the es5 specification. spidermonkey 1.8.5 also ships with js-ctypes, a foreign-function interface for privileged ...
compare-locales
owser.toml, mobile_android.toml, mail.toml and calendar.toml, and suite.toml. options to get a brief list of available options, use the --help flag: $ compare-locales --help the output the output of compare-locales shows the missing and obsolete strings in a pseudo-diff format. ...
...l and calendar.toml, and suite.toml. options to get a brief list of available options, use the --help flag: $ compare-locales --help the output the output of compare-locales shows the missing and obsolete strings in a pseudo-diff format. ab-cd browser chrome/browser browser.dtd +backforwardmenu.tooltip +fullzoomenlarge
cmd.commandkey3 +fullzoomreduce
cmd.commandkey2 +fullzoomreset
cmd.commandkey2 +organizebookmarks.label -showallbookmarks
cmd2.label migration/migration.dtd -importfromfile.accesskey -importfromfile.label +importfromhtmlfile.accesskey +importfromhtmlfile.label you can assume changed strings when you see entities removed and added with a similar name. the f...
Embedded Dialog API
ncerned with a consistent overall dialog appearance will probably choose to implement the complete api as well. an embedding application must implement the nsiwindowcreator nsiwindowcreator interface and hand off a reference to the implementation to the windowcreator service during application initialization. an example of this can be found in the mfc embedding testbed application, in the method
cmfcembedapp::initializewindowcreator (lxr link accurate at revision 1.20 of that file; search for the method name in later revisions). gecko uses nsiwindowcreator to create all new windows for which no explicit override (the advanced api) has been given, and for browser windows in general. the precise appearance and contents of the new window are defined by the application, though the app should co...
...nstance is part of the embedding component), registered as a component during gecko initialization (by ns_initembedding). (line number accurate in version 1.30). after initializing embedding, an application can override a default factory by registering its replacement. a powerplant example can be found at cbrowserapp::overridecomponents (line number accurate in version 1.24) and an mfc example at
cmfcembedapp::overridecomponents (line number accurate in version 1.20). the powerplant example is more is more straightforward.its promptservice is implemented directly in the application executable, not as a separate library. this is perfectly workable, as the example illustrates. the mfc example implements its promptservice in a separate dll, and overrides the default promptservice only if it is ...
NS_InitXPCOM3
« xpcom api reference summary the ns_initxpcom3 function initiates use of xpcom in the calling process with support for statically defined xpcom modules. #include "nsxpcom.h" nsresult ns_initxpcom3( nsiservicemanager** aresult, nsifile* abindirectory, nsidirectoryserviceprovider* aappfilelocationprovider, nsstati
cmoduleinfo const* astati
cmodules, pruint32 astati
cmodulecount ); parameters aresult [out] the resulting xpcom service manager. you may pass null if you are not interested in this return value. the service manager may alternatively be accessed by calling ns_getservicemanager. the resulting interface pointer is addref'd upon return and must either be release'd explicitly or passed to ns_shutdownxpcom when the application is finished with xpcom. abindir...
...is finished with xpcom. abindirectory [in] the directory containing the component registry and runtime libraries. pass null to specify that the current working directory should be used. aappfilelocationprovider [in] the object to be used by xpcom to locate application specific directories and files (e.g., the user profile, the component registry, etc.). this parameter may be nsnull. astati
cmodules [in] an array of nsstati
cmoduleinfo objects. passing null causes the default (built-in) static modules to be registered, if present. astati
cmodulecount [in] the number of elements in astati
cmodules. return values the ns_initxpcom3 function returns ns_ok if successful. otherwise, it returns an error code. some of the possible errors are documented below: ns_error_not_initialized in...
NS_ShutdownXPCOM
return values the ns_shutdownxpcom function returns ns_ok if successful. otherwise, it returns an error code. remarks you must call this method once you are finished using xpcom. ...
... return values the ns_shutdownxpcom function returns ns_ok if successful. otherwise, it returns an error code. remarks you must call this method once you are finished using xpcom. ...
nsIControllers
content/xul/document/public/nsicontrollers.idlscriptable represents a list of nsicontroller elements. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) this interface is used to manage instances of the nsicontroller interface. windows and text inputs have default controllers that allow commands such as
cmd_copy to act on the focused element or window. xul elements can also have controllers, although they do not have any default controllers. implemented by: @mozilla.org/xul/xul-controllers;1. you should not normally need to create an instance, as you normally need to alter the window or element's existing list of controllers. to create an instance, use: var controllers = components.classes["@mozilla.org/xul/xul-controllers;1"] .createi...
...emoved. getcontrollercount() returns the current number of controllers. unsigned long getcontrollercount(); parameters none. return value the number of controllers currently in the list of controllers. getcontrollerforcommand() searches for a controller that supports the given command. nsicontroller getcontrollerforcommand( in string command ); parameters command the name of a command, e.g.
cmd_copy return value the first controller in the list that supports the given command. getcontrollerid() returns the order of insertion of a controller. unsigned long getcontrollerid( in nsicontroller controller ); parameters controller the controller for which you want to retrieve the insertion index. return value the id in which the controller was inserted. exceptions thrown ns_error_failu...
nsIDocShell
bute when the nsidocshell is loading a document from the network. busy_flags_before_page_load 2 returned by the busyflags attribute when the nsidocshell has started loading a document from the network, but no data has been received yet. busy_flags_page_loading 4 returned by the busyflags attribute when the nsidocshell is receiving data from the network. ...
...fore_page_load 2 returned by the busyflags attribute when the nsidocshell has started loading a document from the network, but no data has been received yet. busy_flags_page_loading 4 returned by the busyflags attribute when the nsidocshell is receiving data from the network. load_
cmd_normal 0x1 returned by the loadtype attribute for normal loads. load_
cmd_reload 0x2 returned by the loadtype attribute for reloads. load_
cmd_history 0x4 returned by the loadtype attribute for history navigation. load_
cmd_pushstate 0x8 returned by the loadtype attribute when the page has used history.pushstate() character set source constants these constants are not exposed to script. they are used internally as values for th...
nsIMessageListener
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisupports this interface is used to receive messages sent using the nsimessagebroadcaster, nsimessagesender, or nsisyn
cmessagesender interfaces. listeners are attached using the nsimessagelistenermanager interface. methods void receivemessage(); receivemessage() this is for js only. this function receives a message from one of the three message-sending functions in the message manager framework: broadcastasyn
cmessage sendasyn
cmessage sendsyn
cmessage. the received message is an object with the following properties: target the target of the message. either an element owning the message manager, or the message manager itself if no element owns it. if the message ...
... the message manager itself if no element owns it. if the message was sent from a frame script using a nsicontentframemessagemanager, then this property is the xul <browser> element for the frame from which the message was sent. name the message name. this is the first argument passed into the message-sending function. sync true if the message was sent using sendsyn
cmessage, false otherwise. data a structured clone of the message payload: the second argument passed into the message-sending function. json same as data. deprecated. objects an object whose properties are any cross process object wrappers exposed by the sender as the third argument to the message-sending function. principal principal for the window a...
nsIWebProgressListener
istener", "nsisupportsweakreference"]), onstatechange: function(awebprogress, arequest, aflag, astatus) { let win = awebprogress.domwindow; let outerwindowid = win.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindowutils) .outerwindowid; sendasyn
cmessage("myaddonmessage", { name: "onstatechange", flag: aflag, status: astatus, }); }, onlocationchange: function(aprogress, arequest, auri, aflag) { let win = awebprogress.domwindow; let outerwindowid = win.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindowutils) ...
...tatechange", flag: aflag, status: astatus, }); }, onlocationchange: function(aprogress, arequest, auri, aflag) { let win = awebprogress.domwindow; let outerwindowid = win.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindowutils) .outerwindowid; sendasyn
cmessage("myaddonmessage", { name: "onlocationchange", outerwindowid: outerwindowid, uri: auri.spec, charset: auri.charset, flag: aflag, }); }, // for definitions of the remaining functions see related documentation onprogresschange: function(awebprogress, arequest, curself, maxself, curtot, maxtot) {}, onstatuschan...
Xptcall Porting Guide
inheritor of this class. // return a refcounted pointer to the interfaceinfo for this object // note: on some platforms this must not fail or we crash! ns_imethod getinterfaceinfo(nsiinterfaceinfo** info) = 0; // call this method and return result ns_imethod callmethod(pruint16 methodindex, const nsxptmethodinfo* info, nsxpt
cminivariant* params) = 0; }; code that wishes to make use of this stubs functionality (such as xpconnect) implement a class which inherits from nsxptcstubbase and implements the getinterfaceinfo and callmethod to let the platform specific code know how to get interface information and how to dispatch methods once their parameters have been pulled out of the platform specific calling frame. porters...
... methods that fill the vtbl for this class. the idea here is that the class has a vtbl full of a large number of generic stubs. all instances of this class share that vtbl and the same stubs. the stubs forward calls to a platform specific method that uses the interface information supplied by the overridden getinterfaceinfo to extract the parameters and build an array of platform independent nsxpt
cminivariant structs which are in turn passed on to the overridden callmethod. the platform dependent code is responsible for doing any cleanup and returning. the stub methods are declared in xptcall/public/xptcstubsdecl.inc. these are '#included' into the declaration of nsxptcstubbase. a similar include file (xptcall/public/xptcstubsdef.inc) is expanded using platform specific macros to define the ...
Main Windows
s, along with their associated javascript. msghdrviewoverlay.xul shown in blue above (where?), this overlay consists of three boxes. two are stacked showing either a brief or expanded view of the headers. the third is the attachment box which can be toggled into a slim or an expanded view basemenuoverlay.xul contains the contents of most of the menus (i.e. file, edit, view, etc). osx only: ma
cmenuoverlay.xul a special overlay for osx that adds a few items to the window menu. messagewindow.xul messagewindow.xul is shown when a message is opened. its almost exactly the same as messenger.xul in terms of overlays, but just lacks the folder and threadpanes normally shown. menus, toolbar buttons, and headers are all taken from exactly the same overlays listed above though. mailwindowo...
... thunderbird, along with a whole lot of javascript. msghdrviewoverlay.xul shown in blue above, this overlay consists of three boxes. two are stacked showing either a brief or expanded view of the headers. the third is the attachment box which can be toggled into a slim or an expanded view basemenuoverlay.xul contains the contents of most of the menus (i.e. file, edit, view, etc). osx only: ma
cmenuoverlay.xul a special overlay for osx that adds a few items to the window menu. customizetoolbar.xul and customizetoolbarsheet.xul these are two old files from when the original customizable toolbars were ported from firefox (phoenix at the time) to thunderbird (minotaur at the time). customizetoolbar.xul looks and acts a whole lot like the toolkit's customizetoolbar.xul. items have the sam...
Browser Console - Firefox Developer Tools
"enable browser chrome and add-on debugging toolboxes" (firefox 40 and later) option in the developer tool settings. opening the browser console you can open the browser console in one of two ways: from the menu: select "browser console" from the web developer submenu in the firefox menu (or tools menu if you display the menu bar or are on macos). from the keyboard: press ctrl+shift+j (or
cmd+shift+j on a mac). you can also start the browser console by launching firefox from the command line and passing the -jsconsole argument: /applications/firefoxaurora.app/contents/macos/firefox-bin -jsconsole the browser console looks like this: you can see that the browser console looks and behaves very much like the web console: most of the window is occupied by a pane that display me...
...ntlistener("load", function() { newtabbrowser.contentdocument.body.innerhtml = "<h1>this page has been eaten</h1>"; }, true); newtabbrowser.contentdocument.location.href = "https://mozilla.org/"; it adds a listener to the currently selected tab's load event that will eat the new page, then loads a new page. note: you can restart the browser with the command ctrl + alt + r (windows, linux) or
cmd + alt + r (mac) this command restarts the browser with the same tabs open as before the restart. modifying the browser ui since the global window object is the browser's chrome window, you can also modify the browser's user interface. on windows, the following code will add a new item to the browser's main menu: var parent = window.document.getelementbyid("appmenuprimarypane"); var makethete...
UI Tour - Firefox Developer Tools
reakpoints event listener breakpoints dom mutation breakpoints source list pane the source list pane lists all the javascript source files loaded into the page, and enables you to select one to debug. at the top level sources are organized by origin, and under that they're organized by the directory structure from which they are served. you can search for a file using ctrl + p (
cmd + p on a mac). web extensions are listed in the source list pane using the extension's name. there are several context menu options available for individual files and folders or groups; typically viewed by right-clicking on the item. for files, the following context menu options are available: copy source uri copies the full identifier of the file to the clipboard. ignore source cause...
...on, and the menu option for that folder changes to unignore files outside this directory. outline view the outline view shows a tree for navigating the currently open file. use it to jump directly to a function, class or method definition. source pane this shows the javascript file currently loaded. when the source pane is focused you can search for a string in the file using ctrl + f (
cmd + f on a mac). breakpoints have a blue arrow overlaid on the line number. conditional breakpoints have an orange arrow. if you're stopped at a breakpoint, the entire line gets a green overlay. in the screenshot below there are three breakpoints: line 82 has a normal breakpoint and execution is paused here line 85 has a logpoint which logs the contents of tablerow to the console line 100 ha...
Deprecated tools - Firefox Developer Tools
provided an environment for experimenting with javascript code. you can write, run, and examine the result of code that interacts with the web page. alternatives in firefox 71+, you can write multi-line javascript code in the web console editor mode, making it similar to the scratchpad. the editor mode can be triggered clicking on the icon on the right of the console input, or with ctrl + b (
cmd + b on macos) when in editor mode, the enter key adds a new line in the input, and you can evaluate the expression using ctrl + enter (
cmd + enter on macos). when evaluating, the input isn't cleared, which makes it possible to quickly iterrate over a snippet of code. the results are displayed in the console output, to the right of the input, providing immediate feedback. unlike in scratchpa...
...ly iterrate over a snippet of code. the results are displayed in the console output, to the right of the input, providing immediate feedback. unlike in scratchpad, errors are properly displayed in the output with an expandable stacktrace, making it easier to debug the code you're currently writing. starting firefox 72, you can import a javascript file content in the console input with ctrl + o (
cmd + o on macos), as well as saving the console input content to a file using ctrl + s (
cmd + s on macos). webide and connect page webide was deprecated as of firefox 69 disabled as of firefox 70 (bug 1539451). removed as of firefox 71 (bug 1539462). description webide allowed you to connect the firefox developer tools to remote browsers, such as firefox for android. it was also intended to s...
Index - Firefox Developer Tools
or faq dom_inspector the file menu contains approaches which will allow you to inspect a document. 8 dom inspector internals code, tools, internals, organisation, source there are three main facets to dom inspector. the one you are likely to be most familiar with is its inspector.xul-based primary ui. this is the two-pane inspector that appears when ctrl+shift+i (or
cmd+shift+i) is pressed from one of the applications for which dom inspector has explicit support (i.e., menuitems placed via overlay). 9 introduction to dom inspector dom_inspector the dom inspector is a mozilla extension that you can access from the tools > web development menu in seamonkey, or by selecting the dom inspector menu item from the tools menu in firefox and thunder...
...rom one of the applications for which dom inspector has explicit support (i.e., menuitems placed via overlay). 9 introduction to dom inspector dom_inspector the dom inspector is a mozilla extension that you can access from the tools > web development menu in seamonkey, or by selecting the dom inspector menu item from the tools menu in firefox and thunderbird, or by using ctrl/
cmd+shift+i in either application. dom inspector is standalone; it supports all toolkit applications, and it's possible to embed it in your own xulrunner app. dom inspector can serve as a sanity check to verify the state of the dom, or it can be used to manipulate the dom by hand, if desired. 10 all keyboard shortcuts tools, l10n:priority this page lists all keyboard shortcuts u...
Edit Shape Paths in CSS - Firefox Developer Tools
clipped by the margin box. to understand the margin box, and other boxes used by css shapes see our guide to shapes from box values. editing basic shapes the options given to you by the tool will differ depending on the type of basic shape that you are editing. options can be accessed by activating the shape path editor with a regular click on the icon, and you can use the context menu (ctrl/
cmd + click) to access additional functionality. circle() if the value of shape-outside is circle(), you are creating a circle basic shape. clicking on the shapes icon next to the value of circle() will highlight the shape, and also give you the option to resize the circle or move its center. if you move or resize the circle past the margin box, the edges become clipped by it. in the rules pane...
... shapes path editor and give you the option to move any of the points of your polygon shape. double-click anywhere on a line of the shape and you will get a new point to adjust. double click on an existing point and it will be removed. remember that a polygon needs at least three points. moving and scaling shapes there is extra functionality available on the shape highlight — if you ctrl/
cmd + click on the shapes icon for your shape the highlight will change, instead providing the ability to scale and/or move it. once again, clipping will occur if you exceed the bounds of the margin box. if your shape is a polygon, you also get the ability to rotate it around an axis. browser support the shape path editor currently works for shapes generated via clip-path; it will also work for...
Examine and edit CSS - Firefox Developer Tools
light the currently selected element in the page. filtering rules there's a box at the top of the rules view labeled "filter styles": as you type: any rules which don't contain the typed string at all are hidden any declarations which contain the typed string are highlighted click the "x" at the end of the search box to remove the filter. while in the rules view, you can press ctrl /
cmd + f to focus the search field. once you've typed in a filter, you can press esc to remove it again. strict search by default, the search box highlights all declarations which contain any part of the string. for example, searching for "color" will highlight declarations containing border-bottom-color and background-color as well as just color.: if you enclose the search query in backticks...
...rforms a live filtering of the list, so, for example, if you just want to see font-related settings, you can type "font" in the search box, and only properties with "font" in the name will be listed. you can also search for the values of properties: to find the rule responsible for setting the font to "lucida grande", type that in the search box. while in the computed view, you can press ctrl /
cmd + f to focus the search field. once you've typed in a filter, you can press esc to remove it again. edit rules if you click on a declaration or a selector in the rules view you can edit it and see the results immediately. you can also tab through the different existing properties and values, and start editing them by pressing enter or space. to add a new declaration to a rule, click on the la...
Examine and edit HTML - Firefox Developer Tools
te hierarchy through the document for the branch containing the selected element: hovering over a breadcrumb highlights that element in the page. the breadcrumbs bar has its own keyboard shortcuts. searching the page inspector's search box matches all markup in the current document and in any frames. to start searching the markup, click in the search box to expand it or press ctrl + f , or
cmd + f on a mac. there are three types of searches that are performed automatically depending on what you enter, a full text search, a css selector search, and an xpath search. full text search the full text search will always be executed, independently of what you enter. that allows you to find css selectors and xpath expressions occurring within the text. css selector search you can search el...
... only appear in certain contexts, for example the "open file in style-editor" option only appears when you context-click over the top of a link to a css file. context menu reference edit as html edit the element's html. (copy) inner html copy the inner html for the element. (copy) outer html copy the outer html for the element. pressing ctrl + c (or
cmd + c on a mac) also performs this action. (copy) unique selector/css selector copy a css selector that uniquely selects the element. (copy) css path copy a css selector that represents the full path to the element. (copy) image data-url copy image as a data:// url, if the selected element is an image. (copy) attribute copy the attribute of the e...
AesKeyGenParams - Web APIs
length a number — the length in bits of the key to generate. ...
... length a number — the length in bits of the key to generate. ...
BaseAudioContext.decodeAudioData() - Web APIs
ocontext.decodeaudiodata(arraybuffer); parameters arraybuffer an arraybuffer containing the audio data to be decoded, usually grabbed from xmlhttprequest, windoworworkerglobalscope.fetch() or filereader. successcallback a callback function to be invoked when the decoding successfully finishes. the single argument to this callback is an audiobuffer representing the decodeddata (the decoded p
cm audio data). usually you'll want to put the decoded data into an audiobuffersourcenode, from which it can be played and manipulated how you want. errorcallback an optional error callback, to be invoked if an error occurs when the audio data is being decoded. return value void, or a promise object that fulfills with the decodeddata. example in this section we will first cover the older call...
...then the newer promise-based syntax. older callback syntax in this example, the getdata() function uses xhr to load an audio track, setting the responsetype of the request to arraybuffer so that it returns an array buffer as its response that we then store in the audiodata variable . we then pass this buffer into a decodeaudiodata() function; the success callback takes the successfully decoded p
cm data, puts it into an audiobuffersourcenode created using audiocontext.createbuffersource(), connects the source to the audiocontext.destination and sets it to loop. the buttons in the example simply run getdata() to load the track and start it playing, and stop it playing, respectively. when the stop() method is called on the source, the source is cleared out. note: you can run the example li...
CSS numeric factory functions - Web APIs
used. these functions create new numeric values less verbosely than using the cssunitvalue.cssunitvalue() constructor. ...
...umber); css.vi(number); css.vb(number); css.vmin(number); css.vmax(number); css.
cm(number); css.mm(number); css.q(number); css.in(number); css.pt(number); css.pc(number); css.px(number); // <angle> css.deg(number); css.grad(number); css.rad(number); css.turn(number); // <time> css.s(number); css.ms(number); // <frequency> css.hz(number); css.khz(number); // <resolution> css.dpi(number); css.dp
cm(number); css.dppx(number); // <flex> css.fr(number); examples we use the css.vmax() numeric factory function to create a cssunitvalue: let height = css.vmax(50); console.log( height ); // cssunitvalue {value: 50, unit: "vmax"} console.log( height.value ) // 50 console.log( height.unit ) // vmax in this example, we set the margin on our element using the css.px() factory function: ...
CSSPrimitiveValue.getFloatValue() - Web APIs
a specified unit. if this css value doesn't contain a float value or can't be converted into the specified unit, a domexception is raised. syntax var floatvalue = cssprimitivevalue.getfloatvalue(unit); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned. valid values are: constant description css_
cm the value is a <length> in centimeters. css_deg the value is an <angle> in degrees. css_dimension the value is a <number> with an unknown dimension. css_ems the value is a <length> in em units. css_exs the value is a <length> in ex units. css_grad the value is an <angle> in grads. css_hz the value ...
...ed unit. exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the float value can't be converted into the specified unit. example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("margin-top"); console.log(cssvalue.getfloatvalue(cssprimitivevalue.css_
cm)); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.getfloatvalue' in that specification. obsolete initial definition ...
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
* spaces (and also some other characters). */ /** * determine whether a node's text content is entirely whitespace. * * @param nod a node implementing the |characterdata| interface (i.e., * a |text|, |comment|, or |cdatasection| node * @return true if all of the text content of |nod| is whitespace, * otherwise false. */ function is_all_ws( nod ) { // use e
cma-262 edition 3 string and regexp features return !(/[^\t\n\r ]/.test(nod.textcontent)); } /** * determine if a node should be ignored by the iterator functions. * * @param nod an object implementing the dom1 |node| interface. * @return true if the node is: * 1) a |text| node that is all whitespace * 2) a |comment| node * and otherwise fals...
...pace at the beginning * and end and normalizes all whitespace to a single space. (normally * |data| is a property of text nodes that gives the text of the node.) * * @param txt the text node whose data should be returned * @return a string giving the contents of the text node with * whitespace collapsed. */ function data_of( txt ) { var data = txt.textcontent; // use e
cma-262 edition 3 string and regexp features data = data.replace(/[\t\n\r ]+/g, " "); if (data.charat(0) == " ") data = data.substring(1, data.length); if (data.charat(data.length - 1) == " ") data = data.substring(0, data.length - 1); return data; } example the following code demonstrates the use of the functions above. it iterates over the children of an element (whose children ...
IDBFactory - Web APIs
at implements the interface is window.indexeddb. you open — that is, create and access — and delete a database with this object, and not directly with idbfactory. note: this feature is available in web workers. methods idbfactory.open the current method to request opening a connection to a database. idbfactory.deletedatabase a method to request the deletion of a database. idbfactory.
cmp a method that compares two keys and returns a result indicating which one is greater in value. idbfactory.databases a method that returns a list of all available databases, including their names and versions. example in the following code snippet, we make a request to open a database, and include handlers for the success and error cases. for a full working example, see our to-do notificati...
...pera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkit
cmpchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full support ...
IDBKeyRange.includes() - Web APIs
returns true var myresult = keyrangevalue.includes('w'); // returns false polyfill the includes() method was added in the second edition of the indexed db specification. for browsers that do not support it, the following polyfill can be used. ...
...ecification. for browsers that do not support it, the following polyfill can be used. idbkeyrange.prototype.includes = idbkeyrange.prototype.includes || function(key) { var r = this, c; if (r.lower !== undefined) { c = indexeddb.
cmp(key, r.lower); if (r.loweropen && c <= 0) return false; if (!r.loweropen && c < 0) return false; } if (r.upper !== undefined) { c = indexeddb.
cmp(key, r.upper); if (r.upperopen && c >= 0) return false; if (!r.upperopen && c > 0) return false; } return true; }; specification specification status comment indexed database api draftthe definition of 'includes()' in that specification. recommendation indexed database api draftthe definition of 'includes()' in that specification. recomm...
Using IndexedDB - Web APIs
$('#add-button').click(function(evt) { console.log("add ..."); var title = $('#pub-title').val(); var biblioid = $('#pub-biblioid').val(); if (!title || !biblioid) { displayactionfailure("required field(s) missing"); return; } var year = $('#pub-year').val(); if (year != '') { // better use number.isinteger if the engine has e
cmascript 6 if (isnan(year)) { displayactionfailure("invalid year"); return; } year = number(year); } else { year = null; } var file_input = $('#pub-file'); var selected_file = file_input.get(0).files[0]; console.log("selected_file:", selected_file); // keeping a reference on how to reset the file input in the ...
... addpublication(biblioid, title, year); } }); $('#delete-button').click(function(evt) { console.log("delete ..."); var biblioid = $('#pub-biblioid-to-delete').val(); var key = $('#key-to-delete').val(); if (biblioid != '') { deletepublicationfrombib(biblioid); } else if (key != '') { // better use number.isinteger if the engine has e
cmascript 6 if (key == '' || isnan(key)) { displayactionfailure("invalid key"); return; } key = number(key); deletepublication(key); } }); $('#clear-store-button').click(function(evt) { clearobjectstore(); }); var search_button = $('#search-list-button'); search_button.click(function(evt) { displaypublist();...
RTCRtpStreamStats.trackId - Web APIs
note: this value is not the same as the value of mediastramtrack.id. ...
... note: this value is not the same as the value of mediastramtrack.id. ...
ServiceWorkerRegistration - Web APIs
the instance of navigationpreloadmanager associated with the current service worker registration. serviceworkerregistration.pushmanager read only returns a reference to the pushmanager interface for managing push subscriptions including subscribing, getting an active subscription, and accessing push permission status. ...
...this was mentioned as an idea in the sw explainer at some point, but as yet has not been implemented anywhere. ...
SubtleCrypto.generateKey() - Web APIs
ratekey(algorithm, extractable, keyusages); parameters algorithm is a dictionary object defining the type of key to generate and providing extra algorithm-specific parameters. for rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep: pass an rsahashedkeygenparams object. for ecdsa or ecdh: pass an eckeygenparams object. for hmac: pass an hmackeygenparams object. for aes-ctr, aes-cbc, aes-g
cm, or aes-kw: pass an aeskeygenparams object. extractable is a boolean indicating whether it will be possible to export the key using subtlecrypto.exportkey() or subtlecrypto.wrapkey(). keyusages is an array indicating what can be done with the newly generated key. possible values for array elements are: encrypt: the key may be used to encrypt messages. decrypt: the key may be use...
...ir = window.crypto.subtle.generatekey( { name: "ecdsa", namedcurve: "p-384" }, true, ["sign", "verify"] ); hmac key generation this code generates an hmac signing key. see the complete code on github. let key = window.crypto.subtle.generatekey( { name: "hmac", hash: {name: "sha-512"} }, true, ["sign", "verify"] ); aes key generation this code generates an aes-g
cm encryption key. see the complete code on github. let key = window.crypto.subtle.generatekey( { name: "aes-g
cm", length: 256 }, true, ["encrypt", "decrypt"] ); specifications specification status comment web cryptography apithe definition of 'subtlecrypto.generatekey()' in that specification. recommendation initial definition. ...
Web APIs
b authentication apiweb crypto apiweb notificationsweb storage apiweb workers apiwebglwebrtcwebvttwebxr device apiwebsockets api interfaces this is a list of all the interfaces (that is, types of objects) that are available. ...
...cognitionevent speechrecognitionresult speechrecognitionresultlist speechsynthesis speechsynthesiserrorevent speechsynthesisevent speechsynthesisutterance speechsynthesisvoice staticrange stereopannernode storage storageestimate storageevent storagemanager storagequota stylepropertymap stylepropertymapreadonly stylesheet stylesheetlist submitevent subtlecrypto syncevent syn
cmanager t taskattributiontiming text textdecoder textencoder textmetrics textrange texttrack texttrackcue texttracklist timeevent timeranges touch touchevent touchlist trackdefault trackdefaultlist trackevent transferable transformstream transitionevent treewalker typeinfo u uievent ulongrange url urlsearchparams urlutilsreadonly usb usbalternateinterface usbconfiguration usbd...
Web Accessibility: Understanding Colors and Luminance - Accessibility
rrent domination of the rgb color space in measuring color output, most calculations in this document are presumed to be in the rgb color space, and very specifically, in the srgb color space. the srgb color space the mdn document, <color> notes "the css data type represents a color in the srgb color space." color has many ways of being defined, including rgb, rgb decimal, rgb percent, hsl,
cmyk among others. for digital concerns, much of the technology has historically resided in the rgb color space. this is because the companies behind the evolution of digital technology set the standards, and these standards still retain a powerful presence today. this is evolving, and new methods for measuring color involve measurements using other color spaces, but color measurements in the rgb...
...the rgb spectrum, or other spectrums commonly used in web development. according to wikipedia's page on "shades of red", the color "carmine" is a saturated red in which, in its pigment form, mostly contains the red light with wavelengths longer than 600nm; the article makes the special note that "carmine" is close to the extreme spectrum. this places it far beyond standard gamuts (both rgb and
cmyk), and its given rgb value is a poor approximation only." saturated red flashing: in addition to a red environment affecting the cognitive function of those with traumatic brain injury, color in the red spectrum wavelength requires special attention and tests. dr. gregg vanderheiden, when testing the photosensitive epilepsy analysis tool, noted seizure rates were much higher than expected. th...
bleed - CSS: Cascading Style Sheets
the bleed css at-rule descriptor, used with the @page at-rule, specifies the extent of the page bleed area outside the page box. this property only has effect if crop marks are enabled using the marks property. syntax /* keyword values */ bleed: auto; /* <length> values */ bleed: 8pt; bleed: 1
cm; values auto computes to 6pt if the value of marks is crop. otherwise it computes to zero. ...
...es to 6pt if the value of marks is crop. otherwise it computes to zero. <length> specifies by how far outward, in each direction, the bleed area extends past the page box. values may be negative, but there may be implementation-specific limits. formal definition related at-rule@pageinitial valueautocomputed valueas specified formal syntax auto | <length> examples setting a page bleed of 1
cm @page { bleed: 1
cm; } specifications specification status comment css paged media module level 3the definition of 'bleed' in that specification. working draft initial definition ...
Box-shadow generator - CSS: Cascading Style Sheets
ba(x, c, m); return; } if (h >= 2 && h < 3) { this.setrgba(m, c, x); return; } if (h >= 3 && h < 4) { this.setrgba(m, x, c); return; } if (h >= 4 && h < 5) { this.setrgba(x, m, c); return; } if (h >= 5 && h < 6) { this.setrgba(c, m, x); return; } } color.prototype.updatehsv = function updatehsv() { var red = this.r / 255; var green = this.g / 255; var blue = this.b / 255; var
cmax = math.max(red, green, blue); var
cmin = math.min(red, green, blue); var delta =
cmax -
cmin; var hue = 0; var saturation = 0; if (delta) { if (
cmax === red ) { hue = ((green - blue) / delta); } if (
cmax === green ) { hue = 2 + (blue - red) / delta; } if (
cmax === blue ) { hue = 4 + (red - green) / delta; } if (
cmax) saturation = delta /
cmax; } this.hue = 60 * hue |...
... var hue = 0; var saturation = 0; if (delta) { if (
cmax === red ) { hue = ((green - blue) / delta); } if (
cmax === green ) { hue = 2 + (blue - red) / delta; } if (
cmax === blue ) { hue = 4 + (red - green) / delta; } if (
cmax) saturation = delta /
cmax; } this.hue = 60 * hue | 0; if (this.hue < 0) this.hue += 360; this.saturation = (saturation * 100) | 0; this.value = (
cmax * 100) | 0; } color.prototype.sethexa = function sethexa(value) { var valid = /(^#{0,1}[0-9a-f]{6}$)|(^#{0,1}[0-9a-f]{3}$)/i.test(value) if (valid !== true) return; if (value[0] === '#') value = value.slice(1, value.length); if (value.length === 3) value = value.replace(/([0-9a-f])([0-9a-f])([0-9a-f])/i,"$1$1$2$2$3$3"); this.r = parseint(value.substr(0, 2), 16); this...
CSS reference - CSS: Cascading Style Sheets
border-start-end-radiusborder-start-start-radiusborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottom@bottom-centerbox-decoration-breakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidebrightness()ccalc()caption-sidecaret-colorch@character-variantcharacter-variant()@charset:checkedcircle()clamp()clearclipclip-path
cm<color>colorcolor-adjustcolumn-countcolumn-fillcolumn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdirection:disableddisplay<display-box><display-...
...e-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdirection:disableddisplay<display-box><display-inside><display-internal><display-legacy><display-listitem><display-outside>dp
cmdpidppxdrop-shadow()eelement()ellipse()em:emptyempty-cells:enabledenv()exffallback (@counter-style)filter<filter-function>:first:first-child::first-letter (:first-letter)::first-line (:first-line):first-of-typefit-content()<flex>flexflex-basisflex-directionflex-flowflex-growflex-shrinkflex-wrapfloat:focusfont@font-facefont-familyfont-family (@font-face)font-feature-settingsfont-feature-settings (@...
Value definition syntax - CSS: Cascading Style Sheets
omponent defined by the brackets, it must appear before it. juxtaposition placing several keywords, literals or data types, next to one another, only separated by one or several spaces, is called juxtaposition. all juxtaposed components are mandatory and should appear in the exact order. bold <length> , thin this example matches the following values: bold 1em, thin bold 0, thin bold 2.5
cm, thin bold 3vh, thin but not: thin 1em, bold, as the entities must be in the expressed order bold 1em thin, as the entities are mandatory; the comma, a literal, must be present bold 0.5ms, thin, as the ms values are not <length> double ampersand separating two or more components, by a double ampersand, &&, means that all these entities are mandatory but may appear in any order. bold &...
...the expressed order bold 1em thin, as the entities are mandatory; the comma, a literal, must be present bold 0.5ms, thin, as the ms values are not <length> double ampersand separating two or more components, by a double ampersand, &&, means that all these entities are mandatory but may appear in any order. bold && <length> this example matches the following values: bold 1em bold 0 2.5
cm bold 3vh bold but not: bold, as both components must appear in the value. bold 1em bold, as both components must appear only one time. note: juxtaposition has precedence over the double ampersand, meaning that bold thin && <length> is equivalent to [ bold thin ] && <length>. it describes bold thin <length> or <length> bold thin but not bold <length> thin. double bar separating two or...
attr() - CSS: Cascading Style Sheets
12.5em). if it is not valid, that is not a length or out of the range accepted by the css property, the default value is used. if the given unit is a relative length, attr() computes it to an absolute length. leading and trailing spaces are stripped. 0, or, if 0 is not a valid value for the property, the property's minimum value. em, ex, px, rem, vw, vh, vmin, vmax, mm,
cm, in, pt, or pc <length> the attribute value is parsed as a css <number>, that is without the unit (e.g. 12.5), and interpreted as a <length> with the specified unit. if it is not valid, that is not a number or out of the range accepted by the css property, the default value is used. if the given unit is a relative length, attr() computes it to an absolute length. leading and t...
... associated attribute is missing or contains an invalid value. if not set, css will use the default value defined for each <type-or-unit>. ...
gap (grid-gap) - CSS: Cascading Style Sheets
/interactive-examples and send us a pull request. css grid layout initially defined the grid-gap property. this prefixed property is being replaced by gap. however, in order to support browsers that implemented grid-gap and not gap for grid, you will need to use the prefixed property as in the interactive example above. ...
... replaced by gap. however, in order to support browsers that implemented grid-gap and not gap for grid, you will need to use the prefixed property as in the interactive example above. syntax /* one <length> value */ gap: 20px; gap: 1em; gap: 3vmin; gap: 0.5
cm; /* one <percentage> value */ gap: 16%; gap: 100%; /* two <length> values */ gap: 20px 10px; gap: 1em 0.5em; gap: 3vmin 2vmax; gap: 0.5
cm 2mm; /* one or two <percentage> values */ gap: 16% 100%; gap: 21px 82%; /* calc() values */ gap: calc(10% + 20px); gap: calc(20px + 10%) calc(10% - 5px); /* global values */ gap: inherit; gap: initial; gap: unset; this property is specified as a value for <'row-gap'> followed optionally by a value for <'column-gap'>. if <'column-gap'> is omitted, it’s set to the same value as <'row-gap'>. ...
grid-auto-columns - CSS: Cascading Style Sheets
emplate-columns, implicit grid tracks are created to hold it. this can happen either by explicitly positioning into a column that is out of range, or by the auto-placement algorithm creating additional columns. ...
...max; /* <percentage> values */ grid-auto-columns: 10%; grid-auto-columns: 33.3%; /* <flex> values */ grid-auto-columns: 0.5fr; grid-auto-columns: 3fr; /* minmax() values */ grid-auto-columns: minmax(100px, auto); grid-auto-columns: minmax(max-content, 2fr); grid-auto-columns: minmax(20%, 80vmax); /* fit-content() values */ grid-auto-columns: fit-content(400px); grid-auto-columns: fit-content(5
cm); grid-auto-columns: fit-content(20%); /* multiple track-size values */ grid-auto-columns: min-content max-content auto; grid-auto-columns: 100px 150px 390px; grid-auto-columns: 10% 33.3%; grid-auto-columns: 0.5fr 3fr 1fr; grid-auto-columns: minmax(100px, auto) minmax(max-content, 2fr) minmax(20%, 80vmax); grid-auto-columns: 100px minmax(100px, auto) 10% 0.5fr fit-content(400px); /* global valu...
<length> - CSS: Cascading Style Sheets
the anchor is done differently for low-resolution devices, such as screens, versus high-resolution devices, such as printers. for low-dpi devices, the unit px represents the physical reference pixel; other units are defined relative to it. thus, 1in is defined as 96px, which equals 72pt. the consequence of this definition is that on such devices, dimensions described in inches (in), centimeters (
cm), or millimeters (mm) don't necessary match the size of the physical unit with the same name. for high-dpi devices, inches (in), centimeters (
cm), and millimeters (mm) are the same as their physical counterparts. therefore, the px unit is defined relative to them (1/96 of 1 inch). note: many users increase their user agent's default font size to make text more legible. absolute lengths can cau...
...ths can cause accessibility problems, since they are fixed and do not scale according to user settings. for this reason, prefer relative lengths (such as em or rem) when setting font-size. px one pixel. for screen displays, it traditionally represents one device pixel (dot). however, for printers and high-resolution screens, one css pixel implies multiple device pixels. 1px = 1/96th of 1in.
cm one centimeter. 1
cm = 96px/2.54. mm one millimeter. 1mm = 1/10th of 1
cm. q one quarter of a millimeter. 1q = 1/40th of 1
cm. in one inch. 1in = 2.54
cm = 96px. pc one pica. 1pc = 12pt = 1/6th of 1in. pt one point. 1pt = 1/72nd of 1in. mozmm , removed in firefox 59 an experimental unit that attempts to render at exactly one millimeter regardless of the size or resolution of the displ...
mask - CSS: Cascading Style Sheets
| <repeat-style> | <geometry-box> | [ <geometry-box> | no-clip ] | <compositing-operator> | <masking-mode>where <mask-reference> = none | <i...
...| <repeat-style> | <geometry-box> | [ <geometry-box> | no-clip ] | <compositing-operator> | <masking-mode>where <mask-reference> = none | <image> | <mask-source><position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | ri...
<resolution> - CSS: Cascading Style Sheets
l values. syntax the <resolution> data type consists of a strictly positive <number> followed by one of the units listed below. as with all css dimensions, there is no space between the unit literal and the number. units dpi represents the number of dots per inch. screens typically contains 72 or 96 dots per inch, but the dpi for printed documents is usually much greater. as 1 inch is 2.54
cm, 1dpi ≈ 0.39dp
cm. dp
cm represents the number of dots per centimeter. as 1 inch is 2.54
cm, 1dp
cm ≈ 2.54dpi. dppx represents the number of dots per px unit. due to the 1:96 fixed ratio of css in to css px, 1dppx is equivalent to 96dpi, which corresponds to the default resolution of images displayed in css as defined by image-resolution. x alias for dppx. note: although the number 0 is...
...sents the number of dots per px unit. due to the 1:96 fixed ratio of css in to css px, 1dppx is equivalent to 96dpi, which corresponds to the default resolution of images displayed in css as defined by image-resolution. x alias for dppx. note: although the number 0 is always the same regardless of unit, the unit may not be omitted. in other words, 0 is invalid and does not represent 0dpi, 0dp
cm, or 0dppx. examples use in a media query @media print and (min-resolution: 300dpi) { ... } valid resolutions 96dpi 50.82dp
cm 3dppx invalid resolutions 72 dpi spaces are not allowed between the number and the unit. ten dpi the number must use digits only. 0 the unit is required. specifications specification status comment css values and units...
Separate sites for mobile and desktop - Developer guides
mobile site, typically at m.example.com. in a nutshell, this technique uses server-side logic to solve all three goals of mobile web development at once — if the user’s browser looks like it’s on a phone, you serve them mobile content, formatted for their phone and optimized for speed. conceptually simple, this is the easiest option to add to an existing site, especially if you are using a
cms or web application that supports templates. since only the mobile-specific content, styles, and scripts are sent to mobile users, this method also provides for the best performance out of any of the other options presented here. finally, it also allows for completely different user experiences on desktop and mobile — they’re two different sites, after all! the bad unfortunately, this approac...
...ut of any of the other options presented here. finally, it also allows for completely different user experiences on desktop and mobile — they’re two different sites, after all! the bad unfortunately, this approach is not without its drawbacks. for starters, you are now maintaining two different pages for every page on your site that you would like to expose to mobile users. if you are using a
cms, it is possible to arrange your site templates in a way that minimizes this duplication. however any time that there is a difference between the mobile and desktop templates, there is a potential source of complication in your code. similarly, this increases the implementation time of any new site features, since you must now code two sets of front-end logic. even more important than that, thoug...
Equality comparisons and sameness - JavaScript
toprimitive(a) == tonumber(b) a === b in the above table, tonumber(a) attempts to convert its argument to a number before comparison. its behavior is equivalent to +a (the unary + operator). toprimitive(a) attempts to convert its object argument to a primitive value, by attempting to invoke varying sequences of a.tostring and a.valueof methods on a. traditionally, and according to e
cmascript, all objects are loosely unequal to undefined and null. but most browsers permit a very narrow class of objects (specifically, the document.all object for any page), in some contexts, to act as if they emulate the value undefined. loose equality is one such context: null == a and undefined == a evaluate to true if, and only if, a is an object that emulates undefined. in all other cases an ...
... it is desirable for your work to mirror some of the characteristics of object.defineproperty. if your use case does not require this, it is suggested to avoid object.is and use === instead. even if your requirements involve having comparisons between two nan values evaluate to true, generally it is easier to special-case the nan checks (using the isnan method available from previous versions of e
cmascript) than it is to work out how surrounding computations might affect the sign of any zeros you encounter in your comparison. here's a non-exhaustive list of built-in methods and operators that might cause a distinction between -0 and +0 to manifest itself in your code: - (unary negation) let stoppingforce = obj.mass * -obj.velocity; if obj.velocity is 0 (or computes to 0), a -0 is in...
Keyed collections - JavaScript
a map object is a simple key/value map and can iterate its elements in insertion order. the following code shows some basic operations with a map. see also the map reference page for more examples and the complete api. you can use a for...of loop to return an array of [key, value] for each iteration. ...
... if they were, the list would depend on the state of garbage collection, introducing non-determinism. for more information and example code, see also "why weakmap?" on the weakmap reference page. one use case of weakmap objects is to store private data for an object, or to hide implementation details. the following example is from nick fitzgerald's blog post "hiding implementation details with e
cmascript 6 weakmaps". the private data and methods belong inside the object and are stored in the privates weakmap object. everything exposed on the instance and prototype is public; everything else is inaccessible from the outside world because privates is not exported from the module. const privates = new weakmap(); function public() { const me = { // private data goes here }; private...
Numbers and dates - JavaScript
000000000000000000; // 2147483648 var flt_exponent = 0b01111111100000000000000000000000; // 2139095040 var flt_mantissa = 0b00000000011111111111111111111111; // 8388607 octal numbers octal number syntax uses a leading zero. if the digits after the 0 are outside the range 0 through 7, the number will be interpreted as a decimal number. ...
...1100000000000000000000000; // 2139095040 var flt_mantissa = 0b00000000011111111111111111111111; // 8388607 octal numbers octal number syntax uses a leading zero. if the digits after the 0 are outside the range 0 through 7, the number will be interpreted as a decimal number. var n = 0755; // 493 var m = 0644; // 420 strict mode in e
cmascript 5 forbids octal syntax. octal syntax isn't part of e
cmascript 5, but it's supported in all browsers by prefixing the octal number with a zero: 0644 === 420 and "\045" === "%". in e
cmascript 2015, octal numbers are supported if they are prefixed with 0o, e.g.: var a = 0o10; // es2015: 8 hexadecimal numbers hexadecimal number syntax uses a leading zero followed by a lowercase or uppercase latin letter "x" (0x or 0x). if the digits after 0x are out...
Text formatting - JavaScript
mple strings using either single or double quotes: 'foo' "bar" more advanced strings can be created using escape sequences: hexadecimal escape sequences the number after \x is interpreted as a hexadecimal number. '\xa9' // "©" unicode escape sequences the unicode escape sequences require at least four hexadecimal digits following \u. '\u00a9' // "©" unicode code point escapes new in e
cmascript 2015. with unicode code point escapes, any character can be escaped using hexadecimal numbers so that it is possible to use unicode code points up to 0x10ffff. with simple unicode escapes it is often necessary to write the surrogate halves separately to achieve the same result. see also string.fromcodepoint() or string.prototype.codepointat(). '\u{2f804}' // the same with simple unicode...
...ow, with template literals, you are able to make use of the syntactic sugar making substitutions like this more readable: const five = 5; const ten = 10; console.log(`fifteen is ${five + ten} and not ${2 * five + ten}.`); // "fifteen is 15 and not 20." for more information, read about template literals in the javascript reference. internationalization the intl object is the namespace for the e
cmascript internationalization api, which provides language sensitive string comparison, number formatting, and date and time formatting. the constructors for collator, numberformat, and datetimeformat objects are properties of the intl object. date and time formatting the datetimeformat object is useful for formatting date and time. the following formats a date for english as used in the united s...
Using Promises - JavaScript
jected. this is very much modeled after how synchronous code works: try { const result = syncdosomething(); const newresult = syncdosomethingelse(result); const finalresult = syncdothirdthing(newresult); console.log(`got the final result: ${finalresult}`); } catch(error) { failurecallback(error); } this symmetry with asynchronous code culminates in the async/await syntactic sugar in e
cmascript 2017: async function foo() { try { const result = await dosomething(); const newresult = await dosomethingelse(result); const finalresult = await dothirdthing(newresult); console.log(`got the final result: ${finalresult}`); } catch(error) { failurecallback(error); } } it builds on promises, e.g. dosomething() is the same function as before. you can read more ab...
...result3) */ timing to avoid surprises, functions passed to then() will never be called synchronously, even with an already-resolved promise: promise.resolve().then(() => console.log(2)); console.log(1); // 1,...
Working with objects - JavaScript
object.keys(o) this method returns an array with all the own (not in the prototype chain) enumerable properties' names ("keys") of an object o. object.getownpropertynames(o) this method returns an array containing...
...: for...in loops this method traverses all enumerable properties of an object and its prototype chain. object.keys(o) this method returns an array with all the own (not in the prototype chain) enumerable properties' names ("keys") of an object o. object.getownpropertynames(o) this method returns an array containing all own properties' names (enumerable or not) of an object o. before e
cmascript 5, there was no native way to list all properties of an object. however, this can be achieved with the following function: function listallproperties(o) { var objecttoinspect; var result = []; for(objecttoinspect = o; objecttoinspect !== null; objecttoinspect = object.getprototypeof(objecttoinspect)) { result = result.concat( object.getownpropertynames(...
About the JavaScript reference - JavaScript
pabilities or features, check out the javascript guide. the javascript language is intended to be used within some larger environment, be it a browser, server-side scripts, or similar. for the most part, this reference attempts to be environment-agnostic and does not target a web browser environment. where to find javascript information javascript documentation of core language features (pure e
cmascript, for the most part) includes the following: the javascript guide the javascript reference if you are new to javascript, start with the guide. once you have a firm grasp of the fundamentals, you can use the reference to get more details on individual objects and language constructs. structure of the reference in the javascript reference you can find the following chapters: standa...
...e statement may span multiple lines. multiple statements may occur on a single line if each statement is separated by a semicolon. this isn't a keyword, but a group of keywords. expressions and operators this chapter documents all the javascript language operators, expressions and keywords. functions chapter about javascript functions. classes chapter about javascript classes introduced in e
cmascript 2015. errors chapter about specific errors, exceptions and warnings thrown by javascript. new in javascript chapter about javascript version history. more reference pages deprecated and obsolete features lexical grammar data types and data structures ...
SyntaxError: invalid regular expression flag "x" - JavaScript
wrong? there are invalid regular expression flags in the code. in a regular expression literal, which consists of a pattern enclosed between slashes, the flags are defined after the second slash. they can also be defined in the constructor function of the regexp object (second parameter). ...
...see sticky examples there are only six valid regular expression flags. ...
Functions - JavaScript
ct or user-defined object that supports the addition of new properties. the syntax for defining getters and setters uses the object literal syntax. get binds an object property to a function that will be called when that property is looked up. set binds an object property to a function to be called when there is an attempt to set that property. method definition syntax starting with e
cmascript 2015, you are able to define own methods in a shorter syntax, similar to the getters and setters. see method definitions for more information. var obj = { foo() {}, bar() {} }; constructor vs. declaration vs. expression compare the following: a function defined with the function constructor assigned to the variable multiply: var multiply = new function('x', 'y', 'return x * y'); ...
...roperty called nofunc that is a function. if so, it is used; otherwise, some other action is taken. if ('function' === typeof window.nofunc) { // use nofunc() } else { // do something else } note that in the if test, a reference to nofunc is used—there are no brackets "()" after the function name so the actual function is not called. specifications specification e
cmascript (e
cma-262)the definition of 'function definitions' in that specification. ...
SVG Attribute reference - SVG: Scalable Vector Graphics
able in svg along with links to reference documentation to help you learn which elements support them and how they work. ...
...ng-mode filters attributes filter primitive attributes height, result, width, x, y transfer function attributes type, tablevalues, slope, intercept, amplitude, exponent, offset animation attributes animation attribute target attributes attributetype, attributename animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes cal
cmode, values, keytimes, keysplines, from, to, by, autoreverse, accelerate, decelerate animation addition attributes additive, accumulate event attributes animation event attributes onbegin, onend, onrepeat document event attributes onabort, onerror, onresize, onscroll, onunload global event attributes oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncuechange, ondblclic...
Content type - SVG: Scalable Vector Graphics
contain an <absoluteiri> or <relativeiri>. for the full specification of iri references in svg, see svg 1.1 (2nd edition): iri references. length <length> a length is a distance measurement, given as a number along with a unit. lengths are specified in one of two ways. when used in a stylesheet, a <length> is defined as follows: length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"
cm" | ~"mm" | ~"pt" | ~"pc")? see the css2 specification for the meanings of the unit identifiers. for properties defined in css2, a length unit identifier must be provided. for length values in svg-specific properties and their corresponding presentation attributes, the length unit identifier is optional. if not provided, the length value represents a distance in the current user coordinate sys...
...dentifier is optional. if not provided, the length value represents a distance in the current user coordinate system. in presentation attributes for all properties, whether defined in svg1.1 or in css2, the length identifier, if specified, must be in lower case. when lengths are used in an svg attribute, a <length> is instead defined as follows: length ::= number ("em" | "ex" | "px" | "in" | "
cm" | "mm" | "pt" | "pc" | "%")? the unit identifiers in such <length> values must be in lower case. note that the non-property <length> definition also allows a percentage unit identifier. the meaning of a percentage length value depends on the attribute for which the percentage length value has been specified. two common cases are: when a percentage length value represents a percentage of...
<animateMotion> - SVG: Scalable Vector Graphics
of the motion, using the same syntax as the d attribute. value type: <string>; default value: none; animatable: no rotate this attribute defines a rotation applied to the elment animated along a path, usually to make it pointing in the direction of the animation. ...
...ment animated along a path, usually to make it pointing in the direction of the animation. ...
<script> - SVG: Scalable Vector Graphics
the svg script element allows to add scripts to an svg document. ...
...y="5" r="4" /> </svg> attributes crossorigin this attribute defines cors settings as define for the html <script> element. value type: <string>; default value: ?; animatable: yes href the url to the script to load. value type: <url> ; default value: none; animatable: no type this attribute defines type of the script language to use. value type: <string>; default value: application/e
cmascript; animatable: no xlink:href deprecated since svg 2 the url to the script to load. value type: <url> ; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data speci...
SVG documentation index - SVG: Scalable Vector Graphics
<feconvolvematrix> element to the input image to yield a number and applied the divisor attribute, the bias attribute is added to each component. this allows representation of values that would otherwise be clamped to 0 or 1. 36 by svg, svg attribute the by attribute specifies a relative offset value for an attribute that will be modified during an animation. 37 cal
cmode needscompattable, needsexample, svg, svg attribute the cal
cmode attribute specifies the interpolation mode for the animation. 38 cap-height deprecated, svg, svg attribute the cap-height attribute defines the height of uppercase glyphs of the font within the font coordinate system. 39 class reference, svg, svg attribute assigns a class name or...
...ero). 119 keypoints svg, svg attribute the keypoints attribute indicates the simple duration of an animation. 120 keysplines svg, svg attribute the keysplines attribute defines a set of bézier curve control points associated with the keytimes list, defining a cubic bézier function that controls interval pacing. this attribute is ignored unless the cal
cmode attribute is set to spline. if there are any errors in the keysplines specification (bad values, too many or too few values), the animation will not occur. 121 keytimes svg, svg attribute the keytimes attribute represents a list of time values used to control the pacing of the animation. each time in the list corresponds to a value in the values attribute list, and defi...
Content Scripts - Archive of obsolete content
gemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'function contextmenualert(href) {' + ' window.alert("the context menu was clicked on url:\\n" + href);' + '};' + 'window.addeventlistener("myaddonid-contextmenu-clicked",' + ' function(event){contextmenualert(event.detail);});' }); let
cm = require("sdk/context-menu");
cm.item({ label: "alert url", context: [
cm.urlcontext(["*.mozilla.org"]),
cm.selectorcontext("a[href]") ], contentscript: 'self.on("click", function (node, data) {' + ' var event = new customevent("myaddonid-contextmenu-clicked",' + ' {detail:node.href});' ...
Classes and Inheritance - Archive of obsolete content
a special constructor internally, known as class, to create constructors that behave properly with respect to inheritance. the last section shows how to work with the class constructor. it is possible to read this section on its own. however, to fully appreciate how class works, and the problem it is supposed to solve, it is recommended that you read the entire article. constructors before the e
cmascript 6 standard, a javascript class was defined by creating a constructor function for that class. to illustrate this, let's define a simple constructor for a class shape: function shape(x, y) { this.x = x; this.y = y; } we can now use this constructor to create instances of shape: let shape = new shape(2, 3); shape instanceof shape; // => true shape.x; // => 2 shape.y; // => 3 th...
Private Properties - Archive of obsolete content
e: since there is no way to access variables in one closure from within another closure, there is no way for objects of the same class to access each other's private properties. using weakmaps the techniques above are either not restrictive enough (prefixes) or too restrictive (closures), however the recent introduction of weakmaps provides a solution. weakmaps were introduced to javascript in e
cmascript 2015 and have recently been implemented in spidermonkey. before explaining how weakmaps work, the following looks at how ordinary objects can be used as hash maps, by creating a simple image cache: let images = {}; function getimage(name) { let image = images[name]; if (!image) { image = loadimage(name); images[name] = image; } return image; } now suppos...
Chrome Authority - Archive of obsolete content
in pseudo module is provided by the "toolkit/loader" module. the object returned by require("chrome"), when unpacked with the destructuring assignment feature available in the mozilla js environment, will provide the usual components.* aliases: cc an alias for components.classes. ci an alias for components.interfaces. cu an alias for components.utils. cr an alias for components.results.
cm an alias for components.manager. components an alias for components itself (note the lower-case). from this you can access less-frequently-used properties like components.stack and components.issuccesscode. note: the require("chrome") statement is the only way to access chrome functionality and the components api. the components object should not be accessed from modules. the sdk tools will e...
Getting Started (jpm) - Archive of obsolete content
zilla.org so other users can download and install them. to build an xpi, just execute the command jpm xpi from the add-on's directory: jpm xpi you should see a message like: jpm info successfully created xpi at /path/to/my-addon/@my-addon-0.0.1.xpi to test that this worked, try installing the xpi file in your own firefox installation. you can do this by pressing the ctrl+o key combination (
cmd+o on mac) from within firefox, or selecting the "open" item from firefox's "file" menu. this will bring up a file selection dialog: navigate to the "@my-addon.xpi" file, open it and follow the prompts to install the add-on. note that firefox by default requires add-ons, even locally developed ones, to be signed. after installation they'll show up disabled in the list of installed add-ons, notin...
Getting started (cfx) - Archive of obsolete content
f or publish them to https://addons.mozilla.org so other users can download and install them. to build an xpi, just execute the command cfx xpi from the add-on's directory: cfx xpi you should see a message like: exporting extension to my-addon.xpi. to test that this worked, try installing the xpi file in your own firefox installation. you can do this by pressing the ctrl+o key combination (
cmd+o on mac) from within firefox, or selecting the "open" item from firefox's "file" menu. this will bring up a file selection dialog; navigate to the "my-addon.xpi" file, open it and follow the prompts to install the add-on. summary in this tutorial we've built and packaged an add-on using three commands: cfx init to initialize an empty add-on template cfx run to run a new instance of firefo...
Developing for Firefox Mobile - Archive of obsolete content
the supported modules. when you need to run the add-on, first ensure that firefox is not running on the device. then execute jpm-mobile run with some extra options: jpm-mobile run --adb /path/to/adb in the command shell, you should see something like: launching mobile application with intent name org.mozilla.fennec pushing the addon to your device starting: intent { act=android.activity.main
cmp=org.mozilla.fennec/.app (has extras) } --------- beginning of /dev/log/main --------- beginning of /dev/log/system could not read chrome manifest 'file:///data/data/org.mozilla.fennec/chrome.manifest'. info: starting info: starting zerdatime 1329258528988 - browser chrome startup finished. this will be followed by lots of debug output. on the device, you should see firefox launch with your ad...
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
update the modified makefile any time a new version of the library is released. for libraries that have complex configuration processes, use a non-standard compiler or have other special characteristics, it may be unfeasible to create a mozilla-compliant makefile. in this case, i would recommend placing the entire library distribution inside the project or subproject that uses it. so if library a
cmelib is used inside the multifarious/ subproject in the above example, it would be placed as a subdirectory underneath that subproject (at the same level as public/ and src/). of course, this means that you will have to build a
cmelib manually on all platforms before launching the mozilla build. but at least you can then refer to include files and import libraries from your component using relativ...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
ascript as a programming language. javascript is a prototype-based object-oriented language, and as shown in listing 3, also permits independent class definitions. it does not have strict typing like java, making it extremely flexible and giving it qualities that in some senses could be considered similar to lisp. firefox 3.5 includes a number of extensions to the specification standardized in e
cmascript 3rd edition, and can use javascript 1.7 and javascript 1.8. listing 3: an example of a class definition in javascript function myclass() { } myclass.prototype = { property1 : true, property2 : 'string', method : function() { alert('hello, world!'); } }; var obj = new myclass(); obj.method(); dom: an api for manipulating xml documents the document object model (dom) is a te...
Signing an extension - Archive of obsolete content
, e.g. codesign.p12. enter the password to protect your certificate backup and click ok. a p12 file will be exported on your desktop. create a certificate database first, create a certificate database that will be used for signing. mkdir keystore cd keystore nss-certutil -n -d . you will be asked for the password. use a strong password to protect your database. then cert8.db, key3.db and se
cmod.db will be generated. next, import your certificate. nss-pk12util -i codesign.p12 -d . show the certificate list in your database. nss-certutil -l -d . set the trust for the root and intermediate certificates. here's an example of verisign: nss-certutil -m -n "verisign class 3 public primary certification authority" -t "c,c,c" -d . nss-certutil -m -n "verisign class 3 public primary certif...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
ads from available inventory. because of the iframe, we backed off of the idea that we'd be able to adhere to xhtml strict rules, and settled for using the xhtml transitional dtd. we were hoping to go all the way with the xhtml conversion, but our ad units and some other third-party content prevent us from doing so. our engineers also faced a huge archive of content that wasn't entered into our
cms with xhtml in mind. it's true that our stories exist in a database, separated from page templates and peripheral formatting. but writers, editors, and producers have been inserting stories into vignette for years sans closing paragraph (</p>) tags. unquoted attributes and uppercase html tags? we've got them in spades, and they're embedded in all past stories of the database. fortunately, our chi...
CSS3 - Archive of obsolete content
ities like only screen and (color) . media queries are not only used in css document but also in some attributes of html elements, like the media attribute of the <link> element. the next iteration of this specification is in the work, allowing to tailor a web site regarding the input methods available on the user agent, with new media features like hover or pointer. detection of e
cmascript support, using the script media features is also proposed. css style attributes recommendation since november 7th, 2013 formally defines the syntax of the content of the html style global attribute. css fonts module level 3 candidate recommendation since september 20th, 2018 amends the css2.1 font matching algorithm to be closer to w...
Index of archived content - Archive of obsolete content
table layout strategy tamarin abcasm tamarin acceptance testing abc assembler tests actionscript acceptance tests tamarin acceptance test template actionscript performance tests
cmdline tests running tamarin acceptance tests running tamarin performance tests tamarin build system documentation tamarin releases tamarin-central rev 703:2cee46be9ce0 tamarin roadmap tamarin build documentation tama...
Bonsai - Archive of obsolete content
changing a particular line of code ("cvsblame"). start at the main bonsai query page or seamonkey tree control page here are some example queries that will give you a taste of what bonsai is capable of: today's checkins to the mozilla source mainline. checkins to any branch of xfe by ramiro between 26-feb-1998 and 12-may-1998 differences between revisions 3.1 and 3.3 of the file mozilla/
cmd/xfe/forms.c that's a small sample, but it should be enough to get you started. play around with the various options on the main bonsai query page. if you're updating our cvs tree you'll need to learn about hacking with bonsai. bonsai source code the source code to the bonsai tool itself is also available, check out the information available at the bonsai project page. original document inf...
Bookmark Keywords - Archive of obsolete content
s process: a keymark that will let the user jump straight to a specific bugzilla entry by entering its number. the quickest way to start is to simply look up any random bug in the bugzilla system-- the actual number doesn't matter. see figure 1 for an example. to file this bookmark open the "bookmarks" menu in the browser and select "add bookmark," or by of use the keyboard equivalent (e.g., <tt>
cmd-d</tt> on macintosh). this will add a bookmark of the current page to the list of bookmarks. you can also file the bookmark into a folder by using the "file bookmark..." menu option. to open the bookmark manager go to "bookmarks" menu and select the "manage bookmarks" option. this will open up the bookmark manager. in figure 2, we can see the bookmark has been filed into a folder called "widgets...
importUserCertificates - Archive of obsolete content
ertificate(s) of the same dn in the certificate store is used, and the <tt>"nicknamestring"</tt> parameter is ignored. if the string is null and no certificate with the same dn exists in the user's certificate store, personal security manager uses the following pattern to derive the nickname: <tt><common name>'s <issuer name> id</tt>. "certrepstring" this string is the
cmmf certification response from the ca that contains the user's certificate(s). the response is base-64 encoded. forcebackup this is a boolean argument. it allows the ca or ra to indicate to the client whether to force the user to back up a newly issued certificate (pkcs #12). the importusercertificates() method is used to import newly issued certificates for the u...
popChallengeResponse - Archive of obsolete content
at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api instead. resultstring = crypto.popchallengeresponse("challengestring"); argument description "challengestring" a base-64 encoded
cmmf popodeckeychallcontent message. the current implementation does not conform to that defined in the
cmmf draft, and we intend to change this implementation to that defined in the
cmc rfc.. see below for the current implementation. the resultstring will either be a base-64 encoded popodeckeyrespcontent message, or one of the following error strings: error string description ...
JavaScript crypto - Archive of obsolete content
ext(domstring stringtosign, domstring caoption /* ... */); loading pkcs #11 modules long deletemodule(domstring modulename); long addmodule(domstring modulename, domstring libraryfullpath, long cryptomechanismflags, long cipherflags); loads or removes a new pkcs #11 module. in the add case, the module will be placed in the nss se
cmod.db database and will be loaded automatically on application restart. in the delete case, the module is removed from the nss se
cmod.db. this function will issue a user prompt to confirm the operation before the add or delete actually occurs. parameters modulename name of the module. libraryfullpath the filename of the library prepended with its full path. cryptomechanismflags a bit vect...
jspage - Archive of obsolete content
is));this.xhr.onreadystatechange=$empty;if(this.options.issuccess.call(this,this.status)){this.response={text:this.xhr.responsetext,xml:this.xhr.responsexml}; this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},issuccess:function(){return((this.status>=200)&&(this.status<300)); },processscripts:function(a){if(this.options.evalresponse||(/(e
cma|java)script/).test(this.getheader("content-type"))){return $exec(a);}return a.stripscripts(this.options.evalscripts); },success:function(b,a){this.onsuccess(this.processscripts(b),a);},onsuccess:function(){this.fireevent("complete",arguments).fireevent("success",arguments).callchain(); },failure:function(){this.onfailure();},onfailure:function(){this.fireevent("complete").fireevent("failure",thi...
Mozilla Application Framework in Detail - Archive of obsolete content
rsing files, compositing multiple sources into a single rdf graph, querying and manipulating graphs, and populating xul widgets (trees, menus, etc.) with graph data; an xslt/xpath processor; scalable vector graphics (svg) rendering with support for a usable subset of the standard including all basic shapes, beziers, stroking and filling with opacity, and much of the dom; mathml rendering; an e
cma-262 edition 3-compliant javascript engine; java integration with a bridge to xpcom, a java dom api, the open jvm integration (oji) facility, a java webclient api, and java plug-ins; nspr, a runtime engine that provides platform-independence (across over a dozen platforms) for non-gui operating system facilities with support for threads, thread synchronization, normal file and network i/o, inte...
Tamarin Acceptance Test Template - Archive of obsolete content
m with the notice * and other provisions required by the gpl or the lgpl. if you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the mpl, the gpl or the lgpl. * * ***** end license block ***** */ var section = "test"; // provide a document reference (ie, actionscript section) var version = "as3"; // version of e
cmascript or actionscript var title = "test"; // provide e
cma section title or a description var bugnumber = ""; starttest(); // leave this alone /** * calls to addtestcase here. addtestcase is a function that is defined * in shell.as and takes three arguments: * - a string representation of what is being tested * - the expected result * - the actual result * * for ex...
Tamarin build documentation - Archive of obsolete content
esulting executable "shell" is built in the current directory. compiling and running applications currently the only compiler for tamarin is the adobe actionscript compiler. the source code for the actionscript compiler, asc, has been open sourced as part of adobe flex®. this compiler is written in java and will require the installation of a java™ 1.4 or later jdk. a prototype self-hosting e
cmascript edition 4 compiler, esc, is provided with tamarin but it is not yet capable of bootstrapping itself or building applications. esc is under active development and will be able to generate tamarin applications later this year. use the following steps to build and install the actionscript compiler. download and build the asc source code using the subversion client $ svn co http://opens...
Tamarin Build System Documentation - Archive of obsolete content
ding performance). the smoke test list is constantly updated to contain the most recent failures, most frequent failures, and the newest testcases. the idea is to catch test failures in a few minutes rather than running the complete test run (1h 45m). the smoke test including downloading the shell takes about 3-4 minutes. the test phase runs all functional testcases including acceptance tests,
cmdline tests, and selftests. the acceptance tests are the majority and are run on all shells (release, release-debugger, debug, debug-debugger). the test phase takes approximately 1 hour 45 minutes. the performance and deep phases do not run synchronously. the phases run when slaves are available and the other phases do not wait for completion to start the next build. how are builds triggered?
Tamarin - Archive of obsolete content
tamarin's jit-compiler, nanojit, is also used in tracemonkey ergo spidermonkey, which is mozilla’s javascript engine in firefox. tamarin is available under the mpl/gpl/lgpl tri-license. releases release tracking information on current, past, and upcoming releases of tamarin. ...
Venkman Introduction - Archive of obsolete content
ctions displayed, check the "include functions" menu item in the view's context menu. you may need to close and re-open any objects you had open to see the change. properties that show up in a bold grey font are defined on an object from the prototype chain, and not on the actual object you are inspecting. if you would like to inspect the object's prototype and parent chains, check the "include e
cma properties" menu item in the view's context menu. if a property shows up in a bold red font, an exception occurred when venkman tried to read the value. the exception object will appear as the value of the property. icon data type icon data type void (undefined) value null value boolean value string value integer value ...
Example Sticky Notes - Archive of obsolete content
fax - respond today.</p></div> <div class="sticker"><p>don't forget the eggs!</p></div> <div class="sticker"><p>the new project - who's on charge?</p></div> <div class="sticker"><p>learn more about xbl.</p></div> <p style="clear: left"><a href="http://validator.w3.org/check?uri=referer"><img src="https://udn.realityripple.com/samples/e2/dd625ef1cd.png" width="88" height="31...
Mozilla E4X - Archive of obsolete content
e4x marries xml and javascript syntax, and extends javascript to include namespaces, qualified names, and xml elements and lists. e4x also adds new javascript operators for filtering xml lists, and for enumerating xml children and descendants. another e4x feature: the ability to bind a w3c dom document to a new xml object, reflecting the dom in e4x terms so that updates to either the dom or the e4x object hierarchy show up in the other. ...
XTech 2005 Presentations - Archive of obsolete content
e4x marries xml and javascript syntax, and extends javascript to include namespaces, qualified names, and xml elements and lists. e4x also adds new javascript operators for filtering xml lists, and for enumerating xml children and descendants. another e4x feature: the ability to bind a w3c dom document to a new xml object, reflecting the dom in e4x terms so that updates to either the dom or the e4x object hierarchy show up in the other. ...
reserved - Archive of obsolete content
ans that, to execute these commands, key events won't be passed to content, and event listeners registered for them in content will not be executed. currently, the content still receives these key events, even though it can't override them. in future releases, it won't receive them. see bug 1173061 for details. ...
MenuItems - Archive of obsolete content
ed property to false again. you may wish to change the disabled state in a popupshowing event handler. for more information about the popupshowing event, see the popupshowing event. if a menuitem is associated with a command, you can disable the menuitem by disabling the command instead. for instance, in the sample below, the delete command is disabled using the disabled attribute. <command id="
cmd_delete" disabled="true" oncommand="alert('deleted!');"/> <menuitem label="delete" accesskey="f" command="
cmd_deleted"/> as the menuitem is attached to the command, it's automatically disabled when the command is disabled. if the disabled state of the command is changed, the menuitem updates accordingly. this is an advantage when attaching several menuitems or buttons to the same command, as th...
Menus - Archive of obsolete content
e item using the oncommand attribute. here, it just displays an alert message. <menuitem label="open" accesskey="o" oncommand="alert('open a file!');"/> another way to associate an action with a menu item is to use a command element. the example below has the same effect as the previous example, however it uses a command element instead of listening to the command event directly. <command id="
cmd_open" oncommand="alert('open a file!');"/> ... <menuitem label="open" accesskey="o" command="
cmd_open"/> the command attribute should be set to the id of a command element within the same document, in this case '
cmd_open'. the command event will be fired on the command element instead of the menuitem. this is useful when you wish to have several elements performing the same action, for example...
The Joy of XUL - Archive of obsolete content
plications but at the cost of complexity and performance and without any supporting standards. based on existing standards xul is an xml language based on w3c standard xml 1.0. applications written in xul are based on additional w3c standard technologies featuring html 4.0; cascading style sheets (css) 1 and 2; document object model (dom) levels 1 and 2; javascript 1.5, including e
cma-262 edition 3 (e
cmascript); xml 1.0. platform portability like html, xul is designed to be platform-neutral, making applications easily portable to all of the operating systems on which mozilla runs. considering the broad range of platforms that currently support mozilla, this may be one of the most compelling features of xul as a technology for building applications. since xul p...
Using Visual Studio as your XUL IDE - Archive of obsolete content
t are declared in this file. 5.2 text preprocessor the mozilla build system includes a text preprocessor. as preprocessor directives are not valid xml, visual studio will mark them as errors in your xul files. 5.3 javascript related you will get validation errors for javascript code whenever using the keywords "const" and "let". these keywords are mozilla-specific at the moment. vs just supports e
cmascript 3rd edition and thus doesn't know these keywords. ...
The Implementation of the Application Object Model - Archive of obsolete content
local rdf data does so by using the localdata attribute, which gives the uri of the local data that should be merged in with the xul content tree. examples of tags that can reference local data are menu, menuitem, menubar, toolbox, toolbar, treebody, and treeitem. todo: outline the naming scheme for local data. give an example once i actually know what the naming scheme will be. talk to john m
cmullen about 5.0 preferences and figure out where localdata will need to be used (likely on every form element control) talk to steve elmer. it's likely that this might be the desirable solution for buttons that observe preferences (like the home button) denoting persistence of local annotations to the aom: the persistent attribute a content tree in xul that wishes to allow persistent local ann...
XML - Archive of obsolete content
ch this data is to be presented, like its semantically-challenged cousin html does, and it doesn't have much to say about the data itself. when someone says they are using xml, what they probably mean is that they have used xml to define their own syntax for marking up some data they are interested in. lots of people have created new languages out of xml. mathml and the chemical markup language (
cml) are two of the better-known and more widely-used languages, but there are hundreds. information developers create languages particular to their applications, any time they need a very specific way to represent the structure of some data. when we say language, we mean that developers create a set of terms, orlexicon, and a relationship between these terms, or what some people call agrammar. the...
commandset - Archive of obsolete content
and serves as a container for command elements. in addition, this element can hold a command updater which is used to update commands when certain events occur. a common use of the command updater is to update cut, copy, and paste menu items. more information is available in the xul tutorial. attributes commandupdater, events, oncommandupdate, targets example <commandset> <command id="
cmd_open" oncommand="alert('open!');"/> <command id="
cmd_help" oncommand="alert('help!');"/> </commandset> attributes commandupdater type: boolean if true, the commandset is used for updating commands. typically, this is used to update menu commands such as undo and cut based on when an event occurs. for example, since the cut command is only valid when something is sel...
MacFAQ - Archive of obsolete content
; var windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var win = windowmediator.getmostrecentwindow(singletonwindowtype); if (win) { window.close(); win.focus(); } } if (window.arguments && window.arguments[0]){ try { var
cmdline = window.arguments[0] .queryinterface(components.interfaces.nsicommandline); for (var i = 0; i <
cmdline.length; ++i) { debug(
cmdline.getargument(i)) } } catch(ex) { debug(window.arguments[0]) // do something with window.arguments[0] //nspreferences.setunicharpref("myxul.
cmdlinevalue", window.arguments[0]) ...
XULRunner tips - Archive of obsolete content
nspector 2.0.* to your xulrunner 1.9.0.* application follow these steps: download the dom inspector (instead of clicking the "add to..." button, right-click and select "save link as..."). ...
Windows and menus in XULRunner - Archive of obsolete content
ences for the menu and toolbar labels. the oncommand event is hooked up to javascript, just like an onclick in html. the javascript is contained in the main.js file. xul has a way to centralize commands and event handlers for menus and toolbars that do the same thing, like open and save in the above example. you can add a <commandset> and <command> elements like this: <commandset> <command id="
cmd_open" label="&file.open;" oncommand="dofileopen();"/> <command id="
cmd_save" label="&file.save;" oncommand="dofilesave();"/> </commandset> ... <menuitem command="
cmd_open"/> <menuitem command="
cmd_save"/> ... <toolbarbutton id="open" command="
cmd_open"/> <toolbarbutton id="save" command="
cmd_save"/> ... we can add images to the toolbar buttons through the css file. we could hard-code the im...
Mozprocess - Archive of obsolete content
ess utilizes and extends subprocess.popen to these ends. api mozprocess.processhandler:processhandler is the central exposed api for mozprocess. processhandler utilizes a contained subclass of subprocess.popen, process, which does the brunt of the process management. ...
nsIContentPolicy - Archive of obsolete content
{optional_inline}} the location of the resource that initiated this load request; can be null if inapplicable. acontext {optional_inline}} the nsidomnode or nsidomwindow that initiated the request, or something that can queryinterface() to one of those; can be null if inapplicable. note: acontext is the new tab/window when a user uses the context menu to open a link in a new tab/window or
cmd/ctrl + clicks the link (i.e., acontext is not the tab which the link was on in these cases). amimetypeguess optional. a guess for the requested content's mime type, based on information available to the request initiator (e.g., an object's type attribute); does not reliably reflect the actual mime type of the requested content. aextra an optional argument, pass-through for non-geck...
Mozilla release FAQ - Archive of obsolete content
sion of make chokes on the makefiles (on unix), you might not be using gnu make. grab the latest version of gnu make from the gnu ftp site. regarding shells, i would like to recommend the following: if you are using unix, use bash-family shells for the build because of the better control over redirection (in case you want to log errors and messages) if you are using win32, using the default shell
cmd.exe (as opposed to 4dos or 4nt) will probably yield better results. regarding compilation options, it would be good not to compile with optimization, because it's much slower to build, and on windows platforms, there's a bug in some versions of vc++ that makes mozilla crash in many common circumstances if compiled with optimization on. what platforms have had successful builds so far? this list ...
2006-11-10 - Archive of obsolete content
publication for the first issue is expected in fall 2007. w4a 2007 first call for papers the fourth international cross-disciplinary cofnerence on web accessibility (w4a 2007) co-located with the sixteenth international world wide web conference (www2007), in banff, canada. ...
2006-10-26 - Archive of obsolete content
006 17:45 pdt? tony inquires why tinderbox is showing that the fx 1.5.0.x (linux) has failed since october 20. gavin replies that "[t]he log file shows a "no space left on device" error when trying to link the final executable." learn the traffic magic of search engine cloaking mark describes the magic of search engine cloaker. (what it is, how to use it) cross-post-and followup fx2 announ
cment to support-firefox request for when the announcement about firefox 2's release to be posted on the mozilla.dev.apps.firefox newsgroup. firefox killer features suggestion john describes his suggestions for "killer features" for firefox. debug minefield on intel mac an inqury about how to debug minefield on an intel mac. rebuild firefox after modifying source code an inqury about ho...
2006-10-27 - Archive of obsolete content
006 17:45 pdt? tony inquires why tinderbox is showing that the fx 1.5.0.x (linux) has failed since october 20. gavin replies that "[t]he log file shows a "no space left on device" error when trying to link the final executable." learn the traffic magic of search engine cloaking mark describes the magic of search engine cloaker. (what it is, how to use it) cross-post-and followup fx2 announ
cment to support-firefox request for when the announcement about firefox 2's release to be posted on the mozilla.dev.apps.firefox newsgroup. firefox killer features suggestion john describes his suggestions for "killer features" for firefox. debug minefield on intel mac an inqury about how to debug minefield on an intel mac. rebuild firefox after modifying source code an inqury about ho...
2006-11-03 - Archive of obsolete content
more tbox changes on the way, most hitting on friday preed discusses killing more tboxes. cross-product extension install improvements simon paquet points out how much easier it is to install an extension in firefox than it in any other product. ...
2006-11-10 - Archive of obsolete content
other important notes are contained in the link above firefox and thunderbird 1.5.0.8 were released firefox and thunderbird 1.5.0.8 were released on november 7, 2006 blocker nomination and code freeze for 1.5.0.9/2.0.0.1 blocker nomination is due on november 10. code freeze for these versions is on november 26 version numbering changes paul reed announced changes to the way version numbers are done for pre-releases. ...
2006-11-24 - Archive of obsolete content
announ
cments bon echo status mike beltzner posted a small to-do list with regards to bon echo firefox 1.5.0.9/2.0.0.1 jay patel posted an update of bugs for the firefox 1.5.0.9/2.0.0.1 releases discussion non-ascii rendering performance boris zbarsky made some suggestions on how to improve international font rendering cvs commit access changes a large discussion went on about changes to policies surrounding cvs commit access project drivers and technical oversight mike connor suggested ways to better organize project management, policy making, and technical oversight. others gave input on this as well meetings because of the firefox summit last week there is no project status meeting this week november 22 gecko 1.9/gran paradiso status meeting: (agenda) ...
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.platform - october 21st to october 27th 2006 announcements no announ
cments this week. traffic status of xpcom cycle collector graydon hoare provides the xpcom patch which experiments with implementing a general-purpose garbage-cycle collector for xpcom. meetings no meetings this week ...
External resources for plugin creation - Archive of obsolete content
x, and mac os x (intel). feature highlights include thread safety checks, unicode support (with std::wstring), activex support, built-in drawing model negotiation for mac, automatic type conversion (including javascript arrays and objects), advanced security features, and more. supported development environments are visual studio on windows, xcode on mac, and gcc on linux. all platforms rely on
cmake for easy cross-platform builds. project: nixysa project home page description (from the home page): nixysa is a framework written in python to automatically generate glue code for npapi plugins (plugins for browsers such as google chrome or firefox), letting you easily expose c++ classes to javascript from a simple idl representation. nixysa was originally conceived for the needs of o3d, but i...
Introduction to Public-Key Cryptography - Archive of obsolete content
d:67:e9:46:a8: d:c4 here is the same certificate displayed in the 64-byte-encoded form interpreted by software: -----begin certificate----- miickzccazsgawibagibazanbgkqhkig9w0baqqfada3mqswcqydvqqgewjvuzer ma8ga1uechmitmv0c2nhcguxftatbgnvbastdfn1chjpewencybdqtaefw05nzew mtgwmtm2mjvafw05otewmtgwmtm2mjvamegxczajbgnvbaytalvtmrewdwydvqqk ewhozxrzy2fwztenmasga1uecxmeuhviczexmbuga1ueaxmou3vw
cml5ysbtagv0 dhkwgz8wdqyjkozihvcnaqefbqadgy0amigjaogbamr6ezipgfjx3urjgejmkiqg 7sdatyazbcabu1avyd7chrkiq31fbxfogd3wnktbf6hro6eamm5/r1askzz8aw7l iqzbcrxpc0k4du+2q6xju2mpm/8wkumontuvzpo+sgxelmhvcheqoocwfdizywyz nmmrjgaoma2ms6pukfqvagmbaagjnja0mbegcwcgsagg+eibaqqeawiagdafbgnv hsmegdawgbty8gzzkbhhufwjm1oxeuzc+zymytanbgkqhkig9w0baqqfaaobgqbt i6/z07z635dfzx4xbafpjlrl/aywqztsyx8gfcnaqcqcwasdkvsuj/vwbf...
TCP/IP Security - Archive of obsolete content
n optionally assure the reliability of communications. transmission control protocol (tcp) and user datagram protocol (udp) are commonly used transport layer protocols. network layer. this layer routes packets across networks. internet protocol (ip) is the fundamental network layer protocol for tcp/ip. other commonly used protocols at the network layer are internet control message protocol (i
cmp) and internet group management protocol (igmp). data link layer. this layer handles communications on the physical network components. the best-known data link layer protocol is ethernet. security controls exist for network communications at each layer of the tcp/ip model. as previously explained, data is passed from the highest to the lowest layer, with each layer adding more information.
Vulnerabilities - Archive of obsolete content
and web applications. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. the organization publishes a list of top web security vulnerabilities based on the data from various security organizations. the web security vulnerabilities are prioritized depending on exploitability, detectability and impact on software which can be any
cms such as wordpress, joomla, magento, wocommerce and more. here are six of the most common website vulnerabilities you must protect yourself against. 1. sql injections 2. cross site scripting (xss) 3. broken authentication & session management 4. insecure direct object references - dom (document object model) 5. security misconfiguration 6. cross-site request forgery (csrf) ...
Using SSH to connect to CVS - Archive of obsolete content
phic box just after login, and before the desktop loads, asking for your passphrase. the passphrase will be held for the length of the x session, and be passed on to all child shells. ms-dos command prompt cygwin for /f "tokens=1,2,3* delims=; " %%a in ('ssh-agent -c') do if "%%a"=="setenv" set %%b=%%c set home=/cygdrive/c/path/to/your/cygwin/home/directory ssh-add ~/.ssh/id_dsa start /b /wait
cmd.exe ssh-agent -k exit essentially both sets of commands do the same thing. first ssh-agent is called and its output is evaluated in the current environment. this sets environment variables that let cvs know how to find and use the agent. your private key is then added to ssh-agent using ssh-add at which point you will be prompted for the key's passphrase. since it's important that you kill the...
Processing XML with E4X - Archive of obsolete content
e4x is obselete. it's been disabled by default for chrome in firefox 17, and completely removed in firefox 21. use domparser/domserializer or a non-native jxon algorithm instead. first introduced in javascript 1.6, e4x introduces a native xml object to the javascript language, and adds syntax for embedding literal xml documents in javascript code. a full definition of e4x can be found in the e
cma-357 specification. this chapter provides a practical overview of the language; it is not a complete reference. compatibility issues prior to widespread browser support for the <script> element, it was common for javascript embedded in a page to be surrounded by html comment tags to prevent <script> unaware browsers from displaying javascript code to the user. this practice is no longer necessa...
E4X Tutorial - Archive of obsolete content
next » warning: e4x is deprecated. it will be disabled by default for content in firefox 16, disabled by default for chrome in firefox 17, and removed in firefox 18. use domparser/domserializer or a non-native jxon algorithm instead. this tutorial walks you through the basic syntax of e4x (e
cmascript for xml). with e4x, programmers can manipulate an xml document with a syntax more familiar to javascript programming. subjects introduction accessing xml children descendants and filters namespaces the global xml object see also e4x processing xml with e4x next » ...
Function.prototype.isGenerator() - Archive of obsolete content
o determine whether or not a function is a generator. it has been removed from firefox starting with version 58. syntax fun.isgenerator() return value a boolean indicating whether or not the given function is a generator. description the isgenerator() method determines whether or not the function fun is a generator. it was part of an early harmony proposal, but has not been included in the e
cmascript 2015 specification. examples function f() {} function* g() { yield 42; } console.log('f.isgenerator() = ' + f.isgenerator()); // f.isgenerator() = false console.log('g.isgenerator() = ' + g.isgenerator()); // g.isgenerator() = true specifications not part of any standard. ...
Generator comprehensions - Archive of obsolete content
n a generator which yields [1, 4, 9] example 2: using if in generator. var numbers = [1, 2, 3]; // generator function (function*() { for (let i of numbers) { if (i < 3) { yield i * 1; } } })(); // generator comprehension (for (i of numbers) if (i < 3) i); // result: both return a generator which yields [1, 2] specifications generator comprehensions were initially in the e
cmascript 2015 draft, but got removed in revision 27 (august 2014). please see older revisions of es2015 for specification semantics. ...
Error.description - Archive of obsolete content
string expression containing a description of the error. remarks the description property contains the error message string associated with a specific error. use the value contained in this property to alert a user to an error. the description and message properties provide the same functionality; the descriptionproperty provides backward compatibility; the message property complies with the e
cma standard. example the following example illustrates the use of the description property. try { // cause an error: x = y } catch(e) { // prints "[object error]": document.write(e) document.write (" "); // prints 5009: document.write((e.number & 0xffff)) document.write (" "); // prints "'y' is undefined": document.write(e.description); document.write (" "); // prints...
New in JavaScript 1.5 - Archive of obsolete content
the following is a changelog for javascript 1.5. this version was included in netscape navigator 6.0 was released on november 14, 2000 and was also used in later versions of netscape navigator and firefox 1.0. you can compare javascript 1.5 to jscript version 5.5 and internet explorer 5.5, which was released in july 2000. the corresponding e
cma standard is e
cma-262 edition 3 (from december 1999). new features in javascript 1.5 number.prototype.toexponential() number.prototype.tofixed() number.prototype.toprecision() const is now a reserved word. multiple catch clauses in a try...catch statement are supported. javascript authors can now add getters and setters to their objects. changed functionality in javascript 1.5 runtime errors are now reported as exceptions. regular expre...
New in JavaScript 1.7 - Archive of obsolete content
w keywords "yield" and "let" require you to specify version 1.7 because existing code might use those keywords as variable or function names. the features that do not introduce new keywords (destructuring assignment and array comprehensions) can be used without specifying the javascript version. new features in javascript 1.7 the following features added with javascript 1.7 were not part of an e
cma-262 standard at the time. in more recent firefox versions, the implementation is updated to work with semantics as specified in e
cmascript edition 6. please see the reference pages for differences. iterators and generators array comprehensions let statement (support for let expression was dropped in gecko 41, see bug 1023609). const statement destructuring assignment (support for js1.7 st...
Number.toInteger() - Archive of obsolete content
value is false, 0 is returned and if true, 1 is returned. syntax number.tointeger(number) parameters number the value to be converted to an integer. examples using tointeger number.tointeger(0.1); // 0 number.tointeger(1); // 1 number.tointeger(math.pi); // 3 number.tointeger(null); // 0 specifications not part of any standard. number.tointeger() was part of the draft e
cmascript 6 specification, but has been removed on august 23, 2013 in draft rev 17. ...
Object.prototype.__noSuchMethod__ - Archive of obsolete content
nderbird 43 / seamonkey 2.40)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. the __nosuchmethod__ property used to reference a function to be executed when a non-existent method is called on an object, but this function is no longer available. while __nosuchmethod__ has been dropped, the e
cmascript 2015 specification has the proxy object, with which you can achieve the below (and more). syntax obj.__nosuchmethod__ = fun parameters fun a function that takes the form function (id, args) { . . . } id the name of the non-existent method that was called args an array of the arguments passed to the method description by default, an attempt to call a method that ...
Reflect.enumerate() - Archive of obsolete content
syntax reflect.enumerate(target) parameters target the target object on which to get the property. return value an iterator with the enumerable own and inherited properties of the target object. exceptions a typeerror, if target is not an object. description the reflect.enumerate method returns an iterator with the enumerable own and inherited properties of the target object. ...
for each...in - Archive of obsolete content
e4x support has been removed. consider using for...of instead. firefox now warns about the usage of for each...in and it no longer works starting with firefox 57. please see warning: javascript 1.6's for-each-in loops are deprecated for migration help. the for each...in statement iterates a specified variable over all values of object's properties. for each distinct property, a specified statement is executed. syntax for each (variable in object) { statement } variable variable to iterate over property values, optionally declared with the var keyword. this variable is local to the function, not to the loop. ...
handler.enumerate() - Archive of obsolete content
syntax var p = new proxy(target, { enumerate(target) { } }); parameters the following parameter is passed to the enumerate method. this is bound to the handler. target the target object. return value an iterator object. description the handler.enumerate method is a trap for for...in statements. ...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
to see that with just a few lines of code, we can easily take advantage of sql data stores in javascript. the sample script in listing 1 could be factored out to it’s own function to retrieve the set of employee information, or abstracted further into a more generic data handler class. next we’ll take a look at another powerful feature in rhino, e4x processing. e4x (e
cmascript for xml) is an extension of javascript which provides direct support for xml, greatly simplifying the process of consuming xml via javascript. rhino’s support of this important standard eliminates the pain of using dom or sax based parsers in java. listing 3 below details a script used to process an rss feed from the mozilla website. importpackage( java.net ); // connect to the remote ...
Reference - Archive of obsolete content
d decode (atob) functions. anyone know why this has been left out? danbeck 07:02, 22 september 2005 (pdt) afaict , base64-related functionality is not a part of the javascript engine, but a dom feature (probably non-standard). --nickolay 08:31, 22 september 2005 (pdt) what's funny is that this talk page shows up first in a google search for "btoa javascript". this is number 2. it's not in the e
cma docs. if it's not in a standard, and that sun doc is corrent, then it should probably go in the window object methods. --jonnyq i've already added those methods in the methods listing, but i haven't defined them yet. --maian 02:39, 21 october 2005 (pdt) delete? i don't see any mention in the operators section for the delete operator. did this operator get removed/deprecated, or is it mis...
Writing JavaScript for XHTML - Archive of obsolete content
-mail the developers, e-mail your friends to e-mail the developers and e-mail your customers to e-mail the developers. if they get the hint and are not too annoyed, perhaps they start to implement xml features in their libraries. i read about e4x. now, this is perfect, isn't it? as a matter of fact, it isn't. e4x is a new method of using and manipulating xml in javascript. but, standardized by e
cma, they neglected to implement an interface to let e4x objects interact with dom objects our document consists of. so, with every advantage e4x has, without a dom interface you can't use it productively to manipulate your document. however, it can be used for data, and be converted into a string which can then be converted into a dom object. dom objects can similarly be converted into strings whic...
Common causes of memory leaks in extensions - Extensions
indows.push(window); } both of these cases can happen if you forget to declare local variables with var or let, which means they end up belonging to the global scope. for example: function implicitdeclarationleak(window) { // implicit variable declaration in the js global, holding a strong ref to the document doc = window.document; } implicitly declared variables can be avoided by using e
cmascript 5's strict mode. strict mode also excludes several other error-prone code patterns. for some examples found in real-world add-ons, see bug 712733, bug 725875, and bug 727552. to avoid these issues, references to dom nodes in foreign document should instead be stored in an object which is specific to that document, and cleaned up when the document is unloaded, or stored as weak referen...
Bounding volume collision detection with THREE.js - Game development
an update() method that will resize its bounding box mesh if the linked mesh rotates or changes its dimensions, and update its position. it takes into account the child meshes when computing the size of the bounding box, so the original mesh and all its children are wrapped. we can easily debug collisions by rendering the meshes that boxhelper creates. by default they are created with a linebasi
cmaterial material (a three.js material for drawing wireframe-style geometries). the main disadvantage is that it only creates box bounding volumes, so if you need spheres vs aabb tests you need to create your own sphere objects. to use it, we need to create a new boxhelper instance and supply the geometry and — optionally — a color that will be used for the wireframe material. we also need t...
Building up a basic demo with Three.js - Game development
nough though, we also need a material that will be used for our shape. material a material is what covers an object, the colors, or textures on its surface. in our case, we will choose a simple blue color to paint our box. there are a number of predefined materials which can be used: basic, phong, lambert. let's play with the last two later, but for now, the basic one should be enough: var basi
cmaterial = new three.meshbasi
cmaterial({color: 0x0095dd}); add this line below the previously added. our material is now ready, what next? mesh to apply the material to a geometry, a mesh is used. this takes on a shape, and adds the specified material to every face: var cube = new three.mesh(boxgeometry, basi
cmaterial); again, add this line below the one you previously added. adding the cu...
Unconventional controls - Game development
uide for all the needed info. there's even a cylon.js-supported makey button functionality inspired by the makey makey board, so you can use the popular cylon robotics framework for your experiments with arduino or raspberry pi. connecting the boards and using them may look like this: var cylon = require('cylon'); cylon.robot({ connections: { arduino: { adaptor: 'firmata', port: '/dev/ttya
cm0' } }, devices: { makey: { driver: 'makey-button', pin: 2 } }, work: function(my) { my.makey.on('push', function() { console.log("button pushed!"); }); } }).start(); as the description says: this gpio driver allows you to connect a 10 mohm resistor to a digital pin on your arduino or raspberry pi to control your robots with bananas, clay, or drawable circuitry. summa...
Visual-js game engine - Game development
prompt 3) select folder for server part of application (important : www is not secure place) 4) select folder for client part of application ( any path in www) 5) new app name will appear in project list , select and click open application 6) open your server folder : install node.js modules one way - use windows bat-s file (in server root folder with prefix install_ ) second way - open
cmd terminal and enter next command : npm install mysql npm install delivery npm install express npm install mkdirp npm install socket.io npm install nodemailer@0.7.0 very easy installation and project files generator . now you can use on-page-editor (nice for visual setup , checking positions and dimensions - not for logic ) . manual start from
cmd : server_folder/node editor.js after ...
Block cipher mode of operation - MDN Web Docs Glossary: Definitions of Web-related terms
ost symmetric-key algorithms currently in use are block ciphers: this means that they encrypt data a block at a time. the size of each block is fixed and determined by the algorithm: for example aes uses 16-byte blocks. block ciphers are always used with a mode, which specifies how to securely encrypt messages that are longer than the block size. for example, aes is a cipher, while ctr, cbc, and g
cm are all modes. using an inappropriate mode, or using a mode incorrectly, can completely undermine the security provided by the underlying cipher. ...
Falsy - MDN Web Docs Glossary: Definitions of Web-related terms
. examples examples of falsy values in javascript (which are coerced to false in boolean contexts, and thus bypass the if block): if (false) if (null) if (undefined) if (0) if (-0) if (0n) if (nan) if ("") the logical and operator, && if the first object is falsy, it returns that object false && "dog" // ↪ false 0 && "dog" // ↪ 0 specifications specification e
cmascript (e
cma-262)the definition of 'toboolean abstract operation' in that specification. learn more truthy boolean ...
Git - MDN Web Docs Glossary: Definitions of Web-related terms
git is a free, open-source, distributed source code management (s
cm) system. it facilitates handling code bases with distributed development teams. what sets it apart from previous s
cm systems is the ability to do common operations (branching, committing, etc.) on your local development machine, without having to change the master repository or even having write access to it. learn more general knowledge official website with documentation github, a git-based graphical project host ...
Hoisting - MDN Web Docs Glossary: Definitions of Web-related terms
hoisting was thought up as a general way of thinking about how execution contexts (specifically the creation and execution phases) work in javascript. however, the concept can be a little confusing at first. conceptually, for example, a strict definition of hoisting suggests that variable and function declarations are physically moved to the top of your code, but this is not in fact what happens. instead, the variable and function declarations are put into memory during the compile phase, but stay exactly where you typed them in your code. ...
SDP - MDN Web Docs Glossary: Definitions of Web-related terms
sdp (session description protocol) is the standard describing a peer-to-peer connection. sdp contains the codec, source address, and timing information of audio and video. here is a typical sdp message: v=0 o=alice 2890844526 2890844526 in ip4 host.anywhere.com s= c=in ip4 host.anywhere.com t=0 0 m=audio 49170 rtp/avp 0 a=rtpmap:0 p
cmu/8000 m=video 51372 rtp/avp 31 a=rtpmap:31 h261/90000 m=video 53000 rtp/avp 32 a=rtpmap:32 mpv/90000 sdp is never used alone, but by protocols like rtp and rtsp. sdp is also as component of webrtc, which uses sdp as a way of describing a session. learn more general knowledge webrtc protocols session description protocol on wikipedia ...
Sloppy mode - MDN Web Docs Glossary: Definitions of Web-related terms
the normal, non-strict mode of javascript is sometimes referred to as sloppy mode. this isn't an official designation, but you are likely to come across it if you spend time doing serious javascript code. learn more general knowledge "strict mode" in chapter 7 ("javascript syntax") in the book speaking javascript. ...
Symmetric-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
t symmetric-key algorithms currently in use are block ciphers: this means that they encrypt data one block at a time. the size of each block is fixed and determined by the algorithm: for example aes uses 16-byte blocks. block ciphers are always used with a mode, which specifies how to securely encrypt messages that are longer than the block size. for example, aes is a cipher, while ctr, cbc, and g
cm are all modes. using an inappropriate mode, or using a mode incorrectly, can completely undermine the security provided by the underlying cipher. ...
Truthy - MDN Web Docs Glossary: Definitions of Web-related terms
null, undefined, and nan). javascript uses type coercion in boolean contexts. examples of truthy values in javascript (which will be coerced to true in boolean contexts, and thus execute the if block): if (true) if ({}) if ([]) if (42) if ("0") if ("false") if (new date()) if (-42) if (12n) if (3.14) if (-3.14) if (infinity) if (-infinity) specifications specification e
cmascript (e
cma-262)the definition of 'toboolean abstract operation' in that specification. ...
Web standards - MDN Web Docs Glossary: Definitions of Web-related terms
ves you an idea of which standards websites and network systems must conform to: ietf (internet engineering task force): internet standards (std), which among other things govern set-up and use of uris, http, and mime w3c: specifications for markup language (e.g., html), style definitions (i.e., css), dom, accessibility iana (internet assigned numbers authority): name and number registries e
cma intl.: scripting standards, most prominently for javascript iso (international organization for standardization): standards governing a diverse array of aspects, including character encodings, website management, and user-interface design learn more general knowledge web standards on wikipedia ...
Whitespace - MDN Web Docs Glossary: Definitions of Web-related terms
the ascii whitespace: u+0009 tab, u+000a lf, u+000c ff, u+000d cr, and u+0020 space. in the form of text, they are treated as normal space characters and sequential whitespaces are collapsed as a single space in many cases (this behavior can be changed by the white-space css property. they are also used as a separator of an element name and its parameters, class names, and so on. in javascript e
cmascript® 2015 language specification specifies several unicode codepoints as white space: u+0009 character tabulation <tab>, u+000b line tabulation <vt>, u+000c form feed <ff>, u+0020 space <sp>, u+00a0 no-break space <nbsp>, u+feff zero width no-break space <zwnbsp> and other category “zs” any other unicode “separator, space” code point <usp>. these characters are usually unnecessary for...
Test your skills: CSS and JavaScript accessibility - Learn web development
or help — see the assessment or further help section at the bottom of this page. css accessibility 1 in the first task you are presented with a list of links. however, their accessibility is pretty bad — there is no way to really tell that they are links, or to tell which one the user is focussed on. we'd like you to assume that the existing ruleset with the a selector is supplied by some
cms, and that you can't change it — instead, you need to create new rules to make the links look and behave like links, and for the user to be able to tell where they are in the list. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. css accessibility 2 in this next task you are pr...
Cascade and inheritance - Learn web development
tant exists so that you know what it is when you come across it in other people's code. however, we strongly recommend that you never use it unless you absolutely have to. !important changes the way the cascade normally works, so it can make debugging css problems really hard to work out, especially in a large stylesheet. one situation in which you may have to use it is when you are working on a
cms where you can't edit the core css modules, and you really want to override a style that can't be overridden in any other way. but really, don't use it if you can avoid it. the effect of css location finally, it is also useful to note that the importance of a css declaration depends on what stylesheet it is specified in — it is possible for users to set custom stylesheets to override the deve...
Debugging CSS - Learn web development
ore effectively. a reduced test case is a code example that demonstrates the problem in the simplest possible way, with unrelated surrounding content and styling removed. this will often mean taking the problematic code out of your layout to make a small example which only shows that code or feature. to create a reduced test case: if your markup is dynamically generated — for example via a
cms — make a static version of the output that shows the problem. a code sharing site like codepen is useful for hosting reduced test cases, as then they are accessible online and you can easily share them with colleagues. you could start by doing view source on the page and copying the html into codepen, then grab any relevant css and javascript and include it too. after that, you can check wheth...
Combinators - Learn web development
be hard to reuse the css rules as you have made the selector very specific to the location of that element in the markup. it is often better to create a simple class and apply that to the element in question. that said, your knowledge of combinators will come in very useful if you need to get to something in your document and are unable to access the html, perhaps due to it being generated by a
cms. test your skills! we have covered a lot in this article, but can you remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: selectors. moving on this is the last section in our lessons on selectors. next we will move on to another important part of css — the css box model. p...
Pseudo-classes and pseudo-elements - Learn web development
aintain — what if a new paragraph got added to the top of the document? we'd need to move the class over to the new paragraph. instead of adding the class, we could use the :first-child pseudo-class selector — this will always target the first child element in the article, and we will no longer need to edit the html (this may not always be possible anyway, maybe due to it being generated by a
cms.) all pseudo-classes behave in this same kind of way. they target some bit of your document that is in a certain state, behaving as if you had added a class into your html. take a look at some other examples on mdn: :last-child :only-child :invalid note: it is valid to write pseudo-classes and elements without any element selector preceding them. in the example above, you could write ...
How CSS is structured - Learn web development
s also mixes (css) presentational code with html and content, making everything more difficult to read and understand. separating code and content makes maintenance easier for all who work on the the website. there are a few circumstances where inline styles are more common. you might have to resort to using inline styles if your working environment is very restrictive. for example, perhaps your
cms only allows you to edit the html body. you may also see a lot of inline styles in html email to achieve compatibility with as many email clients as possible. playing with the css in this article for the exercise that follows, create a folder on your computer. you can name the folder whatever you want. inside the folder, copy the text below to create two files: index.html: <!doctype html> <ht...
What is CSS? - Learn web development
and borders module — you might think that it makes logical sense for the background-color and border-color properties to be defined in this module. and you'd be right. css specifications all web standards technologies (html, css, javascript, etc.) are defined in giant documents called specifications (or simply "specs"), which are published by standards organizations (such as the w3c, whatwg, e
cma, or khronos) and define precisely how those technologies are supposed to behave. css is no different — it is developed by a group within the w3c called the css working group. this group is made of representatives of browser vendors and other companies who have an interest in css. there are also other people, known as invited experts, who act as independent voices; they are not linked to a mem...
Using CSS generated content - Learn web development
ome part of the dom. specifying content in a stylesheet can cause complications. for example, you might have different language versions of your document that share a stylesheet. if you specify content in your stylesheet that requires translation, you have to put those parts of your stylesheet in different files and arrange for them to be linked with the appropriate language versions of your dou
cment. this issue does not arise if the content you specify consists of symbols or images that apply in all languages and cultures. examples text content css can insert text content before or after an element. to specify this, make a rule and add ::before or ::after to the selector. in the declaration, specify the content property with the text content as its value. html a text where i need to...
How much does it cost to do something on the Web? - Learn web development
otection by hiding your postal address and email address behind their own addresses: the postal address can be provided in care of the registrar, and your email address can be obscured via your registrar's alias. do-it-yourself hosting vs. “packaged” hosting when you want to publish a website, you could do everything by yourself: set up a database (if needed), content management system, or
cms (like wordpress, dotclear, spip, etc.), upload pre-made or your own templates. you could use your hosting provider's environment, for roughly ten to fifteen dollars per month, or subscribe directly to a dedicated hosting service with pre-packaged
cmss (e.g., wordpress, tumblr, blogger). for the latter, you won't have to pay anything, but you may have less control over templating and other optio...
What is a web server? - Learn web development
he content or even generates it on the fly from a database. this approach provides more flexibility, but the technical stack is more complex, making it dramatically more challenging to build a website. there are so many application servers that it's difficult to suggest a particular one. some application servers cater to specific website categories like blogs, wikis, or ecommerce; others, called
cmss (content management systems), are more generic. if you're building a dynamic website, take the time to choose technology that fits your needs. unless you want to learn web server programming (which is an exciting area in itself!), you don't need to create your own application server. that's just unknown prefix: wikipedia.. next steps now that you are familiar with web servers, you could: r...
Other form controls - Learn web development
the optional size attribute provides control over how many options are visible when the select does not have focus. multiple choice select box by default, a select box only lets the user select a single value. by adding the multiple attribute to the <select> element, you can allow users to select several values, by using the default mechanism provided by the operating system (e.g. holding down
cmd/ctrl and clicking multiple values on desktop). <select id="multi" name="multi" multiple size="2"> <optgroup label="fruits"> <option>banana</option> <option selected>cherry</option> <option>lemon</option> </optgroup> <optgroup label="vegetables"> <option>carrot</option> <option>eggplant</option> <option>potato</option> </optgroup> </select> note: in t...
The web and web standards - Learn web development
d. web standards are created by standards bodies — institutions that invite groups of people from different technology companies to come together and agree on how the technologies should work in the best way to fulfill all of their use cases. the w3c is the best known web standards body, but there are others such as the whatwg (who were responsible for the modernization of the html language), e
cma (who publish the standard for e
cmascript, which javascript is based on), khronos (who publish technologies for 3d graphics, such as webgl), and others. "open" standards one of the key aspects of web standards, which timbl and the w3c agreed on from the start, is that the web (and web technologies) should be free to both contribute and use, and not encumbered by patents/licensing. therefore any...
Images in HTML - Learn web development
ff images in your browser and see how things look. you'll soon realize how helpful alt text is if the image cannot be seen. note: for more information, see our guide to text alternatives. width and height you can use the width and height attributes to specify the width and height of your image. you can find your image's width and height in a number of ways. for example on the mac you can use
cmd + i to get the info display up for the image file. returning to our example, we could do this: <img src="images/dinosaur.jpg" alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth" width="400" height="341"> this doesn't result in much difference to the display, under normal circumstances. but if the image isn't being displayed, for e...
Responsive images - Learn web development
on is separated from the previous one by a comma. for each one, we write: an image filename (elva-fairy-480w.jpg) a space the image's intrinsic width in pixels (480w) — note that this uses the w unit, not px as you might expect. this is the image's real size, which can be found by inspecting the image file on your computer (for example, on a mac you can select the image in finder and press
cmd + i to bring up the info screen). sizes defines a set of media conditions (e.g. screen widths) and indicates what image size would be best to choose, when certain media conditions are true — these are the hints we talked about earlier. in this case, before each comma we write: a media condition ((max-width:600px)) — you'll learn more about these in the css topic, but for now let's just ...
Index - Learn web development
e of the different asynchronous techniques you'll encounter, showing how they can help us solve such problems. 55 making asynchronous programming easier with async and await beginner, codingscripting, guide, javascript, learn, promises, async, asynchronous, await more recent additions to the javascript language are async functions and the await keyword, part of the so-called e
cmascript 2017 javascript edition (see e
cmascript next support in mozilla). these features basically act as syntactic sugar on top of promises, making asynchronous code easier to write and to read afterwards. they make async code look more like old-school synchronous code, so they're well worth learning. this article gives you what you need to know. 56 client-side web apis api, articl...
Basic math in JavaScript — numbers and operators - Learn web development
called modulo) returns the remainder left over after you've divided the left number into a number of integer portions equal to the right number. 8 % 3 (returns 2, as three goes into 8 twice, leaving 2 left over). ** exponent raises a base number to the exponent power, that is, the base number multiplied by itself, exponent times. it was first introduced in e
cmascript 2016. 5 ** 2 (returns 25, which is the same as 5 * 5). note: you'll sometimes see numbers involved in arithmetic referred to as operands. note: you may sometimes see exponents expressed using the older math.pow() method, which works in a very similar way. for example, in math.pow(7, 3), 7 is the base and 3 is the exponent, so the result of the expression is 343. math.pow(7, 3...
TypeScript support in Svelte - Learn web development
unning it in a continuous integration (ci) pipeline. just run npm run validate to check for unused css, and return a11y hints and typescript compile errors. in this case, if you run npm run validate (either in the vs code console or terminal) you will get the following error: even better, if you run it from the vs code integrated terminal (you can open it with the ctrl + ` keyboard shortcut),
cmd/ctrl + clicking on the file name will take you to the line containing the error. you can also run the validate script in watch mode with npm run validate -- --watch. in this case, the script will execute whenever you change any file. if you are running this in your regular terminal, you are advised to keep it running in the background in a separate terminal window of its own so that it can keep...
Getting started with Svelte - Learn web development
are using npm in this set of tutorials. see package management basics for more information on npm and yarn. if you're using windows, you will need to install some software to give you parity with unix/macos terminal in order to use the terminal commands mentioned in this tutorial. gitbash (which comes as part of the git for windows toolset) or windows subsystem for linux (wsl) are both suitable.
cmder is another very good and complete alternative. see command line crash course for more information on these, and on terminal commands in general. also see the following for more information: "what is npm" on nodejs.org "introducing npx" on the npm blog "the easiest way to get started with svelte" on the svelte blog creating your first svelte app the easiest way to create a starter app ...
Debugging on Mac OS X
files and directories in your source directory, untick "copy items if needed", then click add. (these will then be progressively added under the root item <project-name> in the left-hand pane. note that subdirectories may initially appear to be empty, but they too will progressively be populated as xcode processes the sourse files. once done, you should be able to open any file quickly by hitting
cmd-shift-o and typing in the name of a file.) in the product menu, select scheme > new scheme and name your scheme (for example, "debug"). after you click ok, xcode should open the settings window for the new scheme. (if not, then open its settings from the product > edit scheme menu.) select "run" on the left-hand side of the settings window, then select the "info" tab. set the executable by cli...
HTTP logging
ironment variables differs by operating system. don't let the scary-looking command line stuff frighten you off; it's not hard at all! windows if firefox is already running, exit out of it. open a command prompt. on windows xp, you can find the "run..." command in the start menu's "all programs" submenu. on all newer versions of windows, you can hold down the windows key and press "r". type
cmd and press enter, a new command prompt window with a black background will appear. copy and paste the following lines one at a time into the command prompt window. press the enter key after each one.: for 64-bit windows: set moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,nshostresolver:5,cookie:5 set moz_log_file=%temp%\log.txt "c:\program files\mozilla firefox\firefox.ex...
Makefile - variables
l note: values will be appended to the export variable when present. os_ variable description os_arch platform type os_target target binary type if building on an intermediate platform(building mobile binaries on gnu/linux). host_ variable description host_
cmsrcs a list of .m sources to compile host_
cmmsrcs a list of .mm sources to compile host_objs host_os_arch arch of real platform a target platform is being built on(building mobile binaries on gnu/linux). distribution/release variables variable description dist top le...
Gecko Logging
took %dms!", elapsed)); } } if (i != 10) { moz_log(slogger, loglevel::error, ("i should be 10!")); } } enabling logging the log level for a module is controlled by setting an environment variable before launching the application. it can also be adjusted by setting prefs. by default all logging output is disabled. set moz_log="example_logger:3" in the windows command prompt (
cmd.exe), don't use quotes: set moz_log=example_logger:3 if you want this on geckoview example, use the following adb command to launch process: adb shell am start -n org.mozilla.geckoview_example/.geckoviewactivity --es env0 "moz_log=example_logger:3" there are special module names to change logging behavior. you can specify one or more special module names without logging level. spec...
Frame script environment
in the browser. may be null (see below) docshell the nsidocshell associated with the browser. addeventlistener() listen to events from content. removeeventlistener() stop listening to events from content. addmessagelistener() listen to messages from chrome. removemessagelistener() stop listening to messages from chrome. sendasyn
cmessage() send an asynchronous message to chrome. sendsyn
cmessage() send a synchronous message to chrome. dump() print a message to the console. atob() base64 decode. btoa() base64 encode. components the usual components object. in particular, note that a frame script accesses the dom window using content, not window: // frame s...
Frame script environment
d in the browser may be null (see below) docshell the nsidocshell associated with the browser. addeventlistener() listen to events from content. removeeventlistener() stop listening to events from content. addmessagelistener() listen to messages from chrome. removemessagelistener() stop listening to messages from chrome. sendasyn
cmessage() send an asynchronous message to chrome. sendsyn
cmessage() send a synchronous message to chrome. dump() print a message to the console. atob() base64 decode. btoa() base64 encode. components the usual components object. in particular, note that a frame script accesses the dom window using content, not window: // frame s...
mozbrowseropentab
standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowseropentab event is fired when a new tab is opened within a browser <iframe> as a result of the user issuing a command to open a link target in a new tab (for example ctrl/
cmd + click.) general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event norma...
Browser API
b app embedded in it. mozbrowsermetachange sent when a <meta> elelment is added to, removed from or changed in the browser <iframe>'s content. mozbrowseropenwindow sent when window.open() is called within a browser <iframe>. mozbrowseropentab sent when a new tab is opened within a browser <iframe> as a result of the user issuing a command to open a link target in a new tab (for example ctrl/
cmd + click.) mozbrowserresize sent when the browser <iframe>'s window size has changed. mozbrowserscroll sent when the browser <iframe> content scrolls. mozbrowserscrollareachanged sent when the available scrolling area in the browser <iframe> changes. this can occur on resize and when the page size changes (while loading for example.) mozbrowserscrollviewchange sent when asynchronous scrol...
IPDL Tutorial
ype other than one built into ipdl, you can add a using declaration in an ipdl specification. a custom serializer and deserializer must be provided by your c++ code. using mozilla::plugins::npremoteevent; sync protocol pplugininstance { child: async handleevent(npremoteevent); }; unions ipdl has built-in support for declaring discriminated unions. ...
JavaScript-DOM Prototypes in Mozilla
alert("hello world!"); } document.images[0].__proto__.foo = bar; this would make every image in this document have a callable foo property (i.e. a foo() method). alternatively, one can access and modify the prototype of an htmlimageelement through the prototype property of the constructor: htmlimageelement.prototype.foo = bar; modifying the prototype of a host object is not guaranteed by e
cmascript specification. moreover, no specification guarantees that there will be a globally available htmlimageelement, or that such object will be the constructor for any arbitrary image's [[prototype]]. a third way through which one can access the prototype of an object is through the constructor property of the object, which itself points (initially) to the constructor: document.images[0].cons...
JavaScript Tips
it is often faster to store the result in a temporary variable. ...
Application Translation with Mercurial
changes in the future. thunderbird, lightning or seamonkey: download the comm-<branch>.hg file (e.g. comm-aurora.hg) from https://ftp.mozilla.org/pub/mozilla.org/thunderbird/bundles/ in the next step, we will unpack the source code: open an input shell, e.g. by pressing the windows key and r on the keyboard or by calling the "run..." command from the windows "start" button, and then typing
cmd and pressing the enter key. launch the installed mozillabuild toolset by launching it with its path, e.g. c:\mozilla\coding\buildtools\mozillabuild\start-shell-msvc2010.bat you can autocomplete the file path after typing a few characters and then pressing the tabulator key. if you launch the start-shell-l10n.bat, compiling features will be disabled. you can create translation patches, but cre...
Localization content best practices
generally not complete sentences, but instead, phrases that convey the idea of a concept or action. therefore, for both correctness and consistency within en-us, please leave out the trailing periods for these items. this also helps with localization. developer tools key shortcuts when translating firefox strings from /devtools/ folder, you may see some keys like this: inspector.searchhtml.key=
cmdorctrl+f the first part of the string `
cmdorctrl` should not be translated. you may only translate the letter to better match your locale. this key shortcut definition matches the electron key shortcut definition. create localizable ui css issues some css text/font properties may cause problems with text legibility when applied to certain language texts. avoid using italic for cjkt. this a...
Localization prerequisites
you can try one of these: notepad++ or notepad2 on windows, vim, gedit or kate on gnu/linux, bbedit on mac os x. to verify that they work, open a shell. linux users should know, on the mac, you find terminal in applications/utilities. on windows, mozillabuild offers a start-shell-l10n.bat in c:\mozilla-build. let’s try our entry points: $ hg --version mercurial distributed s
cm (version 1.3.1) copyright (c) 2005-2009 matt mackall <mpm@selenic.com> and others this is free software; see the source for copying conditions. there is no warranty; not even for merchantability or fitness for a particular purpose great, hg works. $ make –version gnu make 3.81.90 … make works, too. don’t bother the version string here, as long as you’re 3.79.1 or better. now continue...
Fonts for Mozilla's MathML engine
typically, use a fontconfig configuration /etc/fonts/conf.avail/09-texlive-fonts.conf that points to the opentype directory of texlive, such as: <?xml version="1.0"?> <!doctype fontconfig system "fonts.dtd"> <fontconfi...
Mozilla Web Developer FAQ
therefore, using it on the public web causes interoperabilty problems.) xml:base is observed when following links. style sheets can be references using processing instructions. i didn’t find the answer i was looking for. where should i ask? try asking in the newsgroup relevant to your question in the comp.infosystems.www.authoring.* hierarchy or, if your question is about javascript/e
cmascript or the dom, in comp.lang.javascript (after reading the group faqs first, of course). please do not ask web authoring questions in the newsgroups intended for discussion about the development of mozilla. comp.infosystems.www.authoring.html web authoring faq comp.infosystems.www.authoring.stylesheets faq ciwas stylesheet authoring faq comp.lang.javascript faq original document infor...
About NSPR
calable and efficient implementations. nspr makes as much use of what the systems offer as it can. it is a goal of nspr that nspr impose as little overhead as possible in accessing those appropriate system features. thread synchronization thread synchronization is loosely based on monitors as described by c.a.r. hoare in monitors: an operating system structuring concept , communications of the a
cm, 17(10), october 1974 and then formalized by xerox' mesa programming language ("mesa language manual", j.g. mitchell et al, xerox parc, csl-79-3 (apr 1979)). this mechanism provides the basic mutual exclusion (mutex) and thread notification facilities (condition variables) implemented by nspr. additionally, nspr provides synchronization methods more suited for use by java. the java-like facilitie...
Floating Point Number to String Conversion
these conversion functions were originally written by david m. gay of at&t. they use ieee double-precision (not ieee double-extended) arithmetic. the header file prdtoa.h declares these functions. the functions are: pr_strtod pr_dtoa pr_cnvtf references gay's implementation is inspired by these two papers. [1] william d. clinger, "how to read floating point numbers accurately," proc. a
cm sigplan '90, pp. 92-101. [2] guy l. steele, jr. and jon l. white, "how to print floating-point numbers accurately," proc. a
cm sigplan '90, pp. 112-126. ...
PLHashComparator
onst void *v2); description plhashcomparator is a function type that compares two values of an unspecified type. it returns a nonzero value if the two values are equal, and 0 if the two values are not equal. plhashcomparator defines the meaning of equality for the unspecified type. for convenience, two comparator functions are provided. pl_comparestrings compare two character strings using str
cmp. pl_comparevalues compares the values of the arguments v1 and v2 numerically. remark the return value of plhashcomparator functions should be of type prbool. see also pl_comparestrings, pl_comparevalues ...
PL_CompareStrings
compares two character strings. syntax #include <plhash.h> printn pl_comparestrings( const void *v1, const void *v2); description pl_comparestrings compares v1 and v2 as character strings using str
cmp. if the two strings are equal, it returns 1. if the two strings are not equal, it returns 0. pl_comparestrings can be used as the comparator function for string-valued key or entry value. ...
PR_CEnterMonitor
this reference must remain valid as long as there are monitoring operations being performed. returns the function returns one of the following values: if successful, the function returns a pointer to the prmonitor associated with the value specified in the address parameter. if unsuccessful (the monitor cache needs to be expanded and the system is out of memory), the function returns null. ...
PR_CExitMonitor
returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. this may indicate that the address parameter is invalid or that the calling thread is not in the monitor. description using the value specified in the address parameter to find a monitor in the monitor cache, pr_cexitmonitor decrements the entry count associated with the monitor. ...
PR_CNotify
the calling thread must be in the monitor defined by the value of the address. returns pr_success indicates that the calling thread is the holder of the mutex for the monitor referred to by the address parameter. pr_failure indicates that the monitor has not been entered by the calling thread. ...
PR_CNotifyAll
the calling thread must be in the monitor at the time pr_cnotifyall is called. returns pr_success indicates that the referenced monitor was located and the calling thread was in the monitor. ...
PR_CWait
timeout the amount of time (in printervaltime units) that the thread is willing to wait for an explicit notification before being rescheduled. if you specify pr_interval_no_timeout, the function returns if and only if the object is notified. ...
PR_cnvtf
ers: buf the address of the buffer in which to store the result. bufsz the size of the buffer provided to hold the result. prcsn the number of digits of precision to which to generate the floating point value. fval the double-precision floating point number to be converted. description pr_cnvtf is a simpler interface to convert a floating point number to a string. it conforms to the e
cma standard of javascript (e
cmascript). on return, the result is written to the buffer pointed to by buf of size bufsz. ...
Getting Started With NSS
rtunately the nss project doesn't have a technical writer at this time, so our documentation is not as organized as we would like it to be. you could contribute by organizing it in a better way.) nss sample code a good place to start learning how to write nss applications are the command line tools that are maintained by the nss developers. you can find them in subdirectory mozilla/security/nss/
cmd or have a look at some basic nss sample code. a new set of samples is currently under development and review, see create new nss samples. you are welcome to download the samples via: hg clone https://hg.mozilla.org/projects/nss; cd nss; hg update samples_branch how to contribute ... (this section is still under construction, but there are many contribution opportunities) start by opening a...
JSS FAQ
rg/mozilla/jss/ssl/sslserver.java org/mozilla/jss/ssl/ssltest.java other test code that may prove useful: org/mozilla/jss/asn1/integer.java org/mozilla/jss/asn1/sequence.java org/mozilla/jss/asn1/set.java org/mozilla/jss/pkcs10/certificationrequest.java org/mozilla/jss/pkcs12/pfx.java org/mozilla/jss/pkix/cert/certificate.java org/mozilla/jss/pkix/
cmmf/certrepcontent.java org/mozilla/jss/pkix/crmf/certreqmsg.java org/mozilla/jss/pkix/crmf/certtemplate.java org/mozilla/jss/pkix/primitive/name.java org/mozilla/jss/provider/javax/crypto/jsssecretkeyfactoryspi.java org/mozilla/jss/util/utf8converter.java org/mozilla/jss/util/base64inputstream.java jss/samples/pqggen.java jss/samples/pkcs12.java ...
NSS 3.12.9 release notes
pr 4.8.7 header files and shared libraries, which nss 3.12.9 requires. nspr 4.8.7 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.8.7/. new in nss 3.12.9 removed functions new ssl options new error codes bugs fixed the following bugs have been fixed in nss 3.12.9. ...
NSS 3.16 release notes
. nss 3.16 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_rtm/src/ new in nss 3.16 new functionality supports the linux x32 abi. (this requires nspr 4.10.4.) to build for the linux x32 target, set the environment variable use_x32=1 when building nss. new functions in
cms.h nss_
cmssignerinfo_verify - verify the signature of a single signerinfo. it just verifies the signature, assuming that the certificate has been verified already. new macros in sslproto.h tls_rsa_with_rc4_128_sha, tls_rsa_with_3des_ede_cbc_sha, etc. - cipher suites that were first defined in ssl 3.0 can now be referred to with their official iana names in tls, with the tls_ p...
NSS 3.20 release notes
e tls library keeps all dhe ciphersuites disabled by default. they can be enabled with the new socket option ssl_enable_server_dhe and the ssl_optionset or the ssl_optionsetdefault api. the server side implementation of the tls does not support session tickets while using a dhe ciphersuite (see bug 1174677). support for the following ciphersuites has been added: tls_dhe_dss_with_aes_128_g
cm_sha256 tls_dhe_dss_with_aes_128_cbc_sha256 tls_dhe_dss_with_aes_256_cbc_sha256 by default, the server side tls implementation will use dhe parameters with a size of 2048 bits when using dhe ciphersuites. nss embeds fixed dhe parameters sized 2048, 3072, 4096, 6144 and 8192 bits, which were copied from version 08 of the internet-draft "negotiated finite field diffie-hellman ephemeral ...
NSS 3.28.1 release notes
ca generalitat valenciana sha-256 fingerprint: 8c:4e:df:d0:43:48:f3:22:96:9e:7e:29:a4:cd:4d:ca:00:46:55:06:1c:16:e1:b0:76:42:2e:f3:42:ad:63:0e ou = rsa security 2048 v3 sha-256 fingerprint: af:8b:67:62:a1:e5:28:22:81:61:a9:5d:5c:55:9e:e2:66:27:8f:75:d7:9e:83:01:89:a5:03:50:6a:bd:6b:4c the following ca certificates were added ou = ac raiz fnmt-r
cm sha-256 fingerprint: eb:c5:57:0c:29:01:8c:4d:67:b1:aa:12:7b:af:12:f7:03:b4:61:1e:bc:17:b7:da:b5:57:38:94:17:9b:93:fa cn = amazon root ca 1 sha-256 fingerprint: 8e:cd:e6:88:4f:3d:87:b1:12:5b:a3:1a:c3:fc:b1:3d:70:16:de:7f:57:cc:90:4f:e1:cb:97:c6:ae:98:19:6e cn = amazon root ca 2 sha-256 fingerprint: 1b:a5:b2:aa:8c:65:40:1a:82:96:01:18:f8:0b:ec:4...
NSS 3.33 release notes
text parameter. cert_findcertbynicknameoremailaddrcx - a variation of existing function cert_findcertbynicknameoremailaddr that accepts an additional password context parameter. cert_findcertbynicknameoremailaddrforusagecx - a variation of existing function cert_findcertbynicknameoremailaddrforusage that accepts an additional password context parameter. in secport.h nss_securemem
cmpzero - check if a memory region is all zero in constant time. port_zallocaligned - allocate aligned memory. port_zallocalignedoffset - allocate aligned memory for structs. in ssl.h ssl_getexperimentalapi - access experimental apis in libssl. bugs fixed in nss 3.33 this bugzilla query returns all the bugs fixed in nss 3.33: https://bugzilla.mozilla.org/buglist.cgi?resolu...
NSS 3.35 release notes
tions that could be helpful for environments that need to adopt to the new default. if nss is initialized, in read-write mode with a database directory provided, it uses database files to store certificates, key, trust, and other information. nss supports two different database file formats: dbm: the legacy file format, based on berkeley db, using filenames cert8.db, key3.db and se
cmod.db. parallel database access, by multiple applications, is forbidden as it will likely result in data corruption. sql: the newer file format, based on sqlite, using filenames cert9.db, key4.and and pkcs11.txt. parallel database access, by multiple applications, is supported. applications using nss may explicitly request to use a specific database format, by adding a type prefix...
NSS 3.36.7 release notes
secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_36_7_rtm/src/ other releases are available in nss releases. new in nss 3.36.7 new functionality no new functionality is introduced in this release. this is a patch release to fix bugs. bugs fixed in nss 3.36.7 bug 1507135 and bug 1507174 - add additional null checks to several
cms functions to fix a rare
cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. (cve-2018-18508) compatibility nss 3.36.7 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36.7 shared libraries without recompiling or relinking. furthermore, applications that ...
NSS 3.41.1 release notes
secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_41_1_rtm/src/ other releases are available in nss releases. new in nss 3.41.1 new functionality no new functionality is introduced in this release. this is a patch release to fix bugs. bugs fixed in nss 3.41.1 bug 1507135 and bug 1507174 - add additional null checks to several
cms functions to fix a rare
cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. (cve-2018-18508) this bugzilla query returns all bugs fixed in 3.41.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.41.1 compatibility nss 3.41.1 shared libraries are backward compatible with a...
NSS 3.42.1 release notes
s nss_3_42_1_rtm. nss 3.42.1 requires nspr 4.20 or newer. nss 3.42.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_42_1_rtm/src/ other releases are available in nss releases. bugs fixed in nss 3.42.1 bug 1507135 and bug 1507174 - add additional null checks to several
cms functions to fix a rare
cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. this was originally announced in nss 3.42, but was mistakenly not included in the release. (cve-2018-18508) this bugzilla query returns all the bugs fixed in nss 3.42.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss...
NSS 3.45 release notes
ersioning to openbsd builds to fix link time errors using nss bug 1553443 - send session ticket only after handshake is marked as finished bug 1550708 - fix gyp scripts on solaris sparc so that libfreebl_64fpu_3.so builds bug 1554336 - optimize away unneeded loop in mpi.c bug 1559906 - fipstest: use ckm_tls12_master_key_derive instead of vendor specific mechanism bug 1558126 - tls_aes_256_g
cm_sha384 should be marked as fips compatible bug 1555207 - helloretryrequestcallback return code for rejecting 0-rtt bug 1556591 - eliminate races in uses of pk11_setwrapkey bug 1558681 - stop using a global for anti-replay of tls 1.3 early data bug 1561510 - fix a bug where removing -arch xxx args from cc didn't work bug 1561523 - add a string for the new-ish error ssl_error_missing_post_hand...
NSS 3.48 release notes
ition in self-encrypt functions bug 1599545 - fix assertion and add test for early key update bug 1597799 - fix a crash in nssckfwobject_getattributesize bug 1591178 - add entrust root certification authority - g4 certificate to nss bug 1590001 - prevent negotiation of versions lower than 1.3 after helloretryrequest bug 1596450 - added a simplified and unified mac implementation for hmac and
cmac behind pkcs#11 bug 1522203 - remove an old pentium pro performance workaround bug 1592557 - fix prng known-answer-test scripts bug 1586176 - encryptupdate should use maxout not block size (cve-2019-11745) bug 1593141 - add `notbefore` or similar "beginning-of-validity-period" parameter to mozilla::pkix::trustdomain::checkrevocation bug 1591363 - fix a pbkdf2 memory leak in nsc_generatekey ...
NSS Sample Code sample5
e "nss.h" #include "pk11pub.h" #define base64_encoded_subjectpublickeyinfo "mfwwdqyjkozihvcnaqebbqadswawsajbal3f6tic3jeysugo+a2fpu3w+epv/feix21dc86wynpftw4srftz2onuzyluzdhzdb+k//8dct3iaozuui3r2emcaweaaq==" #define base64_encoded_privatekeyinfo "miibvqibadanbgkqhkig9w0baqefaascat8wgge7ageaakeavcxpmhzckriy6cj5rz89tdb4sm/8v4hfbumlzpziekw1biysw3pag1tpittmmdl1v6t//x1xpcga7nrsldhz4widaqabakeajh8+4qncw
cmgivnm6ytbpqt+k/jeoexg2bqhjojvnxn3fazgcefxvpuibcjvfaijs9yb
cmozzrato0+k2hwnoqihaoc4nvbo8fqhzs4yxm1m86kml47fa9ui//oufbhladw1aiea2dbmixnsbokb+ohver69p0gnewlvcjc9bjdvfdlvslcciqcptv3vgyjv2vdwxqzqahc+yb4gigaqoqbcbmjd3lyflqiga+vtydunoqwtzwve4grf7izk2v5ccnhg3gr5rgwxn58cigccaforruksm66isg0iti04g9v/w+wmx91wjeeb+qbz" int main(int argc, char **argv) { secstatus rv; certcertificate *cert = null...
Utilities for nss samples
/* terminate passphrase */ phrases[i++] = '\0'; /* clean up any eol before the start of the next passphrase */ while ( (i<nb) && (phrases[i] == '\r' || phrases[i] == '\n')) { phrases[i++] = '\0'; } /* now analyze the current passphrase */ phrase = &phrases[startphrase]; if (!tokenname) break; if (port_strn
cmp(phrase, tokenname, tokenlen)) continue; phraselen = port_strlen(phrase); if (phraselen < (tokenlen+1)) continue; if (phrase[tokenlen] != ':') continue; phrase = &phrase[tokenlen+1]; break; } while (i<nb); phrase = port_strdup((char*)phrase); port_free(phrases); return phrase; } /* * getmodulepassword */ char* getmodulepassword(pk11slot...
NSS sources building testing
e library was located in directory mozilla/nsprpub. the subdirectories dbm, security/dbm, security/coreconf, security/nss were part of the nss sources.) the nss directory contains the following important subdirectories: nss/coreconf contains knowledge for cross platform building. nss/lib contains all the library code that is used to create the runtime libraries used by applications. nss/
cmd contains a set of various tool programs that are built using nss. several tools are general purpose and can be used to inspect and manipulate the storage files that software using the nss library creates and modifies. other tools are only used for testing purposes. however, all these tools are good examples of how to write software that makes use of the nss library. nss/test this directory ...
nss tech note7
pkcs #1 v1.5. nss doesn't yet support pkcs #1 v2.0 and v2.1, in particular oaep, but oaep support is on our to-do list. your contribution is welcome. data types nss uses the following data types to represent keys: seckeypublickey: a public key, defined in "keythi.h". seckeyprivatekey: a private key, defined in "keythi.h". pk11symkey: a symmetric key (often called a session key), defined in "se
cmodt.h". these data types should be used as if they were opaque structures, that is, they should only be created by some nss functions and you always pass pointers to these data types to nss functions and never examine the members of these structures. the strength of an rsa key pair is measured by the size of its modulus because given the modulus and public exponent, the best known algorithm fo...
PKCS 7 functions
mxr 3.4 and later sec_pkcs7includecertchain mxr 3.2 and later sec_pkcs7iscontentempty mxr 3.2 and later sec_pkcs7setcontent mxr 3.4 and later sec_pkcs7verifydetachedsignature mxr 3.4 and later sec_pkcs7verifysignature mxr 3.2 and later se
cmime_decryptionallowed mxr 3.4 and later ...
NSS cryptographic module
or the equivalent nsc_getfunctionlist function returns pointers to the functions that implement the default mode of operation. to enable the fips mode of operation, use the function fc_getfunctionlist instead to get pointers to the functions that implement the fips mode of operation. the nss cryptographic module also exports the function nsc_moduledbfunc for managing the nss module database se
cmod.db. the following sections document the data types and functions. pkcs #11 data types pkcs #11 functions in the non-fips (default) mode of operation pkcs #11 functions in the fips mode of operation nsc_moduledbfunc ...
NSS Tools Man Pages - work in progress
certutil certutil pk12util pk12util modutil modutil crlutil crlutil
cmsutil
cmsutil vfychain vfychain vfyserv vfyserv ssltap ssltap this is still a work in progress and in early stages. these man pages where generated from xml docbook files. ...
OLD SSL Reference
ndshake chapter 5 certificate functions this chapter describes the functions and related types used to work with a certificate database such as the cert7.db database provided with communicator. ...
NSS Tools
s. many tools implement private versions of pkcs11init(), opencertdb(), etc. eliminate use of getopt() and replace with nspr calls to get command options (to eliminate platform dependencies with getopt()). tools information tool description links certutil 2.0 manage certificate and key databases (cert7.db and key3.db). source, documentation, tasks/plans
cmsutil 1.0 performs basic
cms operations such as encrypting, decrypting, and signing messages. source, documentation crlutil manage certificate revocation lists (crls). source, documentation, dbck 1.0 analyze and repair certificate databases (not working in nss 3.2) source, tasks/plans modutil 1.1 manage the database of pkcs11 modules (se
cmod.db). ...
NSS Tools certutil
listing certificates in a database this example lists all the certificates in the cert8.db file in the specified directory: certutil -l -d certdir the certificate database tool displays output similar to the following: certificate name trust attributes uptime group plc. class 1 ca c,c, verisign class 1 primary c...
Tutorial: Embedding Rhino
arameter tells initstandardobjects to create and return a scope object that we use in later calls. collecting the arguments this code is standard java and not specific to rhino. it just collects all the arguments and concatenates them together. string s = ""; for (int i=0; i < args.length; i++) { s += args[i]; } evaluating a script the code object result = cx.evaluatestring(scope, s, "<
cmd>", 1, null); uses the context cx to evaluate a string. evaluation of the script looks up variables in scope, and errors will be reported with the filename <
cmd> and line number 1. printing the result the code system.out.println(cx.tostring(result)); prints the result of evaluating the script (contained in the variable result). result could be a string, javascript object, or other values. ...
Rhino optimization
in the source) so that dispatching can be direct, pending runtime confirmation of the actual target. arguments are passed as object/number pairs to reduce conversion overhead. note some language features (indirect calls to eval, use of the arguments property of function objects) were previously not supported in higher optimization levels. these features have been removed from the language in e
cma, so higher optimization levels are now conformant. future versions may allocate more aggressive optimizations to higher optimization levels. for compatibility with future versions, use level 1. for maximal optimization, use level 9, but retest your application when upgrading to new versions. scripts are optimized at compile time, not at execution time. so if a script is compiled with the conte...
The JavaScript Runtime
lean number java.lang.number, that is, any of java.lang.byte, java.lang.short, java.lang.integer, java.lang.float, or java.lang.double. not java.lang.long, since a double representation of a long may lose precision. string java.lang.charsequence (java.lang.string or org.mozilla.javascript.consstring) object org.mozilla.javascript.scriptable in addition, e
cma refers to objects that implement [[call]] as functions. these object types are represented by implementing the function interface. since javascript is a dynamically typed language, the static java type of a javascript value is java.lang.object. the behavior of the javascript engine is undefined if a value of any type other than the ones described above is introduced into javascript. (this cave...
Rhino scopes and contexts
variables defined in the script will end up as properties of the instance scope. uses of standard objects like function, string, or regexp will find the definitions in the shared scope. multiple instance scopes can be defined and have their own variables for scripts yet share the definitions in the shared scope. these multiple instance scopes can be used concurrently. sealed shared scopes the e
cmascript standard defines that scripts can add properties to all standard library objects and in many cases it is also possible to change or delete their properties as well. such behavior may not be suitable with shared scopes since if a script by mistake adds a property to a library object from the shared scope, that object would not be garbage collected until there are no active references to the...
Scripting Java
owerful scripts quickly by making use of the many java libraries available. we can test java classes by writing scripts. we can also aid our java development by using scripting for exploratory programming. exploratory programming is the process of learning about what a library or api can do by writing quick programs that use it. as we will see, scripting makes this process easier. note that the e
cma standard doesn't cover communication with java (or with any external object system for that matter). all the functionality covered in this chapter should thus be considered an extension. accessing java packages and classes every piece of java code is part of a class. every java class is part of a package. in javascript, however, scripts exist outside of any package hierarchy. how then, do we a...
Rhino shell
bad_command: not found js> // passing explicit environment to the system shell js> runcommand("sh", "-c", "echo $env1 $env2", { env: {env1: 100, env2: 200}}) 100 200 0 js> // use args option to provide additional command arguments js> var arg_array = [1, 2, 3, 4]; js> runcommand("echo", { args: arg_array}) 1 2 3 4 0 examples for windows are similar: js> // invoke shell command js> runcommand("
cmd", "/c", "date /t") 27.08.2005 0 js> // run sort collectiong the output js> var opt={input: "c\na\nb", output: 'sort output:\n'} js> runcommand("sort", opt) 0 js> print(opt.output) sort output: a b c js> // invoke notepad and wait until it exits js> runcommand("notepad") 0 ...
Exact Stack Rooting
tradeoffs that these techniques make, however, are quite different. if the extra overhead of exact rooting does end up adding an unacceptable cost to a specific code path that is not mitigated by a faster gc, there are some tricks you can use to get better performance at the cost of more complex code. move js::rootedt declarations above loops. modern c++ compilers are not smart enough to do li
cm on js::rootedt, so forward declaring a single js::rootedt above the loop and re-using it on every iteration can save some cycles. raw pointers. if you are 100% sure that there is no way for spidermonkey to gc while the pointer is on the stack, this is an option. note: spidermonkey can gc because of any error, gc because of timers, gc because we are low on memory, gc because of environment variab...
Invariants
w the rules.) a thread holding a property lock never leaves or suspends the current request. with a few exceptions (known to brendan and probably jst and mrbkap), we never call a jsapi callback with a property locked. (that would risk deadlock too.) name instructions the first operand to a jsop_setname instruction is always produced by a preceding jsop_bindname instruction. (taken together, e
cma 262-3 §11.13.1 and e
cma 262-3 §10.1.4 specify that in an assignment such as x = f(), the name lookup for x occurs before f is called. jsop_bindname performs this lookup.) the rules below (not exactly invariants) govern the bytecode emitted for nameexpressions. background: the fastest instructions for nameexpressions are fat opcodes that combine a load with additional operations, as in jsop_i...
JS::ToBoolean
this article covers features introduced in spidermonkey 17 convert any javascript value to a boolean. syntax bool js::toboolean(js::handlevalue v) name type description v js::handlevalue the value to convert. description js::toboolean converts a javascript value to a boolean. it implements the toboolean operation described in e
cma 262 §7.1.2.this function can not fail and the return value is always the boolean conversion of the argument. mxr id search for js::toboolean bug 749536 ...
JS::ToInt32
ersion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. out int32_t * out parameter. on success, *out receives the converted floating-point value. description js::toint32 converts a javascript value to a signed 32bit integer. it implements the toint32 operator described in e
cma 262-3 §9.5. on success, js::toint32 stores the converted value in *out and returns true. on error or exception, it returns false, and the value left in *out is undefined. see also mxr id search for js::toint32 bug 739541 ...
JS::ToNumber
form the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. out double * out parameter. on success, *out receives the converted floating-point value. description js::tonumber converts a javascript value to a number. it implements the tonumber operator described in e
cma 262-3 §9.3. on success, js::tonumber stores the converted value in *out and returns true. on error or exception, it returns false, and the value left in *out is undefined. see also mxr id search for js::tonumber bug 739541 ...
JS::ToPrimitive
nd @@toprimitive method when converting the object. hint must be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint. do not pass any other type. vp js::mutablehandleobject out parameter. on success, *vp receives the converted value. description js::toprimitive converts a javascript object, obj, to a primitive value using e
cmascript 6 toprimitive. on success, js::toprimitive stores the converted value in *vp and returns true. on error or exception, it returns false, and the value left in *vp is undefined. see also mxr id search for js::toprimitive js::getfirstargumentastypehint js_defaultvalue -- old name of this function bug 1054756 - added ...
JS::ToUint16
on. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. out uint16_t * out parameter. on success, *out receives the converted floating-point value. description js::toint16 converts a javascript value to an unsigned 16bit integer. it implements the toint16 operator described in e
cma 262-3 §9.7. on success, js::toint16 stores the converted value in *out and returns true. on error or exception, it returns false, and the value left in *out is undefined. see also mxr id search for js::touint16 bug 779601 ...
JS::ToUint32
n. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. out int32_t * out parameter. on success, *out receives the converted floating-point value. description js::touint32 converts a javascript value to an unsigned 32bit integer. it implements the touint32 operator described in e
cma 262-3 §9.5. on success, js::touint32 stores the converted value in *out and returns true. on error or exception, it returns false, and the value left in *out is undefined. see also mxr id search for js::touint32 bug 739541 ...
JSClass
nvertop this hook specifies how objects of this class are converted to a primitive value. it implements the object's [[defaultvalue]] hook, which is invoked by javascript when the object must be converted to a string, number, or primitive value. obsolete since jsapi 44 use null or js_convertstub (spidermonkey 31 or older) for default behavior, which is equivalent to that defined by e
cmascript in §8.12.8. finalize jsfinalizeop the object finalizer hook. this is called at some point after the object becomes unreachable, and can be used to free any additional resources associated with the object. if objects of this class do not need finalization, use null. checkaccess jscheckaccessop optional method for access checks. implements js_...
JSConvertOp
be jstype_string or jstype_number to pass the corresponding type as a hint, or jstype_void to pass no hint. other types may be passed as hints, but such behavior is deprecated. vp js::mutablehandlevalue out parameter. on success, *vp receives the converted value. description jsconvertop callback specifies conversion behavior for objects having this class, implementing the e
cmascript [[defaultvalue]] behavior for them. on success it must return a primitive value in *vp. implementations of this hook have historically been required to accept any type. however, the engine itself only requires support for jstype_string, jstype_number, and jstype_void, if js_convertvalue is not used. if you do not use the js_convertvalue method, you may omit support for other types. (suppo...
JSErrorReport
cx), and otherwise should not be reported at all. we check the strictness of the context's top frame's script; where that isn't appropriate, the caller should do the right checks itself instead of using this flag. the constant jsreport_error is 0 and can be used to indicate an error report without any of the above flags. errornumber unsigned the error number. u
cmessage const char16_t * the default unicode error message. messageargs const char16_t ** arguments for the error message. exntype int16_t one of the jsexntype constants. description jserrorreport describes a single error that occurs in the execution of script. in the event of an error, filename will either contain the name of the external source file or ur...
JSExtendedClass.wrappedObject
unwrapped. a wrapper object is strictly equal to the object it wraps, in the sense of === and !==. two wrapper objects that wrap the same object are also strictly equal. object.prototype.eval unwraps. a wrapper object that wraps an array is considered an array for the purpose of array.prototype.concat and array.concat (which treat array arguments differently from other arguments, per e
cma 262-3 §15.4.4.4). the wrappedobject callback implementation must never fail. if it returns null or obj, then the js engine treats the object as though it were not a wrapper. wrapper objects typically have no prototype, do not allow setting __proto__, and inherit properties from the wrapped object rather than the prototype chain (see jsnewresolveop). ...
JSObjectOps.defaultValue
cx jscontext * pointer to the js context in which the conversion is needed. obj jsobject * the object to be converted. type jstype the target type. vp jsval * out parameter. on success, the callback must store the converted value here. description the jsobjectops.defaultvalue callback corresponds to the [[defaultvalue]] method defined in e
cma 262-3 §8.6.2.6. many expressions in the e
cmascript language, such as a+b, involve implicit conversion of the operands using [[defaultvalue]]. the default [[defaultvalue]] behavior for ordinary objects is as described in es5 §8.12.8. it calls the javascript methods obj.valueof() and/or obj.tostring(). provide a custom jsobjectops.defaultvalue callback to implement customized [[defaultvalue]] b...
JSObjectOps.getProperty
setting, the new value is returned in *vp on success. if deleting without error, *vp will be jsval_false if obj[id] is permanent, and jsval_true if id named a direct property of obj that was in fact deleted, or if id names no direct property of obj (id could name a property of a prototype, or no property in obj or its prototype chain). this reflects the quirky behavior of delete as specified in e
cma 262-3 §11.4.1 and e
cma 262-3 §8.6.2.5. ...
JSPropertyOp
the callback returns true. if the property has a stored value, it is then updated to the value left in *vp after the callback. as of spidermonkey 1.7, the value of a property assignment expression, like (a.length = x), is the value of *vp after the setter is called. this is typically the value of the left-hand side after assignment, as opposed to the value of the right-hand side, as required by e
cma 262-3 §11.13. this e
cmascript incompatibility is observable when assigning to the length property of an array, for example. this incompatibility will be fixed in spidermonkey 1.8; see bug 312354. inherited properties. note that in javascript, an object can inherit properties from its prototype. getters (and sometimes setters; see js_setproperty for details) are called even when the property be...
JSTraceOp
js_call*tracer variants on the thing. jstraceop implementation can assume that no other threads mutates object state. it must not change state of the object or corresponding native structures. the only exception for this rule is the case when the embedding needs a tight integration with gc. in that case the embedding can check if the traversal is a part of the marking phase through calling js_isg
cmarkingtracer and apply a special code like emptying caches or marking its native structures. jsclass hooks jsclass offers the following hook: the jsclass.trace callback is called to enumerate all traceable things reachable. see also mxr id search for jstraceop jsclass ...
JS_CompareStrings
res 0 in *result. if str1 is less than str2, *result is less than 0. if str1 is greater than str2, *result is greater than 0. on success the function returns js_true. on error, it returns js_false and the value in result is unchanged. this function imposes a total order on all javascript strings, the same order imposed by the javascript string comparison operators (<, <=, >, >=), as described in e
cma 262-3 § 11.8.5. as the standard says: the comparison of strings uses a simple lexicographic ordering on sequences of code point value values. there is no attempt to use the more complex, semantically oriented definitions of character or string equality and collating order defined in the unicode specification. therefore strings that are canonically equal according to the unicode standard could...
JS_DefineOwnProperty
xt. obj js::handleobject object on which the property should be defined own. id js::handleid the jsid of the property that should be defined. descriptor js::handlevalue this should be an jsval consisting of an object interpretable as property descriptor. bp bool * true if successful. description js_defineownproperty implements the e
cmascript defined function object.defineproperty. so the same restrictions apply as for that function (e.g. it is not possible to change a non-configurable property). descriptor is supposed to be a property descriptor, this means you need to create an object with properties such as value, writable, get or set. see object.defineproperty for a list of possible fields. a getter or setter defined with t...
JS_DeleteElement2
specified element or numeric property, index, from an object, obj. if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement2 stores true to *succeeded and returns true. otherwise it returns false and the value of *succeeded is undefined. notes per the e
cma standard, js_deleteelement2 removes read-only properties from objects as long as they are not also permanent. for javascript 1.2 and earlier, if deletion fails because the property is permanent, js_deleteelement2 reports the error and returns false. for javascript 1.3, the attempt is silently ignored. in both these cases, *succeeded will receive the stored value of the property that was not del...
JS_DoubleToInt32
obsolete since jsapi 38this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this article covers features introduced in spidermonkey 17 convert a c floating-point number of type double to 32-bit integer per e
cma spec. syntax int32_t js_doubletoint32(double d); uint32_t js_doubletouint32(double d); name type description d double the numeric value to convert. description js_doubletoint32 converts a c floating-point number of type double...
JS_ExecuteScript
ntext in which to execute the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the scope in which to execute the script. in the simplest cases, this should just be the embedding's global object. obsolete since jsapi 39 obj must not be an array, an e4x xml object, a with object, or a proxy. in e
cmascript terms, the script is executed in a new execution context, but that context is not initialized quite as described in any of the three cases in e
cma 262-3 §10.2. instead: the scope chain is initialized to contain obj, followed by its parent, then its parent's parent, etc. until null is reached. variable initialization is performed. if the jsoption_varobjfix option is in effe...
JS_ExecuteScriptVersion
cx jscontext * the context in which to execute the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the scope in which to execute the script. in the simplest cases, this should just be the embedding's global object. obj must not be an array, an e4x xml object, a with object, or a proxy. in e
cmascript terms, the script is executed in a new execution context, but that context is not initialized quite as described in any of the three cases in e
cma 262-3 §10.2. instead: the scope chain is initialized to contain obj, followed by its parent, then its parent's parent, etc. until null is reached. variable initialization is performed. if the jsoption_varobjfix option is in effe...
JS_GetFunctionArity
number of formal parameters of a function, fun. this is the same as the function object's arity property, if that property has not been overwritten. specifically, if fun is a native function, the result is the value that was passed to the nargs parameter of js_definefunction. otherwise fun is implemented in javascript, and the result is the number of identifiers in its formal parameter list (see e
cma 262-3 §13). note that it is not an error per se to call a javascript function with more or fewer actual arguments than its arity. see also mxr id search for js_getfunctionarity js_definefunction ...
JS_GetFunctionFlags
nnot be modified. jsfun_generic_native the function is an array generic, such as array.map. jsfun_heavyweight the function uses language features such as closures, with, or eval that require extra work on the part of the interpreter. jsfun_lambda the function is a javascript function written as a functionexpression rather than a functiondeclaration, a syntactic distinction. see e
cma 262-3 §13. jsfun_constructor the function is native can be used as a constructor with the new keyword. (the meaning of this flag may change.) see also bug 807228 ...
JS_GetGCParameter
ency_heap_growth_min / "highfrequencyheapgrowthmin" jsgc_low_frequency_heap_growth / "lowfrequencyheapgrowth" heap growth percentage for low frequency gcs. jsgc_dynamic_heap_growth / "dynamicheapgrowth" if false, the heap growth percentage is fixed at 300%. if true, it is determined based on whether gcs are high- or low- frequency. jsgc_dynamic_mark_slice / "dynami
cmarkslice" if true, high-frequency gcs will use a longer mark slice. jsgc_allocation_threshold / "allocationthreshold" lower limit after which we limit the heap growth. the heap will be collected if it is greater than: max(allocthreshold, lastsize) * thresholdfactor, this establishes allocthreshold as a baseline or default heap size. jsgc_allocation_threshold_factor / "alloc...
JS_GetGlobalForObject
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * a non-null jsobject. description js_getglobalforobject returns the last non-null object on the parent chain of the input object. for function object inputs, the result is "the global object" as referred to in the e
cmascript specification. for example, if the function refers to a global variable foo, then foo is a property of the object returned by js_getglobalforobject. see also mxr id search for js_getglobalforobject ...
JS_GetParent
e global object as their parent. objects created by standard library functions, such as array.prototype.concat, have the global object as their parent. an object created by a script via the new keyword has the same parent as the constructor. for example, after d = new date, d has the same parent as date, ordinarily the global object. an object created by a script via implicit conversion (the e
cmascript toobject operator), an object initializer ({a: 1, b: 2}), or an array initializer ([1, 2, 3]), has the global object as its parent. the parent of a function created by evaluating a function declaration or function expression in a script depends on the lexical scope of the function. if there is no enclosing function, with statement, or block scope, then the function's parent is the global...
JS_GetScopeChain
ion to retrieve the scope chain's global, then you can use the function js_getglobalforscopechain. syntax jsobject * js_getscopechain(jscontext *cx); name type description cx jscontext * the context to query. description js_getscopechain returns the first jsobject on the scope chain for the javascript code currently running in the given context, cx. the e
cmascript standard, e
cma 262-3 §10, describes execution contexts and scope chains. a scope chain is a sequence of objects whose properties are searched whenever a script or function refers to a variable. these objects represent the lexical scope of the currently executing statement or expression, not the call stack, so they include: the variable objects of any enclosing functions or let statemen...
JS_LookupElement
stored value of obj[index], or undefined if the element does not exist. description js_lookupelement examines a specified javascript object, obj, for a numeric property numbered index. note: in the javascript language, numeric properties (also called "elements") are just ordinary properties whose names are numeric strings. for example, obj[6] is always exactly the same as obj["6"]. the e
cmascript standard also specifies this behavior: see e
cma 262-3 §11.2.1, step 6. so any call to js_lookupelement is equivalent to a call to js_lookupproperty passing a numeric string for the name. if the property obj[index] exists, js_lookupelement sets *vp to the property's stored value and returns true. if no such property exists, js_lookupelement sets *vp to undefined and returns true (to indic...
JS_LooselyEqual
ich to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v1, v2 js::handle<js::value> the value to compare. equal bool * out parameter. receives the comparison result. description js_looselyequal determines if v1 is loosely equal to v2 under the javascript == operator, as specified in e
cma 262-3 §11.9.3. if the comparison attempt was successful, the method returns js_true and stores the result in *equal; otherwise it returns js_false. comparing jsvals directly in c++, as in v1 == v2, does not produce a meaningful result, since it is possible for two distinct jsstrings or jsdoubles to represent the same string or number. see also mxr id search for js_looselyequal js_strictly...
JS_New
added in spidermonkey 38 argc unsigned the number of arguments to pass to the constructor. obsolete since jsapi 32 argv jsval * pointer to the element 0 of an array of argument values to pass to the constructor. if argc is 0, this may be null. obsolete since jsapi 32 description js_new creates a new object as though by using the new operator, as described in e
cma 262-3 §11.2.2. js_new(cx, ctor, args) is equivalent to the javascript expression new ctor(...args), and js_new(cx, ctor, argc, argv) is equivalent to the javascript expression new ctor(argv[0], argv[1], ... argv[argc-1]). if ctor is not an object that can be used as a constructor, a typeerror is raised. on success, js_new returns a pointer to the new object. on error, it returns null. see al...
JS_NewObject
s as a default parent. if the context is not currently executing any code, we use js_getglobalobject to find a global object associated with the context. next, we must find the given class's constructor in that global object. normally we simply use the class's name as the name of the property of the global object to fetch. however, although javascript code can freely redefine constructors, the e
cmascript standard requires us in certain cases to use the original constructors' prototypes. if the global object's class's flags include jsclass_global_flags, then the global object always retains the original constructors for each standard class; we use these original constructors when they are available. finally, we must find a prototype. if the constructor has a prototype property, we use it...
JS_SameValue
samevalue slightly differs from strict equality (===) in that +0 and -0 are not the same and in that nan is the same as nan. ...
JS_SealObject
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. as of spidermonkey 1.8.5, js_sealobject has been removed from the jsapi, because e
cmascript 5 includes a "seal" concept (namely, that of object.seal) which is quite different from that of js_sealobject. moreover, js_sealobject's exact semantics are subtly incompatible with e
cmascript. js_freezeobject and js_deepfreezeobject are near-substitutes compatible with e
cmascript semantics, implementing semantics compatible with those of object.freeze. prevent modification of object fields. syntax jsbool js_sealobject(jscontext *cx, jsobject *obj, jsbool deep); name type description ...
JS_SetCallReturnValue2
obsolete since javascript 1.8.5this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. causes a native to return a reference value (as allowed by e
cma 262-3 §11.2.3). syntax void js_setcallreturnvalue2(jscontext *cx, jsval v); name type description cx jscontext * the context in which the native function is running. v jsval the id of the property of the reference value to be returned from the native. descr...
JS_SetGlobalObject
this function is obsolete; see also js_getglobalobject. js_setglobalobject sets the global object of the context cx to obj. if obj is null, the context is set to have no global object. each context's global object is in the garbage collector's root set. this means that global objects are automatically protected from garbage collection, as are any values reachable from their properties. for full e
cmascript standard compliance, obj should be of a jsclass that has the jsclass_global_flags flag. applications typically set a context's global object using js_initstandardclasses instead. see the sample code at jsapi user guide. see also js_getglobalobject bug 899245 ...
JS_StrictlyEqual
orm the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v1, v2 js::handle<js::value> / jsval the value to compare. equal bool * out parameter. receives the comparison result. description js_strictlyequal determines if v1 is strictly equal to v2 under the javascript === operator, as specified in e
cma 262-3 §11.9.6. if the comparison attempt was successful, the method returns true and stores the result in *equal; otherwise it returns false. comparing jsvals directly in c++, as in v1 == v2, does not produce a meaningful result, since it is possible for two distinct jsstrings or jsdoubles to represent the same string or number. see also mxr id search for js_strictlyequal js_looselyequal ...
JS_ValueToBoolean
conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert. bp jsbool * out parameter. on success, *bp receives the converted boolean value. description js_valuetoboolean converts a specified javascript value, v, to a boolean value. it implements the toboolean operator specified in e
cma 262-3 §9.2. on success, js_valuetoboolean stores the converted value in *bp and returns js_true. on error or exception, it returns js_false, and the value left in *bp is undefined. for versions greater than jsversion_1_2, all objects convert to js_true, even boolean wrapper objects like the one produced by new boolean(false). this is the behavior specified in e
cma 262-3 §9.2. see related disc...
JS_ValueToString
name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert. description js_valuetostring converts a specified javascript value, v, to a string. it implements the tostring operator specified in e
cma 262-3 §9.8. the result is like the javascript expression ""+v. if v is already a string, conversion succeeds. if v is true, false, null, or undefined, conversion succeeds, and the result is the string "true", "false", "null", or "undefined", accordingly. if v is a number, conversion succeeds, and the result is a string representation of that number as specified in e
cma 262-3 §9.8.1. this ...
jschar
ers, its use is discouraged since it could be removed at any time. try to avoid using it. jschar is the type of javascript "characters", the 16-bit elements that make up strings. jschar, a typedef for the standard c++ type char16_t, will be removed in jsapi 38. functions that use jschar will use char16_t directly. embedder code should use char16_t, too. (see bug 1063962.) as required by the e
cmascript standard, e
cma 262-3 §4.3.16", javascript strings are arbitrary sequences of 16-bit values. a string may contain unmatched surrogates, which are not valid utf-16. it may also contain zeroes ('\0'). to get the characters of a javascript string, use js_getstringchars. see also bug 1063962 ...
jsdouble
since firefox/gecko 13 jsdouble has been removed, and instead it is possible to use the default c/c++ type double. you should be able to just replace every usage of jsdouble with double in your code. jsdouble is a c floating-point number type. it is defined to be a 64-bit, ieee 754 compliant type. see e
cma 262-3 §8.5. arithmetic on jsdouble values in c should behave exactly like the floating-point arithmetic in javascript, except that c and javascript may treat not-a-number values differently. implementation note: spidermonkey has had several bugs involving details of floating-point arithmetic on various platforms. controlling the behavior of floating-point arithmetic is very architecture- and system-specific, and can be hard to get right. help in the form of test cases, comment...
SpiderMonkey 1.8
with spidermonkey 1.7 though, which means you can probably just recompile and relink your application. a handful of changes are not backwards-compatible: the result of assigning to a property with a setter has changed (bug 312354). in javascript 1.7 and earlier, x = [].length = "7"; would store the number 7 in x. now this statement stores the string "7" in x. the new behavior conforms to the e
cmascript standard, e
cma 262-3 §11.13.1. 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 ...
SpiderMonkey 24
t code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 24 spidermonkey now provides a fully c++ interface, so embedders relying on embeddability in c projects will have to convert to c++, or implement their own adapter code. the following features in earlier versions of spidermonkey have been dropped. e4x, an extension to e
cmascript adding xml support, has been removed. the extension eventually became an evolutionary dead end, as tc39 chose not to incorporate it into e
cmascript proper. it is recommended that you embed a separate xml parser, or include an xml parsing implementation written in javascript, as an alternative. jaegermonkey has been removed and replaced by ionmonkey spidermonkey 24 is not binary-compat...
SpiderMonkey 31
vertarguments "j" type deleted apis js_newgrowablestring (can be replaced with js_newucstring) js_isconstructing (can be replaced with callargs::isconstructing or callreceiver::isconstructing) js_valuetoboolean (replaced by js::toboolean) js_valuetonumber (can be replaced with js::tonumber) js_valuetoint64 (replaced by js::toint64) js_valuetouint64 (replaced by js::touint64) js_valuetoe
cmauint32 (replaced by js::touint32) js_valuetoe
cmaint32 (replaced by js::toint32) js_valuetoint32 (can be replaced with js::toint32, which has a different behavior!) js_valuetouint16 (replaced by js::touint16) js_valuetostring (replaced by js::tostring) js_definepropertywithtinyid js_defineucpropertywithtinyid js_getobjectid api changes spidermonkey must now be initialized before it can b...
SpiderMonkey 38
char16_t, has been removed. jsapi functions that used jschar now use char16_t directly. embedder code should use char16_t, too. (see bug 1063962.) js_preventextensions now indicates its success or failure in two ways: via return value (as with most jsapi methods), and via outparam (indicating whether the attempt took effect or not, independent of jsapi failure). this change better aligns with e
cmascript's [[preventextensions]] hook, which generally returns true or false to indicate whether subsequent attempts to add a new property will fail, yet also itself may throw in some cases. javascript shell changes detail added/removed methods here... known issues detail any known issues here... future direction ...insert details on future plans... spidermonkey embedders should be aware tha...
SpiderMonkey 45
ing renamed to js_atomizeandpinjsstring (bug 1178581) js_internstringn renamed to js_atomizeandpinstringn (bug 1178581) js_internstring renamed to js_atomizeandpinstring (bug 1178581) js_internucstringn renamed to js_atomizeandpinucstringn (bug 1178581) js_internucstring renamed to js_atomizeandpinucstring (bug 1178581) deleted apis js_getcompartmentstats js_seticumemoryfunctions js_isg
cmarkingtracer js_ismarkinggray js_idarraylength js_idarrayget js_destroyidarray js_defaultvalue js_getparent js_setparent js::parsepropertydescriptorobject js_deleteproperty2 js_deletepropertybyid2 js_deleteucproperty2 js_deleteelement2 js_newfunctionbyid js_bindcallable js_decompilefunctionbody js_getlatin1internedstringchars js_gettwobyteinternedstringchars js_newdateobjectmsec ...
Shell global objects
collecting. gcparam(name [, value]) wrapper for js_[gs]etgcparameter. the name is one of: maxbytes maxmallocbytes gcbytes gcnumber mode unusedchunks totalchunks slicetimebudget markstacklimit highfrequencytimelimit highfrequencylowlimit highfrequencyhighlimit highfrequencyheapgrowthmax highfrequencyheapgrowthmin lowfrequencyheapgrowth dynamicheapgrowth dynami
cmarkslice allocationthreshold minemptychunkcount maxemptychunkcount compactingenabled refreshframeslicesenabled relazifyfunctions(...) perform a gc and allow relazification of functions. accepts the same arguments as gc(). getbuildconfiguration() return an object describing some of the configuration options spidermonkey was built with. haschild(parent, child) return true if chil...
Secure Development Guidelines
xss: example the following snippet of javascript: document.write("welcome to " + document.location); ... is exploitable (in some browsers) with a simple request such as: http://www.victim.com?something=<script>alert('oops')</script> xss: prevention escape all dynamic input that will be sent back to the user html encoding & → & < → < > ...
Starting WebLock
al-case duplicates here urlnode* node = (urlnode*) malloc(sizeof(urlnode)); node->urlstring = strdup(url); node->next = mrooturlnode; mrooturlnode = node; return ns_ok; } /* void removesite (in string url); */ ns_imethodimp weblock::removesite(const char *url) { // find our entry. urlnode* node = mrooturlnode; urlnode* prev = nsnull; while (node) // test this! { if (str
cmp(node->urlstring, url) == 0) { free(node->urlstring); if (prev) prev->next = node->next; free(node); return ns_ok; } prev = node; node = node->next; } return ns_error_failure; } setsites the purpose of setsites is to allow clients to pass an enumeration, or set, of url strings to add to the white list of urls. setsites uses an nsisimpleenume...
Using components
was already stated, it is common to start addon scripts like: var cc = components.classes; var ci = components.interfaces; there is also another way to start, which is exactly equivalent to the above. var {cc: classes, ci: interfaces} = components; there are many more than just classes and interfaces. var { cu: utils, ci: interfaces, cc: classes, cr: results, cs: stack,
cm: manager, ce: exception, } = components; here is a full breakdown of what is contained in components. any of the below can be accessed by components.blah (ie: components.issuccesscode) utils=[object nsxpccomponents_utils] interfaces=[object nsxpccomponents_interfaces] classes=[object nsxpccomponents_classes] results=[object nsxpccomponents_results] issuccesscode=function issuccesscode() { [n...
jsdIStackFrame
private data for this object is an nsisupports object. attempting to alter this bit will result in an ns_error_illegal_value. ...
nsIClipboardDragDropHooks
nt area and editors. use this to do things such as prevent a drag from starting, adding or removing data and flavors, or preventing the drop. inherits from: nsisupports last changed in gecko 1.7 embedders who want to have these hooks made available should implement nsiclipboarddragdrophooks and use the command manager to send the appropriate commands with these parameters/settings: command:
cmd_clipboarddragdrophook params value type possible values "addhook" isupports nsiclipboarddragdrophooks as nsisupports "removehook" isupports nsiclipboarddragdrophooks as nsisupports note: overrides/hooks need to be added to each window (as appropriate). adding them to the first window does not enable them for every window. if more than one implementation is set for a window...
nsIContentFrameMessageManager
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisyn
cmessagesender this interface provides the environment for scripts that are loaded into content frames using the nsiframescriptloader interface. it enables these scripts to receive messages from the chrome process and send messages back to the chrome process. frame scripts can send either synchronous or asynchronous messages to the chrome process: for details on these messaging apis see the documentation for the nsicontentframemessagemanager's parent classes nsisyn
cmessagesender and nsimessagesender. methods void dump(in domstring astr); domstring atob(in domstring aasciistring); domstring btoa(in domstring abase64data); dump() prints the specified string to ...
getFile
rt" same thing as ns_os_desktop_dir ns_win_desktop_directory "deskp" file sys dir which physically stores objects on desktop ns_win_drives_dir "drivs" ns_win_network_dir "netw" ns_win_nethood_dir "neth" ns_win_fonts_dir "fnts" ns_win_templates_dir "tmpls" ns_win_common_startmenu_dir "
cmstrt" ns_win_common_programs_dir "
cmprgs" ns_win_common_startup_dir "
cmstrt" ns_win_common_desktop_directory "
cmdeskp" ns_win_appdata_dir "appdata" ns_win_local_appdata_dir "localappdata" ns_win_printhood "prnthd" ns_win_cookies_dir "cookd" available on unix only these ...
nsIMessageBroadcaster
ve a single "other side" that they send messages to, but rather a set of subordinate message managers. for example, broadcasting a message through a window message manager will broadcast the message to all frame message managers within its window. see message manager interfaces for more details on the distinction between message senders and message broadcasters. methods void broadcastasyn
cmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects); nsimessagelistenermanager getchildat(in unsigned long aindex); broadcastasyn
cmessage() like sendasyn
cmessage(), but also broadcasts this message to all "child" message managers of this message manager. see nsimessagelistener::receivemes...
nsIMessageListenerManager
1.0 66 introduced gecko 17 inherits from: nsisupports last changed in gecko 41 (firefox 41 / thunderbird 41 / seamonkey 2.38) implemented by: @mozilla.org/globalmessagemanager;1. ...
nsIMessageSender
onous messages to a single "other side". for example, a child-process message manager will send messages that are only delivered to its one parent-process message manager. to send messages to multiple "other sides", you would use nsimessagebroadcaster. see message manager interfaces for more details on the distinction between message senders and message broadcasters. methods void sendasyn
cmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); sendasyn
cmessage() send messagename and obj to the "other side" of this message manager. this invokes listeners who registered for messagename using a nsimessagelistenermanager. ...
nsIPromptService
s/2, the buttons are centred in the order 0, 2, 1. constant value description button_pos_0 1 this is usually the button used to confirm the prompt. it typically has the label "ok", "yes", or "save". button_pos_1 256 this is the button used to cancel the prompt. it typically has the label "cancel" or "no". it is equivalent to pressing the escape key (or
cmd+. on the mac), or closing the window through the os controls. button_pos_2 65536 this button can be used to give the user a choice of options, but still allowing the user to cancel the prompt. for instance, it might have the label "don't save". button title flags these flags are used along with button position flags to set the labels of buttons in the prompt. consta...
XPCOM Interface Reference
esnsisupportsarraynsisupportscstringnsisupportscharnsisupportsdoublensisupportsfloatnsisupportsidnsisupportsinterfacepointernsisupportsprboolnsisupportsprint16nsisupportsprint32nsisupportsprint64nsisupportsprtimensisupportspruint8nsisupportspruint16nsisupportspruint32nsisupportspruint64nsisupportsprimitivensisupportsprioritynsisupportsstringnsisupportsvoidnsisupportsweakreferencensisyncjpakensisyn
cmessagesendernsitxttohtmlconvnsitaggingservicensitaskbarpreviewnsitaskbarpreviewbuttonnsitaskbarpreviewcontrollernsitaskbarprogressnsitaskbartabpreviewnsitaskbarwindowpreviewnsitelemetrynsitextinputprocessornsitextinputprocessorcallbacknsitextinputprocessornotificationnsithreadnsithreadeventfilternsithreadinternalnsithreadmanagernsithreadobservernsithreadpoolnsithreadpoollistenernsitimernsitimercal...
XPCOM Interface Reference by grouping
cessibleeditabletext nsiaccessibleevent nsiaccessiblehyperlink nsiaccessiblehypertext nsiaccessibleimage nsiaccessibleprovider nsiaccessibleretrieval nsiaccessiblerole nsiaccessiblescrolltype nsiaccessibleselectable nsiaccessiblestates nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessiblevalue nsiaccessnode nsisyn
cmessagesender script nsiscriptableunescapehtml nsiscriptableunicodeconverter nsiscripterror nsiscripterror2 stylesheet nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomxpathevaluator nsidomxpathexception nsidomxpathexpression nsidomxpathresult xslt nsixsltexception nsixsltprocessor ...
nsMsgViewCommandType
ages 14 move the selected messages. use with nsimsgdbview.docommandwithfolder() to select the destination folder. selectall 15 select all messages. downloadselectedforoffline 16 download the selected messages for offline. downloadflaggedforoffline 17 download all flagged messages for offline. selectthread 18 select the entire thread. selectflagged 19 select all flagged messages.
cmdrequiringmsgbody 20 used with nsimsgdbview.getcommandstatus() to determine if commands requiring the message body (i.e. reload or print preview) are available. label0 21 attach a label to the selected messages. label1 22 attach a label to the selected messages. label2 23 attach a label to the selected messages. label3 24 attach a label to the selected messages. label4 25 attach a ...
XPCOM reference
erbird threadpane. this interface isn't ever implemented. it is only used to store constants. for example to sort by date you would pass a function the value:nsmsgviewtypethe nsmsgviewtype interface contains constants used for views in thunderbird. this interface isn't ever implemented. it is only used to store constants. ...
Storage
tabase sqlite is very good about maintaining database integrity, but there are a few things you can do that can lead to database corruption. you can find out more by reading sqlite's documentation on this. these are a few simple things you can avoid to help make sure this doesn't happen: open more than one connection to the same file with names that aren't exactly the same as determined by str
cmp. this includes "my.db" and "../dir/my.db" or, on windows (case-insensitive) "my.db" and "my.db". sqlite tries to handle many of these cases, but you shouldn't count on it. access a database from a symbolic or hard link. access a statement from more than one thread (discussed in thread safety). call mozistorageservice.backupdatabasefile() on a locked database, assuming this will leave...
Finding the code for a feature
ion). the second is mozilla's source code search tool mxr. i keep two prominent links to this on my firefox toolbar, one to comm-central string search, and one to comm-central file search. so, how did i use those to figure out how to do this? i know there is a menu command "tag" to tag the message - how does it do it? using dom inspector, i find the tag menu item, and i see that it uses command "
cmd_tag". then i use mxr and look for "
cmd_tag". i see it occurs in mail3panewindowcommands.js a couple of times. i look at the last occurrence, and see it is just an enable item with no real action involved. oops, i guess i need to get the submenu instead. repeating this process, i see that the submenu items all call a function togglemessagetagmenu. looking that up in mxr, its underlying function u...
Mozilla
also the style techtalk for more complete although less detailed documentation. mozilla svg project since you have come this far, you probably already know that svg stands for scalable vector graphics, and that it is an xml language for sophisticated 2-dimensional graphics. svg is to graphics what xhtml is to text, mathml is to mathematical equations and
cml is to the description of chemical molecules. mozilla technologies mozilla has several technologies used as components of its projects. these are documented here. mozilla web developer faq this document answers questions that web authors ask frequently specifically in connection with firefox and other gecko-based browsers. there are l...
Introduction to DOM Inspector - Firefox Developer Tools
dom inspector is standalone; it supports all toolkit applications, and it's possible to embed it in your own xulrunner app. dom inspector can serve as a sanity check to verify the state of the dom, or it can be used to manipulate the dom by hand, if desired. ...
Browser Toolbox - Firefox Developer Tools
this, open the developer tools settings, go to the section "advanced settings", and check the settings "enable browser chrome and add-on debugging toolboxes" and "enable remote debugging". opening the browser toolbox open the browser toolbox through the menu button and the menu items "developer" then "browser toolbox". you can also open it with the ctrl + alt +shift + i key combination (
cmd + opt +shift + i on a mac). you will be presented with a dialog like this (it can be removed by setting the devtools.debugger.prompt-connection property to false): click ok, and the browser toolbox will open in its own window: you'll be able to inspect the browser's chrome windows and see, and be able to debug, all the javascript files loaded by the browser itself and by any add-ons that are ...
Search - Firefox Developer Tools
ions with load in their name are shown. this feature may not seem terribly useful when searching a file with a handful of functions in it but when you are searching through a file with dozens of functions, it comes in handy. searching in all files you can also search for a string in all of the files included in the currently opened project. press shift + ctrl + f (windows and linux) or shift +
cmd + f (macos) and then enter the string you are trying to find. if the string exists in any of the files in the project, the search will return a list showing a list by file and line number. click on any entry in the list to go directly to the line in the file where the string occurs. ...
Debugger.Source - Firefox Developer Tools
s not differ, no such emphasized headings will appear. accessor properties of the debugger.source prototype object a debugger.source instance inherits the following accessor properties from its prototype: text if the instance refers to javascript source, the javascript source code, as a string. the value satisfies the program, functiondeclaration, or functionexpression productions in the e
cmascript standard. if the instance refers to webassembly code, the serialized text representation. the format is yet to be specified in the webassembly standard. currently, the text is an s-expression based syntax. the text generation is disabled if the debugger has the allowwasmbinarysource property set, the "[wasm]" value will be returned in this case. binary if the instance refers to webas...
Migrating from Firebug - Firefox Developer Tools
n the same tab, it closes automatically. the devtools' activation on the other hand is tab based. that means, that when you open the devtools in a tab, they stay open even when you switch between different websites. when you switch to another tab, though, they're closed. open the tools firebug can be opened by pressing f12. to open it to inspect an element it is possible to press ctrl+shift+c /
cmd+opt+c. the devtools share the same shortcuts, but also provide shortcuts for the different panels. e.g. the network monitor can be opened via ctrl+shift+q /
cmd+opt+q, the web console via ctrl+shift+k /
cmd+opt+k and the debugger via ctrl+shift+s /
cmd+opt+s. web console the web console is the equivalent of firebug's console panel. it shows log information associated with a web page and allows...
Network request list - Firefox Developer Tools
egexp bracketed within slashes; "/.+corp.*/" will look for any occurrence of "corp" which has at least one character before it and may or may not have any characters after it, for example). the third-party add-on websocket sniffer may be helpful as well. url use the filter urls box in the toolbar. you can focus it by clicking in the filter box, or by pressing ctrl + f (or
cmd + f on a mac); then start typing. the list of network requests is filtered to include only requests that contain your filter string, in either the domain or the file portions. you can filter requests that don't contain your filter string by prefixing your query with the "-" operator. for example, the query "-google.com" will show all requests that don't have "google.com" in the url. ...
Responsive Design Mode - Firefox Developer Tools
ling responsive design mode there are three ways to toggle responsive design mode: from the firefox menu: select responsive design mode from the web developer submenu in the firefox menu (or tools menu if you display the menu bar or are on macos). from the developer tools toolbox: press the responsive design mode button in the toolbox's toolbar: from the keyboard: press ctrl + shift + m (or
cmd + opt + m on macos). controlling responsive design mode with responsive design mode enabled, the content area for web pages is set to the screen size for a mobile device. initially, it's set to 320 x 480 pixels. note: the device you select when in responsive design mode and the orientation (portrait or landscape) is saved between sessions. information for the selected device is centered...
Storage Inspector - Firefox Developer Tools
you can hide and show columns by context-clicking on the table header and selecting the columns you want to see: search there's a search box at the top of the table widget: this filters the table to show only items which match the search term. items match the search term if any of their fields (including fields whose columns you have hidden) contain the search term. you can use ctrl + f (
cmd + f on a mac) to focus the search box. add and refresh storage you'll also have buttons available to add a new storage entry or refresh the view of the currently viewed storage type where applicable (you can't add new entries to indexeddb or cache): sidebar when you select any row in the storage table widget, the sidebar is shown with details about that row. if a cookie is selected, it wil...
View Source - Firefox Developer Tools
view source features view source has three additional features, which can be accessed from the context menu in the view source tab: go to line scrolls to the specified line. if the number is higher than the lines in a file, you receive an error message. ...
Web Console UI Tour - Firefox Developer Tools
r to submit it. message display pane this is where the messages appear, both those generated by the code in the page, and those generated by the commands entered on the command line. see console messages for a lot more detail on what the messages can contain. note: you can clear the contents of the console by entering the keyboard command ctrl + shift + l (windows, macos, and linux) or
cmd + k on macos. command line the command line starts with double angle brackets (>>). use it to enter javascript expressions. in firefox 71 onwards, there is a new "split pane" icon on the right hand side of the command line — clicking this will open the new console multi-line mode. ...
Firefox Developer Tools
getting started with web development and using developer tools, our learning docs will help you — see getting started with the web and what are browser developer tools? for good starting points. the core tools you can open the firefox developer tools from the menu by selecting tools > web developer > toggle tools or use the keyboard shortcut ctrl + shift + i or f12 on windows and linux, or
cmd + opt + i on macos. the ellipsis menu on the right-hand side of developer tools contains several commands that let you perform actions or change tool settings. this button only appears when there are multiple iframes on a page. click it to display a list of the iframes on the current page and select the one with which you want to work. click this button to take a sc...
AudioBuffer.duration - Web APIs
syntax var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); myarraybuffer.duration; value a double. ...
AudioBuffer.getChannelData() - Web APIs
syntax var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); var nowbuffering = myarraybuffer.getchanneldata(channel); parameters channel the channel property is an index representing the particular channel to get data for. an index value of 0 represents the first channel. if the channel index value is greater than of equal to audiobuffer.numberofchannels, an index_size_err exception will be thrown. return value a float32array. ...
AudioBuffer.length - Web APIs
syntax var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); myarraybuffer.length; value an integer. ...
AudioBuffer.sampleRate - Web APIs
syntax var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); myarraybuffer.samplerate; value a floating-point value indicating the current sample rate of the buffers data, in samples per second. ...
CSSNumericValue.add() - Web APIs
thod of the cssnumericvalue interface adds a supplied number to the cssnumericvalue. syntax var cssmathsum = cssnumericvalue.add(double | cssnumericvalue); parameters number either a number or a cssnumericvalue. return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method. examples let mathsum = css.px("23").add(css.percent("4")).add(css.
cm("3")).add(css.in("9")); // prints "calc(23px + 4% + 3
cm + 9in)" console.log(mathsum.tostring()); specifications specification status comment css typed om level 1the definition of 'add' in that specification. working draft initial definition. ...
CSSNumericValue.equals() - Web APIs
g examples illustrate what happens when they are not. let cssmathsum = new cssmathsum(css.px(1), css.px(2)); let matchingcssmathsum = new cssmathsum(css.px(1), css.px(2)); // prints true console.log(cssmathsum.equals(matchingcssmathsum)); let othercssmathsum = cssmathsum(css.px(2), css.px(1)); // prints false console.log(cssmathsum.equals(othercssmathsum)); // also prints false console.log(css.
cm("1").equal(css.in("0.393701"))); specifications specification status comment css typed om level 1the definition of 'equals' in that specification. working draft initial definition. ...
CSSNumericValue.max() - Web APIs
itvalue = cssnumericvalue.man(number1 ... numbern); parameters number either a number or a cssnumericvalue. return value a cssunitvalue. exceptions typeerror indicates that an invalid type was passed to the method. examples as stated earlier, all passed values must be of the same type and value. some of the following examples illustrate what happens when they are not. // prints "2
cm" console.log(css.
cm("1").max(css.
cm("2")).tostring()); // prints "max(1
cm, 0.393701in)" console.log(css.
cm("1").max(css.in("0.393701")).tostring()); specifications specification status comment css typed om level 1the definition of 'max' in that specification. working draft initial definition. ...
CSSNumericValue.min() - Web APIs
itvalue = cssnumericvalue.min(number1 ... numbern); parameters number either a number or a cssnumericvalue. return value a cssunitvalue. exceptions typeerror indicates that an invalid type was passed to the method. examples as stated earlier, all passed values must be of the same type and value. some of the following examples illustrate what happens when they are not. // prints "1
cm" console.log(css.
cm("1").min(css.
cm("2")).tostring()); // prints "max(1
cm, 0.393701in)" console.log(css.
cm("1").max(css.in("0.393701")).tostring()); specifications specification status comment css typed om level 1the definition of 'min' in that specification. working draft initial definition. ...
CSSNumericValue.mul() - Web APIs
method of the cssnumericvalue interface multiplies the cssnumericvalue by the supplied value. syntax var cssmathproduct = cssnumericvalue.mul(number); parameters number either a number or a cssnumericvalue. return value a cssmathproduct exceptions typeerror indicates that an invalid type was passed to the method. examples let mathsum = css.px("23").mul(css.percent("4")).mul(css.
cm("3")).mul(css.in("9")); // prints "calc(23px * 4% * 3
cm * 9in)" console.log(mathsum.tostring()); specifications specification status comment css typed om level 1the definition of 'mul' in that specification. working draft initial definition. ...
CSSNumericValue.sub() - Web APIs
the sub() method of the cssnumericvalue interface subtracts a supplied number from the cssnumericvalue. syntax var cssmathsum = cssnumericvalue.sub(number); parameters number either a number or a cssmathsum. return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method. examples let mathsum = css.px("23").sum(css.percent("4")).sum(css.
cm("3")).sum(css.in("9")); // prints "calc(23px - 4% - 3
cm - 9in)" console.log(mathsum.tostring()); and/or include a list of links to useful code samples that live elsewhere: specifications specification status comment css typed om level 1the definition of 'sub' in that specification. working draft initial definition. ...
CSSNumericValue.sum() - Web APIs
the sub() method of the cssnumericvalue interface subtracts a supplied number from the cssnumericvalue. syntax var cssmathsum = cssnumericvalue.sub(number); parameters number either a number or a cssmathsum return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method. examples let mathsum = css.px("23").sum(css.percent("4")).sum(css.
cm("3")).sum(css.in("9")); // prints "calc(23px - 4% - 3
cm - 9in)" console.log(mathsum.tostring()); and/or include a list of links to useful code samples that live elsewhere: specifications specification status comment css typed om level 1the definition of 'sub' in that specification. working draft initial definition. ...
CSSNumericValue.to() - Web APIs
ssnumericvalue interface converts a numberic value from one unit to another. syntax var cssunitvalue = cssnumericvalue.to(unit); parameters unit the unit to which you want to convert. return value a cssmathsum. exceptions syntaxerror indicates that an invalid type was passed to the method. typeerror indicates that the passed values cannot be summed. examples // prints "0.608542
cm" console.log(css.px("23").to("com").tostring()); specifications specification status comment css typed om level 1the definition of 'to' in that specification. working draft initial definition. ...
CSSNumericValue.toSum() - Web APIs
terface converts the object's value to a cssmathsum object to values of the specified unit. syntax var cssmathsum = cssnumericvalue.tosum(units); parameters units the units to convert to. return value a cssnumericvalue. exceptions syntaxerror undefined typeerror indicates that an invalid type was passed to the method. examples let v = css.px("23").add(css.percent("4")).add(css.
cm("3")).add(css.in("9")); v.tostring() // => "calc(23px + 4% + 3
cm + 9in)" v.tosum("px", "percent").tostring() // => "calc(1000.39px + 4%)" specifications specification status comment css typed om level 1the definition of 'tosum' in that specification. working draft initial definition. ...
CSSNumericValue.type - Web APIs
the type() method of the cssnumericvalue interface returns the type of cssnumericvalue, one of angle, flex, frequency, length, resolution, percent, percenthint, or time. syntax var cssnumerictype = cssnumericvalue.type(); parameters none. return value a cssnumerictype object. exceptions none. examples let mathsum = css.px("23").sub(css.percent("4")).sub(css.
cm("3")).sub(css.in("9")); // returns an object with the structure: {length: 1, percenthint: "length"} let cssnumerictype = mathsum.type(); specifications specification status comment css typed om level 1the definition of 'type' in that specification. working draft initial definition. ...
CSSPrimitiveValue.primitiveType - Web APIs
imitivetype read-only property of the cssprimitivevalue interface represents the type of a css value. syntax type = cssprimitivevalue.primitivetype; value an unsigned short representing the type of the value. possible values are: constant description css_attr the value is an attr() function. the value can be obtained by using the getstringvalue() method. css_
cm the value is a <length> in centimeters. the value can be obtained by using the getfloatvalue() method. css_counter the value is a counter or counters function. the value can be obtained by using the getcountervalue() method. css_deg the value is an <angle> in degrees. the value can be obtained by using the getfloatvalue() method. css_dimension the value is a...
CSSPrimitiveValue.setFloatValue() - Web APIs
ty attached to this value can't accept the specified unit or the float value, the value will be unchanged and a domexception will be raised. syntax cssprimitivevalue.setfloatvalue(unittype, floatvalue); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned. valid values are: constant description css_
cm the value is a <length> in centimeters. css_deg the value is an <angle> in degrees. css_dimension the value is a <number> with an unknown dimension. css_ems the value is a <length> in em units. css_exs the value is a <length> in ex units. css_grad the value is an <angle> in grads. css_hz the value ...
CSSPrimitiveValue - Web APIs
fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, cssvalue. cssprimitivevalue.primitivetype read only an unsigned short representing the type of the value. possible values are: constant description css_attr the value is an attr() function. the value can be obtained by using the getstringvalue() method. css_
cm the value is a <length> in centimeters. the value can be obtained by using the getfloatvalue() method. css_counter the value is a counter or counters function. the value can be obtained by using the getcountervalue() method. css_deg the value is an <angle> in degrees. the value can be obtained by using the getfloatvalue() method. css_dimension t...
CSSStyleSheet.insertRule() - Web APIs
rule onto the top of my stylesheet. mystyle.insertrule('#blanc { color: white }', 0); function to add a stylesheet rule /** * add a stylesheet rule to the document (it may be better practice * to dynamically change classes, so style information can be kept in * genuine stylesheets and avoid adding extra elements to the dom). * note that an array is needed for declarations and rules since e
cmascript does * not guarantee a predictable object iteration order, and since css is * order-dependent. * @param {array} rules accepts an array of json-encoded declarations * @example addstylesheetrules([ ['h2', // also accepts a second argument as an array of arrays instead ['color', 'red'], ['background-color', 'green', true] // 'true' for !important rules ], ['.myclass', ['...
console - Web APIs
ooks like this: [13:14:13.481] hello, bob. you've called me 1 times. [13:14:13.483] hello, bob. you've called me 2 times. [13:14:13.485] hello, bob. you've called me 3 times. [13:14:13.487] hello, bob. you've called me 4 times. [13:14:13.488] hello, bob. you've called me 5 times. styling console output you can use the %c directive to apply a css style to console output: console.log("this is %
cmy stylish message", "color: yellow; font-style: italic; background-color: blue;padding: 2px"); the text before the directive will not be affected, but the text after the directive will be styled using the css declarations in the parameter. the properties usable along with the %c syntax are as follows (at least, in firefox — they may differ in other browsers): background and its longhand e...
Event.explicitOriginalTarget - Web APIs
the parent and explicitoriginaltarget will show the text node. explicitoriginaltarget differs from originaltarget in that it will never contain anonymous content. example this property can be used with <command> to get the event details of the original object calling the command. function mycommand(ev) { alert(ev.explicitoriginaltarget.nodename); // returns 'menuitem' } <xul:command id="my-
cmd-anaction" oncommand="mycommand(event);"/> <xul:menulist> <xul:menupopup> <xul:menuitem label="get my element name!" command="my-
cmd-anaction"/> </xul:menupopup> </menulist> specifications this is a mozilla-specific property. defined in /dom/public/idl/events/nsidomnsevent.idl this event property is not defined in the w3.org dom level 2 events ...
HTMLElement.dir - Web APIs
aracter, or default to the directionality of its parent element. browsers might allow users to change the directionality of <input> and <textarea>s in order to assist with authoring content. chrome and safari provide a directionality option in the contextual menu of input fields while internet explorer and edge use the key combinations ctrl + left shift and ctrl + right shift. firefox uses ctrl/
cmd + shift + x but does not update the dir attribute value. syntax var currentwritingdirection = elementnodereference.dir; elementnodereference.dir = newwritingdirection; currentwritingdirection is a string variable representing the text writing direction of the current element. newwritingdirection is a string variable representing the text writing direction value. possible values for dir...
HTMLImageElement.sizes - Web APIs
specify the width to use for the image during layout of the page, the media condition is typically (but not necessarily) based entirely on width information. see syntax in using media queries for details on how to construct a media condition. source size values the source size value is a css length. it may be specified using font-relative units (such as em or ex), absolute units (such as px or
cm), or the vw unit, which lets you specify the width as a percentage of the viewport width (1vw being 1% of the viewport width). note: the source size value must not be specified as a percentage of the container size; that is, lengths such as 50% or 100% are not allowed, as there would be uncertainty as to what the specified value is a percentage of. example in this example, a blog-like layout...
Ajax navigation example - Web APIs
"loop detected", 509: "unassigned", 510: "not extended", 511: "network authentication required" }; var oreq, bisloading = false, bupdateurl = false; oloadingbox.id = "ajax-loader"; ocover.onclick = abortreq; oloadingimg.src = "data:image/gif;base64,r0lgodlheaaqapiaap///waaamlcwkjcqgaaagjiyokcgpkskih/c05fvfndqvbfmi4waweaaaah/hpd
cmvhdgvkihdpdgggywphegxvywquaw5mbwah+qqjcgaaacwaaaaaeaaqaaadmwi63p4wyklre2mioggznadomgyjrbexwroumcg2lmdewnhqlvsyod2mbzkydadka+diaaah+qqjcgaaacwaaaaaeaaqaaadnai63p5ojcegg4qmu7dmikrxqlfuydezigbmrvsaqhwctxxf7weyb4ag1xjihkmzsiukkhiaifkecqoaaaasaaaaabaaeaaaazyiujijk8pbyjdmlfyvbovjha70gu7xsujhmktwhpakzlo9hmaokwjz7rf8aypddzkpzbqfvwqaifkecqoaaaasaaaaabaaeaaaazmiumilk8oyhphsnfzfhyumcyuhdaqxridhhbgqrokw0r8dyl...
Key Values - Web APIs
_up (24) "microphonetoggle" toggles the microphone on and off. appcommand_mic_on_off_toggle "microphonevolumedown" decreases the microphone's input volume. appcommand_microphone_volume_down qt::key_micvolumedown (0x0100011e) "microphonevolumemute" mutes the microphone input. appcommand_microphone_volume_mute gdk_key_audiomi
cmute (0x1008ffb2) qt::key_mi
cmute (0x01000113) keycode_mute (91) "microphonevolumeup" increases the microphone's input volume. appcommand_microphone_volume_up qt::key_micvolumeup (0x0100011d) [1] internet explorer, edge, and firefox (48 and earlier) use "volumeup", "volumedown", and "volumemute" instead of "audiovolumeup", "audiovolumedown", and "audiovolumem...
MediaDevices.ondevicechange - Web APIs
ndler as an array of mediadeviceinfo objects, each describing one media input or output device. a foreach() loop is used to scan through all the devices. for each device, we create a new <li> object to be used to display it to the user. the line let [kind, type, direction] = device.kind.match(/(\w+)(input|output)/i); deserves special notice. this uses destructuring assignment (a new feature of e
cmascript 6) to assign the values of the first three items in the array returned by string.match() to the variables kind, type, and direction. we do this because the value of mediadeviceinfo.kind is a single string that includes both the media type and the direction the media flows, such as "audioinput" or "videooutput". this line, then, pulls out the type ("audio" or "video") and direction ("input"...
RTCIceCandidate.candidate - Web APIs
eive an rtcicecanddiate object in return, which represents the candidate. the new candidate is then passed into rtcpeerconnection.addicecandidate() to add the candidate to the list of candidates for webrtc to consider using for the connection being established. this example could be simplified somewhat; you may more often see the code look something like this, taking advantage of more advanced e
cmascript 2016 features: let handlenewicecandidate = candidatesdp => mypeerconnection.addicecandidate(new rtcicecandidate(candidatesdp)); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.candidate' in that specification. candidate recommendation initial definition. ...
RTCRtpStreamStats - Web APIs
eo" if the track contains video. this value will match that of the media type indicated by rtccodecstats.codec, as well as the track's kind property. previously called mediatype. ssrc the 32-bit integer which identifies the source of the rtp packets this rtcrtpstreamstats object covers. this value is generated per the rfc 3550 specification. trackid a domstring which uniquely identifies the rt
cmediastreamtrackstats object representing the associated mediastreamtrack. this is not the same as the value of mediastreamtrack.id. transportid a domstring uniquely identifying the object which was inspected to produce the rtctransportstats object associated with this rtp stream. obsolete fields mediatype renamed to kind in the specification in february 2018. see browser compatibility in ...
RTCStatsReport - Web APIs
outboundrtpstreamstats object that contains statistics about your inbound rtp (inbound-rtp) stream, but from the perspective of the remote peer. sender an object containing statistics about the rtcrtpsender for a stream on the rtcpeerconnection. if kind is "audio", this object is of type rtcaudiosenderstats; if kind is "video", this is an rtcvideosenderstats object. stream an object of type rt
cmediastreamstats, providing statistics and information about a mediastream which is part of the rtcpeerconnection. track the object is one of the types based on rt
cmediahandlerstats: for audio tracks, the type is rtcsenderaudiotrackattachmentstats and for video tracks, the type is rtcsendervideotrackattachmentstats. the data within provides statistics related to a particular mediastreamtrack's at...
RTCStatsType - Web APIs
outboundrtpstreamstats object that contains statistics about your inbound rtp (inbound-rtp) stream, but from the perspective of the remote peer. sender an object containing statistics about the rtcrtpsender for a stream on the rtcpeerconnection. if kind is "audio", this object is of type rtcaudiosenderstats; if kind is "video", this is an rtcvideosenderstats object. stream an object of type rt
cmediastreamstats, providing statistics and information about a mediastream which is part of the rtcpeerconnection. track the object is one of the types based on rt
cmediahandlerstats: for audio tracks, the type is rtcsenderaudiotrackattachmentstats and for video tracks, the type is rtcsendervideotrackattachmentstats. the data within provides statistics related to a particular mediastreamtrack's at...
SVGTransformList - Web APIs
ach transformation -- such as translate, rotate, and scale. we apply multiple transformation by appending the transform object to the svgtransformlist associated with an svg element. ...
ServiceWorkerGlobalScope - Web APIs
occurs when a server push notification is received. also available via the serviceworkerglobalscope.onpush property. pushsubscriptionchange occurs when a push subscription has been invalidated, or is about to be invalidated (e.g. when a push service sets an expiration time). also available via the serviceworkerglobalscope.onpushsubscriptionchange property. sync triggered when a call to syn
cmanager.register is made from a service worker client page. the attempt to sync is made either immediately if the network is available or as soon as the network becomes available. also available via the serviceworkerglobalscope.onsync property. methods serviceworkerglobalscope.skipwaiting() allows the current service worker registration to progress from waiting to active state while service ...
ServiceWorkerRegistration.periodicSync - Web APIs
note: this feature was mentioned as an idea in the sw explainer at some point, but as yet has not been implemented anywhere. the periodicsync read-only property of the serviceworkerregistration interface returns a reference to the periodicsyn
cmanager interface, which manages periodic background synchronization processes. syntax var periodicsyn
cmanager = serviceworkerregistration.periodicsync; value a periodicsyn
cmanager object. examples // tbd specifications currently not part of any specification. ...
ServiceWorkerRegistration.sync - Web APIs
the sync property of the serviceworkerregistration interface returns a reference to the syn
cmanager interface, which manages background synchronization processes. syntax var syn
cmanager = serviceworkerregistration.sync; value a syn
cmanager object. specifications specification status comment web background synchronization living standard initial definition. ...
Service Worker API - Web APIs
rs. service worker messages will now use the messageevent interface, for consistency with other web messaging features. serviceworkerregistration represents a service worker registration. serviceworkerstate associated with its serviceworker's state. syncevent the syncevent interface represents a sync action that is dispatched on the serviceworkerglobalscope of a serviceworker. syn
cmanager provides an interface for registering and listing sync registrations. windowclient represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. this is a special type of client object, with some additional methods and properties available. specifications specification status comment service wor...
SubtleCrypto.exportKey() - Web APIs
await window.crypto.subtle.exportkey( "raw", key ); const exportedkeybuffer = new uint8array(exported); const exportkeyoutput = document.queryselector(".exported-key"); exportkeyoutput.textcontent = `[${exportedkeybuffer}]`; } /* generate an encrypt/decrypt secret key, then set up an event listener on the "export" button. */ window.crypto.subtle.generatekey( { name: "aes-g
cm", length: 256, }, true, ["encrypt", "decrypt"] ).then((key) => { const exportbutton = document.queryselector(".raw"); exportbutton.addeventlistener("click", () => { exportcryptokey(key); }); }); pkcs #8 export this example exports an rsa private signing key as a pkcs #8 object. the exported key is then pem-encoded. see the complete code on github. /* convert an arraybuffe...
SubtleCrypto - Web APIs
est() derivebits() derivekey() wrapkey() unwrapkey() rsassa-pkcs1-v1_5 ✓ rsa-pss ✓ ecdsa ✓ hmac ✓ rsa-oaep ✓ ✓ aes-ctr ✓ ✓ aes-cbc ✓ ✓ aes-g
cm ✓ ✓ sha-1 ✓ sha-256 ✓ sha-384 ✓ sha-512 ✓ ecdh ✓ hkdf ✓ pbkdf2 ✓ aes-kw ✓ specifications specification status comm...
TextDecoder() - Web APIs
, "l3", "latin3" 'iso-8859-3' "csisolatin4", "iso-8859-4", "iso-ir-110", "iso8859-4", "iso88594", "iso_8859-4", "iso_8859-4:1988", "l4", "latin4" 'iso-8859-4' "csisolatincyrillic", "cyrillic", "iso-8859-5", "iso-ir-144", "iso88595", "iso_8859-5", "iso_8859-5:1988" 'iso-8859-5' "arabic", "asmo-708", "csiso88596e", "csiso88596i", "csisolatinarabic", "e
cma-114", "iso-8859-6", "iso-8859-6-e", "iso-8859-6-i", "iso-ir-127", "iso8859-6", "iso88596", "iso_8859-6", "iso_8859-6:1987" 'iso-8859-6' "csisolatingreek", "e
cma-118", "elot_928", "greek", "greek8", "iso-8859-7", "iso-ir-126", "iso8859-7", "iso88597", "iso_8859-7", "iso_8859-7:1987", "sun_eu_greek" 'iso-8859-7' "csiso88598e", "csisolatinhebrew", "hebrew", "iso-8859...
WebGL model view projection - Web APIs
position and scale matrices of the model have been changed to take it out of clip space and into the larger coordinate system. the results view on jsfiddle exercises experiment with the parameters of the perspective projection matrix and the model matrix. swap out the perspective projection matrix to use orthographic projection. in the mdn webgl shared code you'll find the mdn.orthographi
cmatrix(). this can replace the mdn.perspectivematrix() function in cubedemo.prototype.computeperspectivematrix(). view matrix while some graphics libraries have a virtual camera that can be positioned and pointed while composing a scene, opengl (and by extension webgl) does not. this is where the view matrix comes in. its job is to translate, rotate, and scale the objects in the scene so that th...
A simple RTCDataChannel sample - Web APIs
<div class="messagebox" id="receivebox"> <p>messages received:</p> </div> the javascript code while you can just look at the code itself on github, below we'll review the parts of the code that do the heavy lifting. the webrtc api makes heavy use of promises. they make it very easy to chain the steps of the connection process together; if you haven't already read up on this functionality of e
cmascript 2015, you should read up on them. similarly, this example uses arrow functions to simplify syntax. starting up when the script is run, we set up an load event listener, so that once the page is fully loaded, our startup() function is called. function startup() { connectbutton = document.getelementbyid('connectbutton'); disconnectbutton = document.getelementbyid('disconnectbutton'); ...
Basic concepts behind Web Audio API - Web APIs
referred to as subwoofers. each input or output is composed of one or more audio channels, which together represent a specific audio layout. any discrete channel structure is supported, including mono, stereo, quad, 5.1, and so on. audio sources can be obtained in a number of ways: sound can be generated directly in javascript by an audio node (such as an oscillator). created from raw p
cm data (the audio context has methods to decode supported audio formats). taken from html media elements (such as <video> or <audio>). taken directly from a webrtc mediastream (such as a webcam or microphone). audio data: what's in a sample when an audio signal is processed, sampling means the conversion of a continuous signal to a discrete signal; or put another way, a continuous sound wave, ...
Web Authentication API - Web APIs
entialrequestoptions the options passed to credentialscontainer.get(). examples for security reasons, web authentication calls (create() and get()) are cancelled if the browser window loses focus while the call is pending. // sample arguments for registration var createcredentialdefaultargs = { publickey: { // relying party (a.k.a. - service): rp: { name: "a
cme" }, // user: user: { id: new uint8array(16), name: "john.p.smith@example.com", displayname: "john p. smith" }, pubkeycredparams: [{ type: "public-key", alg: -7 }], attestation: "direct", timeout: 60000, challenge: new uint8array([ // must be a cryptographically...
system - CSS: Cascading Style Sheets
ou need to represent counter values as roman numerals, you could use either one of the predefined counter styles, upper-roman or lower-roman, rather than recreating the rule yourself. html <ul class="list"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ul> css @counter-style upper-roman { system: additive; range: 1 3999; additive-symbols: 1000 m, 900
cm, 500 d, 400 cd, 100 c, 90 xc, 50 l, 40 xl, 10 x, 9 ix, 5 v, 4 iv, 1 i; } ul { list-style: upper-roman; } result extends example this example will use the algorithm, symbols, and other properties of the lower-alpha counter style, but will remove the period ('.') after the counter representation, and enclose the characters in paranthesis; like (a), (b), etc. html <ul class="list"> <li>o...
@page - CSS: Cascading Style Sheets
in the general case, where one page box is rendered onto one page sheet, it also indicates the size of the destination page sheet. marks adds crop and/or registration marks to the document. bleed specifies the extent beyond the page box at which the page rendering is clipped. description you can't change all css properties with @page. you can only change the margins, orphans, widows, and page breaks of the document. ...
max-height - CSS: Cascading Style Sheets
the max-height css descriptor specifies the maximum height of the viewport of a document defined via the @viewport at-rule. the height will initially be set as close as possible to the initial viewport height considering the maximum height constraint. syntax /* keyword value */ max-height: auto; /* <length> values */ max-height: 400px; max-height: 50em; max-height: 20
cm; /* <percentage> value */ max-height: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the height of the initial viewport at zoom factor 1.0 for vertical lengths. must be non-negative. formal definition related at-rule@viewportinitial valueautopercentagesrefer to the height of...
max-width - CSS: Cascading Style Sheets
the max-width css descriptor specifies the maximum width of the viewport of a document defined via the @viewport at-rule. by default, the width is set as close as possible to the initial viewport considering the maximum width constraint. syntax /* keyword value */ max-width: auto; /* <length> values */ max-width: 600px; max-width: 80em; max-width: 15
cm; /* <percentage> value */ max-width: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width of the initial viewport at zoom factor 1.0 for horizontal lengths. must be non-negative. formal definition related at-rule@viewportinitial valueautopercentagesrefer to the width of the initial viewp...
min-height - CSS: Cascading Style Sheets
the min-height css descriptor specifies the minimum height of the viewport of a document defined via the @viewport at-rule. the height will initially be set as close as possible to the initial viewport height considering the minimum height constraint. syntax /* keyword value */ min-height: auto; /* <length> values */ min-height: 120px; min-height: 20em; min-height: 10
cm; /* <percentage> value */ min-height: 25%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the height of the initial viewport at zoom factor 1.0 for vertical lengths. must be non-negative. formal definition related at-rule@viewportinitial valueautopercentagesrefer to the height of...
min-width - CSS: Cascading Style Sheets
the min-width css descriptor specifies the minimum width of the viewport of a document defined via @viewport. by default, min-width is set as close as possible to the initial viewport considering the minimum width constraint. syntax /* keyword value */ min-width: auto; /* <length> values */ min-width: 320px; min-width: 40em; min-width: 5
cm; /* <percentage> value */ min-width: 25%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. formal definition related at-rule@viewportinitial valueautopercentagesrefer to the wi...
background-position-x - CSS: Cascading Style Sheets
alue of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. syntax /* keyword values */ background-position-x: left; background-position-x: center; background-position-x: right; /* <percentage> values */ background-position-x: 25%; /* <length> values */ background-position-x: 0px; background-position-x: 1
cm; background-position-x: 8em; /* side-relative values */ background-position-x: right 3px; background-position-x: left 25%; /* multiple values */ background-position-x: 0px, center; /* global values */ background-position-x: inherit; background-position-x: initial; background-position-x: unset; the background-position-x property is specified as one or more values, separated by commas. values...
background-position-y - CSS: Cascading Style Sheets
alue of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. syntax /* keyword values */ background-position-y: top; background-position-y: center; background-position-y: bottom; /* <percentage> values */ background-position-y: 25%; /* <length> values */ background-position-y: 0px; background-position-y: 1
cm; background-position-y: 8em; /* side-relative values */ background-position-y: bottom 3px; background-position-y: bottom 10%; /* multiple values */ background-position-y: 0px, center; /* global values */ background-position-y: inherit; background-position-y: initial; background-position-y: unset; the background-position-y property is specified as one or more values, separated by commas. val...
border-spacing - CSS: Cascading Style Sheets
er-spacing and the relevant (top, right, bottom, or left) padding on the table. note: the border-spacing property is equivalent to the deprecated cellspacing <table> attribute, except that it has an optional second value that can be used to set different horizontal and vertical spacing. syntax /* <length> */ border-spacing: 2px; /* horizontal <length> | vertical <length> */ border-spacing: 1
cm 2em; /* global values */ border-spacing: inherit; border-spacing: initial; border-spacing: unset; the border-spacing property may be specified as either one or two values. when one <length> value is specified, it defines both the horizontal and vertical spacings between cells. when two <length> values are specified, the first value defines the horizontal spacing between cells (i.e., the sp...
color - CSS: Cascading Style Sheets
e definition of 'color' in that specification. working draft adds commaless syntaxes for the rgb(), rgba(), hsl(), and hsla() functions. allows alpha values in rgb() and hsl(), turning rgba() and hsla() into (deprecated) aliases for them. adds color keyword rebeccapurple. adds 4- and 8-digit hex color values, where the last digit(s) represents the alpha value. adds hwb(), device-
cmyk(), and color() functions. css color module level 3the definition of 'color' in that specification. recommendation deprecates system-colors. adds svg colors. adds the rgba(), hsl(), and hsla() functions. css level 2 (revision 1)the definition of 'color' in that specification. recommendation adds the orange color and the system colors. css level 1the definit...
fit-content() - CSS: Cascading Style Sheets
rack size is clamped at argument if it is greater than the auto minimum. the function can also be used as laid out box size for width, height, min-width, min-height, max-width and max-height, where the maximum and minimum sizes refer to the content size. syntax the fit-content() function accepts a <length> or a <percentage> as an argument. /* <length> values */ fit-content(200px) fit-content(5
cm) fit-content(30vw) fit-content(100ch) /* <percentage> value */ fit-content(40%) values <length> an absolute length. <percentage> a percentage relative to the available space in the given axis. in grid properties it is relative to the inline size of the grid container in column tracks and to the block size of the grid container for row tracks. otherwise it is relative to the available in...
font-variant-numeric - CSS: Cascading Style Sheets
ic-spacing-values> = [ proportional-nums | tabular-nums ]<numeric-fraction-values> = [ diagonal-fractions | stacked-fractions ] examples setting ordinal numeric forms html <p class="ordinal">1st, 2nd, 3rd, 4th, 5th</p> css /* this example uses the source sans pro opentype font, developed by adobe and used here under the terms of the sil open font license, version 1.1: http://scripts.sil.org/
cms/scripts/page.php?item_id=ofl_web */ @font-face { font-family: "source sans pro"; font-style: normal; font-weight: 400; src: url("https://mdn.mozillademos.org/files/15757/sourcesanspro-regular.otf") format("opentype"); } .ordinal { font-variant-numeric: ordinal; font-family: "source sans pro"; } result specifications specification status comment css...
grid-auto-rows - CSS: Cascading Style Sheets
plicitly sized by grid-template-rows, implicit grid tracks are created to hold it. this can happen either by explicitly positioning into a row that is out of range, or by the auto-placement algorithm creating additional rows. ...
image-set() - CSS: Cascading Style Sheets
tion># ) where <image-set-option> = [ <image> | <string> ] <resolution> and <string> is an <url> values most commonly you'll see an url() <string> value, but the <image> can be any image type except for an image set. the image-set() function can not be nested inside another image-set() function. <resolution> units include x or dppx, for dots per pixel unit, dpi, for dots per inch, and dp
cm for dots per centimeter. every image within an image-set() must have a unique resolution. examples background-image: image-set( "cat.png" 1x, "cat-2x.png" 2x, "cat-print.png" 600dpi); this example shows how to use image-set() to provide two alternative background-image options, chosen depending on the resolution needed: a normal version...
offset-anchor - CSS: Cascading Style Sheets
operty specifies the point inside the box of an element travelling along an offset-path that is actually moving along the path. syntax /* keyword values */ offset-anchor: top; offset-anchor: bottom; offset-anchor: left; offset-anchor: right; offset-anchor: center; offset-anchor: auto; /* <percentage> values */ offset-anchor: 25% 75%; /* <length> values */ offset-anchor: 0 0; offset-anchor: 1
cm 2
cm; offset-anchor: 10ch 8em; /* edge offsets values */ offset-anchor: bottom 10px right 20px; offset-anchor: right 3em bottom 10px; /* global values */ offset-anchor: inherit; offset-anchor: initial; offset-anchor: unset; values auto offset-anchor is given the same value as the element's transform-origin, unless offset-path is none, in which case it takes its value from offset-position. ...
offset-position - CSS: Cascading Style Sheets
the offset-position css property defines the initial position of the offset-path. syntax /* keyword values */ offset-position: auto; offset-position: top; offset-position: bottom; offset-position: left; offset-position: right; offset-position: center; /* <percentage> values */ offset-position: 25% 75%; /* <length> values */ offset-position: 0 0; offset-position: 1
cm 2
cm; offset-position: 10ch 8em; /* edge offsets values */ offset-position: bottom 10px right 20px; offset-position: right 3em bottom 10px; offset-position: bottom 10px right; offset-position: top right 10px; /* global values */ offset-position: inherit; offset-position: initial; offset-position: unset; values auto the initial position is the position of the box specified by the position property. <position...
offset - CSS: Cascading Style Sheets
e; /* offset path */ offset: ray(45deg closest-side); offset: path('m 100 100 l 300 100 l 200 300 z'); offset: url(arc.svg); /* offset path with distance and/or rotation */ offset: url(circle.svg) 100px; offset: url(circle.svg) 40%; offset: url(circle.svg) 30deg; offset: url(circle.svg) 50px 20deg; /* including offset anchor */ offset: ray(45deg closest-side) / 40px 20px; offset: url(arc.svg) 2
cm / 0.5
cm 3
cm; offset: url(arc.svg) 30deg / 50px 100px; formal definition initial valueas each of the properties of the shorthand:offset-position: autooffset-path: noneoffset-distance: 0offset-anchor: autooffset-rotate: autoapplies totransformable elementsinheritednopercentagesas each of the properties of the shorthand:offset-position: refertosizeofcontainingblockoffset-distance: refer to the to...
padding-bottom - CSS: Cascading Style Sheets
interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. an element's padding area is the space between its content and its border. note: the padding property can be used to set paddings on all four sides of an element with a single declaration. syntax /* <length> values */ padding-bottom: 0.5em; padding-bottom: 0; padding-bottom: 2
cm; /* <percentage> value */ padding-bottom: 10%; /* global values */ padding-bottom: inherit; padding-bottom: initial; padding-bottom: unset; the padding-bottom property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size...
padding-left - CSS: Cascading Style Sheets
to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. an element's padding area is the space between its content and its border. note: the padding property can be used to set paddings on all four sides of an element with a single declaration. syntax /* <length> values */ padding-left: 0.5em; padding-left: 0; padding-left: 2
cm; /* <percentage> value */ padding-left: 10%; /* global values */ padding-left: inherit; padding-left: initial; padding-left: unset; the padding-left property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of the pa...
padding-right - CSS: Cascading Style Sheets
the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. an element's padding area is the space between its content and its border. note: the padding property can be used to set paddings on all four sides of an element with a single declaration. syntax /* <length> values */ padding-right: 0.5em; padding-right: 0; padding-right: 2
cm; /* <percentage> value */ padding-right: 10%; /* global values */ padding-right: inherit; padding-right: initial; padding-right: unset; the padding-right property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of t...
padding-top - CSS: Cascading Style Sheets
e to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. an element's padding area is the space between its content and its border. note: the padding property can be used to set paddings on all four sides of an element with a single declaration. syntax /* <length> values */ padding-top: 0.5em; padding-top: 0; padding-top: 2
cm; /* <percentage> value */ padding-top: 10%; /* global values */ padding-top: inherit; padding-top: initial; padding-top: unset; the padding-top property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of the padding...
row-gap (grid-row-gap) - CSS: Cascading Style Sheets
d us a pull request. css grid layout initially defined the grid-row-gap property. this prefixed property is being replaced by row-gap. however, in order to support browsers that implemented grid-row-gap and not row-gap for grid, you will need to use the prefixed property as in the interactive example above. syntax /* <length> values */ row-gap: 20px; row-gap: 1em; row-gap: 3vmin; row-gap: 0.5
cm; /* <percentage> value */ row-gap: 10%; /* global values */ row-gap: inherit; row-gap: initial; row-gap: unset; values <length-percentage> is the width of the gutter separating the rows. <percentage> values are relative to the dimension of the element. formal definition initial valuenormalapplies tomulti-column elements, flex containers, grid containersinheritednopercentagesrefer to co...
Event reference
, removed from, or changed in the browser <iframe>'s content. mozbrowseropensearch firefox os browser api-specific sent when a link to a search engine is found. mozbrowseropentab firefox os browser api-specific sent when a new tab is opened within a browser <iframe> as a result of the user issuing a command to open a link target in a new tab (for example ctrl/
cmd + click.) mozbrowseropenwindow firefox os browser api-specific sent when window.open() is called within a browser iframe. mozbrowserresize firefox os browser api-specific sent when the browser <iframe>'s window size has changed. mozbrowserscroll firefox os browser api-specific sent when the browser <iframe> content scrolls. mozbro...
Cross-browser audio basics - Developer guides
ernet explorer 9+ opera 10.5+ safari 4+ mobile mobile browser version chrome (android) 32+ firefox (android) 26+ ie mobile 10+ opera mobile 11+ safari (ios) 4+ android browser 2.3+ blackberry 7+ audio codec support browser ogg mp3 aac p
cm opus firefox 3.5+ ✓ ✓ *26+ ✓ ✓ *14+ safari 5+ ✓ ✓ chrome 6+ ✓ ✓ ✓ ✓ *9+ opera 10.5+ ✓ internet explorer 9+ ✓ ✓ firefox mobile ✓ ✓ ✓ ✓ ✓ safari ios3+ ✓ ✓ ✓ *4.2+ ...
Constraint validation - Developer guides
lt. validation-related attributes in addition to the type attribute described above, the following attributes are used to describe basic constraints: attribute input types supporting the attribute possible values constraint description associated violation pattern text, search, url, tel, email, password a javascript regular expression (compiled with the e
cmascript 5 global, ignorecase, and multiline flags disabled) the value must match the pattern. patternmismatch constraint violation min range, number a valid number the value must be greater than or equal to the value. rangeunderflow constraint violation date, month, week a valid date datetime, datetime-local, time a valid date and time ma...
Writing forward-compatible websites - Developer guides
multiple times to various sites already during the evolution of html5. to avoid this, fully qualify global variable access using "window.", like so: <script> function localname() { alert('function localname has been called'); } </script> <div onclick="window.localname()">clicking me should show an alert<div> don't concatenate scripts you don't control the "use strict;" directive in e
cmascript, when used on the file level, applies to everything in the file. so appending a script that depends on non-strict-mode behavior to a strict-mode script will cause things to break. ask the authors of any javascript libraries you use to also follow these guidelines suggest to the developers of your favorite libraries that they follow these guidelines too. if they don't, you can't rely on t...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
o preventing autofilling with autocomplete="new-password"). "current-password" the user's current password. "one-time-code" a one-time code used for verifying user identity. "organization-title" a job title, or the title a person has within an organization, such as "senior technical writer", "president", or "assistant troop leader". "organization" a company or organization name, such as "a
cme widget company" or "girl scouts of america". "street-address" a street address. this can be multiple lines of text, and should fully identify the location of the address within its second administrative level (typically a city or town), but should not include the city name, zip or postal code, or country name. "address-line1", "address-line2", "address-line3" each individual line of the stre...
<dl>: The Description List element - HTML: Hypertext Markup Language
ons --> </dl> single term, multiple descriptions <dl> <dt>firefox</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the mozilla corporation and hundreds of volunteers. </dd> <dd> the red panda also known as the lesser panda, wah, bear cat or firefox, is a mostly herbivorous mammal, slightly larger than a domestic cat (60
cm long). </dd> <!-- other terms and descriptions --> </dl> multiple terms and descriptions it is also possible to define multiple terms with multiple corresponding descriptions, by combining the examples above. metadata description lists are useful for displaying metadata as a list of key-value pairs. <dl> <dt>name</dt> <dd>godzilla</dd> <dt>born</dt> <dd>1952</dd> <dt>birthp...
dir - HTML: Hypertext Markup Language
ata coming from user input, eventually stored in a database. browsers might allow users to change the directionality of <input> and <textarea>s in order to assist with authoring content. chrome and safari provide a directionality option in the contextual menu of input fields while internet explorer and edge use the key combinations ctrl + left shift and ctrl + right shift. firefox uses ctrl/
cmd + shift + x but does not update the dir attribute value. specifications specification status comment html living standardthe definition of 'dir' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'dir' in that specification. recommendation snapshot of html living standard, no change from html5 ...
Data URLs - HTTP
-encoded binary data. you can find more info on mime types here and here. a few examples: data:,hello%2c%20world! simple text/plain data. note the use of percent-encoding (url-encoding) for the quote and space characters. also, for csv data (mime type "text/csv"), percent-encoding is needed to preserve the line endings that delimit rows of the spreadsheet. data:text/plain;base64,sgvsbg8sifdv
cmxkiq== base64-encoded version of the above data:text/html,%3ch1%3ehello%2c%20world!%3c%2fh1%3e an html document with <h1>hello, world!</h1> data:text/html,<script>alert('hi');</script> an html document that executes a javascript alert. note that the closing script tag is required. encoding data into base64 format base64 is a group of binary-to-text encoding schemes that represent binary da...
HTTP conditional requests - HTTP
g can be used in the condition. rarely is such additional flexibility needed. avoiding the lost update problem with optimistic locking a common operation in web applications is to update a remote document. this is very common in any file system or source control applications, but any application that allows to store remote resources needs such a mechanism. common web sites, like wikis and other
cms, have such a need. with the put method you are able to implement this. the client first reads the original files, modifies them, and finally pushes them to the server: unfortunately, things get a little inaccurate as soon as we take into account concurrency. while a client is locally modifying its new copy of the resource, a second client can fetch the same resource and do the same on its co...
About JavaScript - JavaScript
vascript programs can decompile function bodies back into their source text). for a more in depth discussion of javascript programming follow the javascript resources links below. what javascript implementations are available? the mozilla project provides two javascript implementations. the first ever javascript was created by brendan eich at netscape, and has since been updated to conform to e
cma-262 edition 5 and later versions. this engine, code named spidermonkey, is implemented in c/c++. the rhino engine, created primarily by norris boyd (also at netscape) is a javascript implementation written in java. like spidermonkey, rhino is e
cma-262 edition 5 compliant. several major runtime optimizations such as tracemonkey (firefox 3.5), jägermonkey (firefox 4) and ionmonkey were added to ...
Closures - JavaScript
} } } var s = sum(1); var s1 = s(2); var s2 = s1(3); var s3 = s2(4); console.log(s3) //log 20 in the example above, there's a series of nested functions, all of which have access to the outer functions' scope. in this context, we can say that closures have access to all outer function scopes. creating closures in loops: a common mistake prior to the introduction of the let keyword in e
cmascript 2015, a common problem with closures occurred when you created them inside a loop. to demonstrate, consider the following example code. <p id="help">helpful notes will appear here</p> <p>e-mail: <input type="text" id="email" name="email"></p> <p>name: <input type="text" id="name" name="name"></p> <p>age: <input type="text" id="age" name="age"></p> function showhelp(help) { document.ge...
Details of the object model - JavaScript
method to create class instances. javascript follows a similar model, but does not have a class definition separate from the constructor. instead, you define a constructor function to create objects with a particular initial set of properties and values. any javascript function can be used as a constructor. you use the new operator with a constructor function to create a new object. note that e
cmascript 2015 introduces a class declaration: javascript classes, introduced in e
cmascript 2015, are primarily syntactical sugar over javascript's existing prototype-based inheritance. the class syntax does not introduce a new object-oriented inheritance model to javascript. subclasses and inheritance in a class-based language, you create a hierarchy of classes through the class definitions. ...
Meta programming - JavaScript
« previousnext » starting with e
cmascript 2015, javascript gains support for the proxy and reflect objects allowing you to intercept and define custom behavior for fundamental language operations (e.g. property lookup, assignment, enumeration, function invocation, etc). with the help of these two objects you are able to program at the meta level of javascript. proxies introduced in e
cmascript 6, proxy objects allow you to intercept certain operations and to implement custom behaviors. for example, getting a property on an object: let handler = { get: function(target, name) { return name in target? target[name] : 42 } } let p = new proxy({}, handler) p.a = 1 console.log(p.a, p.b) // 1, 42 the proxy object defines a target (an empty object here) and a handler o...
Regular expression syntax cheatsheet - JavaScript
cal tab. \f matches a form-feed. [\b] matches a backspace. if you're looking for the word-boundary character (\b), see boundaries. \0 matches a nul character. do not follow this with another digit. \cx matches a control character using caret notation, where "x" is a letter from a–z (corresponding to codepoints u+0001–u+001f). for example, /\
cm/ matches "\r" in "\r\n". \xhh matches the character with the code hh (two hexadecimal digits). \uhhhh matches a utf-16 code-unit with the value hhhh (four hexadecimal digits). \u{hhhh} or \u{hhhhh} (only when the u flag is set.) matches the character with the unicode value u+hhhh or u+hhhhh (hexadecimal digits). \ indicates that the followi...
JavaScript Guide - JavaScript
the javascript guide shows you how to use javascript and gives an overview of the language. if you need exhaustive information about a language feature, have a look at the javascript reference. ...
extends - JavaScript
is example extends the built-in date object. this example is extracted from this live demo (source). class mydate extends date { getformatteddate() { var months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']; return this.getdate() + '-' + months[this.getmonth()] + '-' + this.getfullyear(); } } specifications specification e
cmascript (e
cma-262)the definition of 'extends' in that specification. ...
Deprecated and obsolete features - JavaScript
r special characters. string methods html wrapper methods like string.prototype.fontsize and string.prototype.big. string.prototype.quote is removed from firefox 37. non standard flags parameter in string.prototype.search, string.prototype.match, and string.prototype.replace are deprecated. string.prototype.substr probably won't be removed anytime soon, but it's defined in annex b of the e
cma-262 standard, whose introduction states: "… programmers should not use or assume the existence of these features and behaviours when writing new e
cmascript code. …" obsolete features these obsolete features have been entirely removed from javascript and can no longer be used as of the indicated version of javascript. object property description __count__ returns ...
Warning: expression closures are deprecated - JavaScript
ntax will be removed entirely in bug 1083458 and scripts using it will throw a syntaxerror then. examples deprecated syntax expression closures omit curly braces or return statements from function declarations or from method definitions in objects. var x = function() 1; var obj = { count: function() 1 }; standard syntax to convert the non-standard expression closures syntax to standard e
cmascript syntax, you can add curly braces and return statements. var x = function() { return 1; } var obj = { count: function() { return 1; } }; standard syntax using arrow functions alternatively, you can use arrow functions: var x = () => 1; standard syntax using shorthand method syntax expression closures can also be found with getter and setter, like this: var obj = { get x() 1, ...
SyntaxError: "0"-prefixed octal literals and octal escape seq. are deprecated - JavaScript
e syntaxerror: octal numeric literals and escape characters not allowed in strict mode (edge) syntaxerror: "0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead error type syntaxerror in strict mode only. what went wrong? octal literals and octal escape sequences are deprecated and will throw a syntaxerror in strict mode. with e
cmascript 2015 and later, the standardized syntax uses a leading zero followed by a lowercase or uppercase latin letter "o" (0o or 0o). examples "0"-prefixed octal literals "use strict"; 03; // syntaxerror: "0"-prefixed octal literals and octal escape sequences // are deprecated octal escape sequences "use strict"; "\251"; // syntaxerror: "0"-prefixed octal literals and octal escape sequenc...
Warning: Date.prototype.toLocaleFormat is deprecated - JavaScript
c. the function is no longer available in firefox 58+. examples deprecated syntax the date.prototype.tolocaleformat method is deprecated and will be removed (no cross-browser support, available in firefox only). var today = new date(); var date = today.tolocaleformat('%a, %e. %b %y'); console.log(date); // in german locale // "freitag, 10. märz 2017" alternative standard syntax using the e
cmascript intl api the e
cma-402 (e
cmascript intl api) standard specifies standard objects and methods that enable language sensitive date and time formatting (available in chrome 24+, firefox 29+, ie11+, safari10+). you can now either use the date.prototype.tolocaledatestring method if you just want to format one date. var today = new date(); var options = { weekday: 'long', year: 'numeric', ...
RangeError: precision is out of range - JavaScript
st be between 0 and 20 (chrome) rangeerror: toprecision() argument must be between 1 and 21 (chrome) error type rangeerror what went wrong? there was an out of range precision argument in one of these methods: number.prototype.toexponential() number.prototype.tofixed() number.prototype.toprecision() the allowed range for these methods is usually between 0 and 20 (or 21). however, the e
cmascript specification allows to extend this range. method firefox (spidermonkey) chrome, opera (v8) number.prototype.toexponential() 0 to 100 0 to 20 number.prototype.tofixed() -20 to 100 0 to 20 number.prototype.toprecision() 1 to 100 1 to 21 examples invalid cases 77.1234.toexponential(-1); // rangeerror 77.1234.toexponen...
SyntaxError: "use strict" not allowed in function with non-simple parameters - JavaScript
parameter chrome: syntaxerror: illegal 'use strict' directive in function with non-simple parameter list error type syntaxerror. what went wrong? a "use strict" directive is written at the top of a function that has one of the following parameters: default parameters rest parameters destructuring parameters a "use strict" directive is not allowed at the top of such functions per the e
cmascript specification. examples function statement in this case, the function sum has default parameters a=1 and b=2: function sum(a = 1, b = 2) { // syntaxerror: "use strict" not allowed in function with default parameter 'use strict'; return a + b; } if the function should be in strict mode, and the entire script or enclosing function is also okay to be in strict mode, you can move t...
JavaScript error reference - JavaScript
error: cyclic object valuetypeerror: invalid "instanceof" operand "x"typeerror: invalid array.prototype.sort argumenttypeerror: invalid argumentstypeerror: invalid assignment to const "x"typeerror: property "x" is non-configurable and can't be deletedtypeerror: setting getter-only property "x"typeerror: variable "x" redeclares argumenturierror: malformed uri sequencewarning: 08/09 is not a legal e
cma-262 octal constantwarning: -file- is being assigned a //# sourcemappingurl, but already has onewarning: date.prototype.tolocaleformat is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.prototype.x insteadwarning: expression closures are deprecatedwarning: unreachable code after return statement ...
Default parameters - JavaScript
re later parameters without defaults. function f(x = 1, y) { return [x, y] } f() // [1, undefined] f(2) // [2, undefined] destructured parameter with default value assignment you can use default value assignment with the destructuring assignment notation: function f([x, y] = [1, 2], {z: z} = {z: 3}) { return x + y + z } f() // 6 specifications specification e
cmascript (e
cma-262)the definition of 'function definitions' in that specification. ...
arguments[@@iterator]() - JavaScript
ction object as the initial value of the array.prototype.values property. syntax arguments[symbol.iterator]() examples iteration using for...of loop function f() { // your browser must support for..of loop // and let-scoped variables in for loops for (let letter of arguments) { console.log(letter); } } f('w', 'y', 'k', 'o', 'p'); specifications specification e
cmascript (e
cma-262)the definition of 'createunmappedargumentsobject' in that specification. e
cmascript (e
cma-262)the definition of 'createmappedargumentsobject' in that specification. ...
arguments.length - JavaScript
. examples using arguments.length in this example we define a function that can add two or more numbers together. function adder(base /*, n2, ... */) { base = number(base); for (var i = 1; i < arguments.length; i++) { base += number(arguments[i]); } return base; } note the difference between function.length and arguments.length specifications specification e
cmascript (e
cma-262)the definition of 'arguments exotic objects' in that specification. ...
get Array[@@species] - JavaScript
object (e.g. your custom array myarray), the myarray species is the myarray constructor. however, you might want to overwrite this, in order to return parent array objects in your derived class methods: class myarray extends array { // overwrite myarray species to the parent array constructor static get [symbol.species]() { return array; } } specifications specification e
cmascript (e
cma-262)the definition of 'get array [ @@species ]' in that specification. ...
Array.prototype.entries() - JavaScript
tor object. examples iterating with index and element const a = ['a', 'b', 'c']; for (const [index, element] of a.entries()) console.log(index, element); // 0 'a' // 1 'b' // 2 'c' using a for…of loop var a = ['a', 'b', 'c']; var iterator = a.entries(); for (let e of iterator) { console.log(e); } // [0, 'a'] // [1, 'b'] // [2, 'c'] specifications specification e
cmascript (e
cma-262)the definition of 'array.prototype.entries' in that specification. ...
Array.isArray() - JavaScript
s through iframes. var iframe = document.createelement('iframe'); document.body.appendchild(iframe); xarray = window.frames[window.frames.length-1].array; var arr = new xarray(1,2,3); // [1,2,3] // correctly checking for array array.isarray(arr); // true // considered harmful, because doesn't work through iframes arr instanceof array; // false specifications specification e
cmascript (e
cma-262)the definition of 'array.isarray' in that specification. ...
Array.prototype.keys() - JavaScript
tps://github.com/mdn/interactive-examples and send us a pull request. syntax arr.keys() return value a new array iterator object. examples key iterator doesn't ignore holes var arr = ['a', , 'c']; var sparsekeys = object.keys(arr); var densekeys = [...arr.keys()]; console.log(sparsekeys); // ['0', '2'] console.log(densekeys); // [0, 1, 2] specifications specification e
cmascript (e
cma-262)the definition of 'array.prototype.keys' in that specification. ...
Array.prototype.length - JavaScript
o a length of 3 if the current length is greater than 3. var numbers = [1, 2, 3, 4, 5]; if (numbers.length > 3) { numbers.length = 3; } console.log(numbers); // [1, 2, 3] console.log(numbers.length); // 3 create empty array of fixed length var numbers = []; numbers.length = 3; console.log(numbers); // [undefined, undefined, undefined] specifications specification e
cmascript (e
cma-262)the definition of 'array.length' in that specification. ...
Array.prototype.pop() - JavaScript
gth parameter, then removes its last element and decrements the length parameter. var myfish = {0:'angel', 1:'clown', 2:'mandarin', 3:'sturgeon', length: 4}; var popped = array.prototype.pop.call(myfish); //same syntax for using apply( ) console.log(myfish); // {0:'angel', 1:'clown', 2:'mandarin', length: 3} console.log(popped); // 'sturgeon' specifications specification e
cmascript (e
cma-262)the definition of 'array.prototype.pop' in that specification. ...
Array.prototype.push() - JavaScript
// every time an element is added. [].push.call(this, elem) } } // let's add some empty objects just to illustrate. obj.addelem({}) obj.addelem({}) console.log(obj.length) // → 2 note that although obj is not an array, the method push successfully incremented obj's length property just like if we were dealing with an actual array. specifications specification e
cmascript (e
cma-262)the definition of 'array.prototype.push' in that specification. ...
Array.prototype.reverse() - JavaScript
s and a length property, then reverses the array-like object. the call to reverse() returns a reference to the reversed array-like object a. const a = {0: 1, 1: 2, 2: 3, length: 3}; console.log(a); // {0: 1, 1: 2, 2: 3, length: 3} array.prototype.reverse.call(a); //same syntax for using apply() console.log(a); // {0: 3, 1: 2, 2: 1, length: 3} specifications specification e
cmascript (e
cma-262)the definition of 'array.prototype.reverse' in that specification. ...
Array.prototype.shift() - JavaScript
in while loop the shift() method is often used in condition inside while loop. in the following example every iteration will remove the next element from an array, until it is empty: var names = ["andrew", "edward", "paul", "chris" ,"john"]; while( (i = names.shift()) !== undefined ) { console.log(i); } // andrew, edward, paul, chris, john specifications specification e
cmascript (e
cma-262)the definition of 'array.prototype.shift' in that specification. ...
Array.prototype.values() - JavaScript
. var arr = ['a', 'b', 'c', 'd', 'e']; var iterator = arr.values(); console.log(iterator); // array iterator { } iterator.next().value; // "a" arr[1]='n'; iterator.next().value; // "n" if the values in the array changed the array iterator object values change too. todo: please write about why we need it, use cases. specifications specification e
cmascript (e
cma-262)the definition of 'array.prototype.values' in that specification. ...
Array - JavaScript
, , , , , , p,p,p,p, ,p,p,p r,n,b,q,k,b,n,r using an array to tabulate a set of values values = [] for (let x = 0; x < 10; x++){ values.push([ 2 ** x, 2 * x ** 2 ]) } console.table(values) results in // the first column is the index 0 1 0 1 2 2 2 4 8 3 8 18 4 16 32 5 32 50 6 64 72 7 128 98 8 256 128 9 512 162 specifications specification initial publication e
cmascript (e
cma-262)the definition of 'array' in that specification. e
cmascript 1 ...
get ArrayBuffer[@@species] - JavaScript
arraybuffer species is the myarraybuffer constructor. however, you might want to overwrite this, in order to return parent arraybuffer objects in your derived class methods: class myarraybuffer extends arraybuffer { // overwrite myarraybuffer species to the parent arraybuffer constructor static get [symbol.species]() { return arraybuffer; } } specifications specification e
cmascript (e
cma-262)the definition of 'get arraybuffer [ @@species ]' in that specification. ...
ArrayBuffer.prototype.slice() - JavaScript
end of the array, as opposed to from the beginning. the range specified by the begin and end parameters is clamped to the valid index range for the current array. if the computed length of the new arraybuffer would be negative, it is clamped to zero. examples copying an arraybuffer const buf1 = new arraybuffer(8); const buf2 = buf1.slice(0); specifications specification e
cmascript (e
cma-262)the definition of 'arraybuffer.prototype.slice' in that specification. ...
ArrayBuffer - JavaScript
e) up to end (exclusive). if either begin or end is negative, it refers to an index from the end of the array, as opposed to from the beginning. examples creating an arraybuffer in this example, we create a 8-byte buffer with a int32array view referring to the buffer: const buffer = new arraybuffer(8); const view = new int32array(buffer); specifications specification e
cmascript (e
cma-262)the definition of 'arraybuffer' in that specification. ...
Atomics.add() - JavaScript
y[index]). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if index is out of bounds in the typedarray. examples using add() const sab = new sharedarraybuffer(1024); const ta = new uint8array(sab); atomics.add(ta, 0, 12); // returns 0, the old value atomics.load(ta, 0); // 12 specifications specification e
cmascript (e
cma-262)the definition of 'atomics.add' in that specification. ...
Atomics.compareExchange() - JavaScript
eerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if index is out of bounds in the typedarray. examples using compareexchange() const sab = new sharedarraybuffer(1024); const ta = new uint8array(sab); ta[0] = 7; atomics.compareexchange(ta, 0, 7, 12); // returns 7, the old value atomics.load(ta, 0); // 12 specifications specification e
cmascript (e
cma-262)the definition of 'atomics.compareexchange' in that specification. ...
Atomics.isLockFree() - JavaScript
turn value a boolean indicating whether the operation is lock free. examples using islockfree atomics.islockfree(1); // true atomics.islockfree(2); // true atomics.islockfree(3); // false atomics.islockfree(4); // true atomics.islockfree(5); // false atomics.islockfree(6); // false atomics.islockfree(7); // false atomics.islockfree(8); // true specifications specification e
cmascript (e
cma-262)the definition of 'atomics.islockfree' in that specification. ...
Atomics.load() - JavaScript
at the given position (typedarray[index]). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if index is out of bounds in the typedarray. examples using load const sab = new sharedarraybuffer(1024); const ta = new uint8array(sab); atomics.add(ta, 0, 12); atomics.load(ta, 0); // 12 specifications specification e
cmascript (e
cma-262)the definition of 'atomics.load' in that specification. ...
Atomics.store() - JavaScript
r to store. return value the value that has been stored. exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if index is out of bounds in the typedarray. examples using store() var sab = new sharedarraybuffer(1024); var ta = new uint8array(sab); atomics.store(ta, 0, 12); // 12 specifications specification e
cmascript (e
cma-262)the definition of 'atomics.store' in that specification. ...
Atomics.sub() - JavaScript
). exceptions throws a typeerror, if typedarray is not one of the allowed integer types. throws a rangeerror, if index is out of bounds in the typedarray. examples using sub const sab = new sharedarraybuffer(1024); const ta = new uint8array(sab); ta[0] = 48; atomics.sub(ta, 0, 12); // returns 48, the old value atomics.load(ta, 0); // 36 specifications specification e
cmascript (e
cma-262)the definition of 'atomics.sub' in that specification. ...
BigInt() constructor - JavaScript
the bigint() constructor returns a value of type bigint. syntax bigint(value); parameters value the numeric value of the object being created. may be a string or an integer. note: bigint() is not used with the new operator. examples creating a new bigint bigint(123); // 123n specifications specification e
cmascript (e
cma-262)the definition of 'bigint constructor' in that specification. ...
BigInt.asIntN() - JavaScript
f bigint modulo 2width as a signed integer. examples staying in 64-bit ranges the bigint.asintn() method can be useful to stay in the range of 64-bit arithmetic. const max = 2n ** (64n - 1n) - 1n; bigint.asintn(64, max); // ↪ 9223372036854775807n bigint.asintn(64, max + 1n); // ↪ -9223372036854775807n // negative because of overflow specifications specification e
cmascript (e
cma-262)the definition of 'bigint.asintn()' in that specification. ...
BigInt.asUintN() - JavaScript
. returns the value of bigint modulo 2width as an unsigned integer. examples staying in 64-bit ranges the bigint.asuintn() method can be useful to stay in the range of 64-bit arithmetic. const max = 2n ** 64n - 1n; bigint.asuintn(64, max); // ↪ 18446744073709551615n bigint.asuintn(64, max + 1n); // ↪ 0n // zero because of overflow specifications specification e
cmascript (e
cma-262)the definition of 'bigint.asuintn()' in that specification. ...
Boolean.prototype.toString() - JavaScript
when a boolean is referred to in a string concatenation. for boolean objects and values, the built-in tostring() method returns the string "true" or "false" depending on the value of the boolean object. examples using tostring() in the following code, flag.tostring() returns "true": var flag = new boolean(true); var myvar = flag.tostring(); specifications specification e
cmascript (e
cma-262)the definition of 'boolean.prototype.tostring' in that specification. ...
DataView.prototype.byteOffset - JavaScript
lue is established when an dataview is constructed and cannot be changed. examples using the byteoffset property var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.byteoffset; // 0 (no offset specified) var dataview2 = new dataview(buffer, 3); dataview2.byteoffset; // 3 (as specified when constructing the dataview) specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.byteoffset' in that specification. ...
DataView.prototype.getBigUint64() - JavaScript
thrown rangeerror thrown if the byteoffset is set such that it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getbiguint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getbiguint64(0); // 0n specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.getbiguint64()' in that specification. ...
DataView.prototype.getInt16() - JavaScript
r. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint16(1); // 0 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.getint16' in that specification. ...
DataView.prototype.getInt32() - JavaScript
r. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint32(1); // 0 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.getint32' in that specification. ...
DataView.prototype.getInt8() - JavaScript
ber. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getint8(1); // 0 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.getint8' in that specification. ...
DataView.prototype.getUint8() - JavaScript
r. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. examples using the getuint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.getuint8(1); // 0 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.getuint8' in that specification. ...
DataView.prototype.setBigInt64() - JavaScript
ed, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such that it would store beyond the end of the view. examples using the setbigint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setbigint64(0, 3n); dataview.getbigint64(0); // 3n specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.setbigint64()' in that specification. ...
DataView.prototype.setBigUint64() - JavaScript
a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such that it would store beyond the end of the view. examples using the setbiguint64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setbiguint64(0, 3n); dataview.getbiguint64(0); // 3n specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.setbiguint64()' in that specification. ...
DataView.prototype.setFloat32() - JavaScript
undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setfloat32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setfloat32(1, 3); dataview.getfloat32(1); // 3 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.setfloat32' in that specification. ...
DataView.prototype.setFloat64() - JavaScript
undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setfloat64 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setfloat64(0, 3); dataview.getfloat64(0); // 3 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.setfloat64' in that specification. ...
DataView.prototype.setInt16() - JavaScript
se or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setint16(1, 3); dataview.getint16(1); // 3 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.setint16' in that specification. ...
DataView.prototype.setInt32() - JavaScript
se or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setint32(1, 3); dataview.getint32(1); // 3 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.setint32' in that specification. ...
DataView.prototype.setInt8() - JavaScript
where to store the data. value the value to set. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setint8(1, 3); dataview.getint8(1); // 3 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.setint8' in that specification. ...
DataView.prototype.setUint16() - JavaScript
or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setuint16 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setuint16(1, 3); dataview.getuint16(1); // 3 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.setuint16' in that specification. ...
DataView.prototype.setUint32() - JavaScript
or undefined, a big-endian value is written. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setuint32 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setuint32(1, 3); dataview.getuint32(1); // 3 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.setuint32' in that specification. ...
DataView.prototype.setUint8() - JavaScript
re to store the data. value the value to set. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. examples using the setuint8 method var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.setuint8(1, 3); dataview.getuint8(1); // 3 specifications specification e
cmascript (e
cma-262)the definition of 'dataview.prototype.setuint8' in that specification. ...
DataView - JavaScript
byte offset from the start of the view. dataview.prototype.setbiguint64() stores an unsigned 64-bit integer (unsigned long long) value at the specified byte offset from the start of the view. examples using dataview var buffer = new arraybuffer(16); var view = new dataview(buffer, 0); view.setint16(1, 42); view.getint16(1); // 42 specifications specification e
cmascript (e
cma-262)the definition of 'dataview' in that specification. ...
Date.prototype.getDay() - JavaScript
" for example) can be obtained by using intl.datetimeformat with an options parameter. using this method, the internationalization is made easier: var options = { weekday: 'long'}; console.log(new intl.datetimeformat('en-us', options).format(xmas95)); // monday console.log(new intl.datetimeformat('de-de', options).format(xmas95)); // montag specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.getday' in that specification. ...
Date.prototype.getFullYear() - JavaScript
tween the years 1000 and 9999, getfullyear() returns a four-digit number, for example, 1995. use this function to make sure a year is compliant with years after 2000. examples using getfullyear() the following example assigns the four-digit value of the current year to the variable year. var today = new date(); var year = today.getfullyear(); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.getfullyear' in that specification. ...
Date.prototype.getHours() - JavaScript
r, between 0 and 23, representing the hour for the given date according to local time. examples using gethours() the second statement below assigns the value 23 to the variable hours, based on the value of the date object xmas95. let xmas95 = new date('december 25, 1995 23:15:30'); let hours = xmas95.gethours(); console.log(hours); // 23 specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.gethours' in that specification. ...
Date.prototype.getMinutes() - JavaScript
en 0 and 59, representing the minutes in the given date according to local time. examples using getminutes() the second statement below assigns the value 15 to the variable minutes, based on the value of the date object xmas95. var xmas95 = new date('december 25, 1995 23:15:30'); var minutes = xmas95.getminutes(); console.log(minutes); // 15 specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.getminutes' in that specification. ...
Date.prototype.getMonth() - JavaScript
uary" for example) can be obtained by using intl.datetimeformat() with an options parameter. using this method, internationalization is made easier: var options = { month: 'long'}; console.log(new intl.datetimeformat('en-us', options).format(xmas95)); // december console.log(new intl.datetimeformat('de-de', options).format(xmas95)); // dezember specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.getmonth' in that specification. ...
Date.prototype.getSeconds() - JavaScript
en 0 and 59, representing the seconds in the given date according to local time. examples using getseconds() the second statement below assigns the value 30 to the variable seconds, based on the value of the date object xmas95. var xmas95 = new date('december 25, 1995 23:15:30'); var seconds = xmas95.getseconds(); console.log(seconds); // 30 specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.getseconds' in that specification. ...
Date.prototype.getTime() - JavaScript
tween these two calls. this can be used to calculate the executing time of some operations. see also date.now() to prevent instantiating unnecessary date objects. var end, start; start = new date(); for (var i = 0; i < 1000; i++) { math.sqrt(i); } end = new date(); console.log('operation took ' + (end.gettime() - start.gettime()) + ' msec'); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.gettime' in that specification. ...
Date.prototype.getUTCDate() - JavaScript
rsal time. syntax dateobj.getutcdate() return value an integer number, between 1 and 31, representing the day of the month in the given date according to universal time. examples using getutcdate() the following example assigns the day portion of the current date to the variable day. var today = new date(); var day = today.getutcdate(); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.getutcdate' in that specification. ...
Date.prototype.getUTCFullYear() - JavaScript
ate according to universal time. description the value returned by getutcfullyear() is an absolute number that is compliant with year-2000, for example, 1995. examples using getutcfullyear() the following example assigns the four-digit value of the current year to the variable year. var today = new date(); var year = today.getutcfullyear(); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.getutcfullyear' in that specification. ...
Date.prototype.getUTCHours() - JavaScript
pull request. syntax dateobj.getutchours() return value an integer number, between 0 and 23, representing the hours in the given date according to universal time. examples using getutchours() the following example assigns the hours portion of the current time to the variable hours. var today = new date(); var hours = today.getutchours(); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.getutchours' in that specification. ...
Date.prototype.setMilliseconds() - JavaScript
ted date. description if you specify a number outside the expected range, the date information in the date object is updated accordingly. for example, if you specify 1005, the number of seconds is incremented by 1, and 5 is used for the milliseconds. examples using setmilliseconds() var thebigday = new date(); thebigday.setmilliseconds(100); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.setmilliseconds' in that specification. ...
Date.prototype.setMonth() - JavaScript
, calling setmonth with a value of 1 will return 2nd march 2016. this is because in 2016 february had 29 days. examples using setmonth() var thebigday = new date(); thebigday.setmonth(6); //watch out for end of month transitions var endofmonth = new date(2016, 7, 31); endofmonth.setmonth(1); console.log(endofmonth); //wed mar 02 2016 00:00:00 specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.setmonth' in that specification. ...
Date.prototype.setYear() - JavaScript
umber between 0 and 99 (inclusive), then the year for dateobj is set to 1900 + yearvalue. otherwise, the year for dateobj is set to yearvalue. examples using setyear() the first two lines set the year to 1996. the third sets the year to 2000. var thebigday = new date(); thebigday.setyear(96); thebigday.setyear(1996); thebigday.setyear(2000); specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.setyear' in that specification. ...
Date.prototype.toJSON() - JavaScript
tojson() returns a string (using toisostring()) representing the date object's value. this method is generally intended to, by default, usefully serialize date objects during json serialization. examples using tojson() var jsondate = (new date()).tojson(); var backtodate = new date(jsondate); console.log(jsondate); //2015-10-26t07:46:36.611z specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.tojson' in that specification. ...
Date.prototype.toLocaleDateString() - JavaScript
c', month: 'long', day: 'numeric' }; console.log(date.tolocaledatestring('de-de', options)); // → "donnerstag, 20. dezember 2012" // an application may want to use utc and make that visible options.timezone = 'utc'; options.timezonename = 'short'; console.log(date.tolocaledatestring('en-us', options)); // → "thursday, december 20, 2012, gmt" specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.tolocaledatestring' in that specification. e
cmascript internationalization api (e
cma-402)the definition of 'date.prototype.tolocaledatestring' in that specification. ...
Date.prototype.toLocaleString() - JavaScript
enated with other text. for this reason, you cannot expect to be able to compare the results of tolocalestring() to a static value: "1/1/2019, 01:00:00" === new date("2019-01-01t01:00:00z").tolocalestring("en-us"); // true in firefox and others // false in ie and edge note: see also this stackoverflow thread for more details and examples. specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.tolocalestring' in that specification. e
cmascript internationalization api (e
cma-402)the definition of 'date.prototype.tolocalestring' in that specification. ...
Date.prototype.valueOf() - JavaScript
the number of milliseconds since midnight 01 january, 1970 utc. this method is functionally equivalent to the date.prototype.gettime() method. this method is usually called internally by javascript and not explicitly in code. examples using valueof() var x = new date(56, 6, 17); var myvar = x.valueof(); // assigns -424713600000 to myvar specifications specification e
cmascript (e
cma-262)the definition of 'date.prototype.valueof' in that specification. ...
Error() constructor - JavaScript
new, it will return an error object. therefore, a mere call to error will produce the same output that constructing an error object via the new keyword would. // this... const x = error('i was created using a function call!') // ...has the same functionality as this. const y = new error('i was constructed via the "new" keyword!') specifications specification e
cmascript (e
cma-262)the definition of 'error constructor' in that specification. ...
Error.prototype.message - JavaScript
ate a string representation of the error. by default, the message property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the error constructor. examples throwing a custom error var e = new error('could not parse input'); // e.message is 'could not parse input' throw e; specifications specification e
cmascript (e
cma-262)the definition of 'error.prototype.message' in that specification. ...
Error.prototype.name - JavaScript
"error". the name property, in addition to the message property, is used by the error.prototype.tostring() method to create a string representation of the error. examples throwing a custom error var e = new error('malformed input'); // e.name is 'error' e.name = 'parseerror'; throw e; // e.tostring() would return 'parseerror: malformed input' specifications specification e
cmascript (e
cma-262)the definition of 'error.prototype.name' in that specification. ...
Generator.prototype.next() - JavaScript
next is called with a value. note that the first call does not log anything, because the generator was not yielding anything initially. function* gen() { while (true) { let value = yield null; console.log(value); } } const g = gen(); g.next(1); // "{ value: null, done: false }" g.next(2); // 2 // "{ value: null, done: false }" specifications specification e
cmascript (e
cma-262)the definition of 'generator.prototype.next' in that specification. ...
Generator.prototype.return() - JavaScript
the returned object. function* gen() { yield 1; yield 2; yield 3; } const g = gen(); g.next(); // { value: 1, done: false } g.next(); // { value: 2, done: false } g.next(); // { value: 3, done: false } g.next(); // { value: undefined, done: true } g.return(); // { value: undefined, done: true } g.return(1); // { value: 1, done: true } specifications specification e
cmascript (e
cma-262)the definition of 'generator.prototype.return' in that specification. ...
Generator.prototype.throw() - JavaScript
ow method. an error can be caught by a try...catch block as usual. function* gen() { while(true) { try { yield 42; } catch(e) { console.log('error caught!'); } } } const g = gen(); g.next(); // { value: 42, done: false } g.throw(new error('something went wrong')); // "error caught!" // { value: 42, done: false } specifications specification e
cmascript (e
cma-262)the definition of 'generator.prototype.throw' in that specification. ...
Generator - JavaScript
ss caught from within that generator). examples an infinite iterator function* infinite() { let index = 0; while (true) { yield index++; } } const generator = infinite(); // "generator { }" console.log(generator.next().value); // 0 console.log(generator.next().value); // 1 console.log(generator.next().value); // 2 // ... specifications specification e
cmascript (e
cma-262)the definition of 'generator objects' in that specification. ...
GeneratorFunction - JavaScript
sing the new operator) has the same effect as invoking it as a constructor. examples creating a generator function from a generatorfunction() constructor var generatorfunction = object.getprototypeof(function*(){}).constructor var g = new generatorfunction('a', 'yield a * 2'); var iterator = g(10); console.log(iterator.next().value); // 20 specifications specification e
cmascript (e
cma-262)the definition of 'generatorfunction' in that specification. ...
Intl.Locale() constructor - JavaScript
s an optional configuration object argument, which can contain any of several extension types. for example, set the hourcycle property of the configuration object to your desired hour cycle type, and then pass it into the constructor: let us12hour = new intl.locale("en-us", {hourcycle: "h12"}); console.log(us12hour.hourcycle); // prints "h12" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale.prototype.baseName - JavaScript
apan.basename); // prints out "ja-jp" example with options that override input string // input string indicates language as dutch and region as belgium, // but options object overrides the region and sets it to the netherlands let dutch = new intl.locale("nl-latn-be", {region: "nl"}); console.log(dutch.basename); // prints out "nl-latn-nl" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale.prototype.calendar - JavaScript
figuration object argument, which can contain any of several extension types, including calendars. set the calendar property of the configuration object to your desired calendar era, and then pass it into the constructor. let frbuddhist = new intl.locale("fr-fr", {calendar: "buddhist"}); console.log(frbuddhist.calendar); // prints "buddhist" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale.prototype.caseFirst - JavaScript
uctor has an optional configuration object argument, which can be used to pass extension types. set the casefirst property of the configuration object to your desired casefirst value, and then pass it into the constructor. let casefirstobj= new intl.locale("en-latn-us", {casefirst: "lower"}); console.log(us12hour.casefirst); // prints "lower" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale.prototype.collation - JavaScript
n object argument, which can contain any of several extension types, including collation types. set the collation property of the configuration object to your desired collation type, and then pass it into the constructor. let configcoll = new intl.locale("en-latn-us", {collation: "emoji"}); console.log(configcoll.collation); // prints "emoji" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale.prototype.hourCycle - JavaScript
onfiguration object argument, which can contain any of several extension types, including hour cycle types. set the hourcycle property of the configuration object to your desired hour cycle type, and then pass it into the constructor. let us12hour = new intl.locale("en-us", {hourcycle: "h12"}); console.log(us12hour.hourcycle); // prints "h12" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale.prototype.language - JavaScript
console.log(langstr.language); // prints "en" overriding language via the configuration object while the language subtag must be specified, the locale constructor takes a configuration object, which can override the language subtag. let langobj = new intl.locale("en-latn-us", {language: "es"}); console.log(langobj.language); // prints "es" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale.prototype.numberingSystem - JavaScript
iguration object argument, which can be used to pass extension types. set the numberingsystem property of the configuration object to your desired numberingsystem value and pass it into the constructor. let numberingsystemviaobj= new intl.locale("en-latn-us", {numberingsystem: "latn"}); console.log(us12hour.numberingsystem); // prints "latn" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale.prototype.numeric - JavaScript
tl.locale constructor has an optional configuration object argument, which can be used to pass extension types. set the numeric property of the configuration object to your desired numeric value and pass it into the constructor. let numericviaobj= new intl.locale("en-latn-us", {numeric: true}); console.log(us12hour.numeric); // prints "true" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale.prototype.region - JavaScript
new intl.locale("en-latn-us"); console.log(regionstr.region); // prints "us" setting the region via the configuration object the locale constructor takes a configuration object, which can be used to set the region subtag and property. let regionobj = new intl.locale("fr-latn", {region: "fr"}); console.log(regionobj.region); // prints "fr" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale.prototype.script - JavaScript
intl.locale("en-latn-us"); console.log(scriptstr.script); // prints "latn" setting the script via the configuration object the locale constructor takes a configuration object, which can be used to set the script subtag and property. let scriptobj = new intl.locale("fr-fr", {script: "latn"}); console.log(scriptobj.script); // prints "latn" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale.prototype.toString() - JavaScript
tructors, serialized in json, or any other context where an exact string representation is useful. examples using tostring let mylocale = new intl.locale("fr-latn-fr", {hourcycle: "h24", calendar: "gregory"}); console.log(mylocale.basename); // prints "fr-latn-fr" console.log(mylocale.tostring()); // prints "fr-latn-fr-u-ca-gregory-hc-h24" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.Locale - JavaScript
s an optional configuration object argument, which can contain any of several extension types. for example, set the hourcycle property of the configuration object to your desired hour cycle type, and then pass it into the constructor: let us12hour = new intl.locale("en-us", {hourcycle: "h12"}); console.log(us12hour.hourcycle); // prints "h12" specifications specification e
cmascript internationalization api (e
cma-402) ...
Intl.NumberFormat.prototype.format() - JavaScript
n which is no longer followed for new features, but is preserved to maintain compatibility with existing programs. var a = [123456.789, 987654.321, 456789.123]; var numberformat = new intl.numberformat('es-es'); var formatted = a.map(n => numberformat.format(n)); console.log(formatted.join('; ')); // → "123.456,789; 987.654,321; 456.789,123" specifications specification e
cmascript internationalization api (e
cma-402)the definition of 'intl.numberformat.prototype.format' in that specification. ...
Intl.PluralRules() constructor - JavaScript
to ordinal. this is useful to figure out the ordinal indicator, e.g. "1st", "2nd", "3rd", "4th", "42nd" and so forth. var pr = new intl.pluralrules('en-us', { type: 'ordinal' }); pr.select(0); // → 'other' pr.select(1); // → 'one' pr.select(2); // → 'two' pr.select(3); // → 'few' pr.select(4); // → 'other' pr.select(42); // → 'two' specifications specification e
cmascript internationalization api (e
cma-402)the definition of 'intl.pluralrules() constructor' in that specification. ...
Intl.PluralRules.select() - JavaScript
atting options of a pluralrules object. examples using select() new intl.pluralrules('ar-eg').select(0); // → 'zero' new intl.pluralrules('ar-eg').select(1); // → 'one' new intl.pluralrules('ar-eg').select(2); // → 'two' new intl.pluralrules('ar-eg').select(6); // → 'few' new intl.pluralrules('ar-eg').select(18); // → 'many' specifications specification e
cmascript internationalization api (e
cma-402)the definition of 'intl.pluralrules.select()' in that specification. ...
Intl.RelativeTimeFormat() constructor - JavaScript
me formatter in your locale // with numeric: "auto" option value passed in. const rtf = new intl.relativetimeformat("en", { numeric: "auto" }); // format relative time using negative value (-1). rtf.format(-1, "day"); // > "yesterday" // format relative time using positive day unit (1). rtf.format(1, "day"); // > "tomorrow" specifications specification status comment e
cmascript internationalization api (e
cma-402)the definition of 'relativetimeformat()' in that specification. stage 4 ...
Intl.RelativeTimeFormat.prototype.format() - JavaScript
me formatter in your locale // with numeric: "auto" option value passed in. const rtf = new intl.relativetimeformat("en", { numeric: "auto" }); // format relative time using negative value (-1). rtf.format(-1, "day"); // > "yesterday" // format relative time using positive day unit (1). rtf.format(1, "day"); // > "tomorrow" specifications specification status comment e
cmascript internationalization api (e
cma-402)the definition of 'relativetimeformat.format()' in that specification. stage 4 ...
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
ey "nu" or filled in as a default. 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 e
cmascript internationalization api (e
cma-402)the definition of 'relativetimeformat.resolvedoptions()' in that specification. stage 4 ...
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
since most balinese speakers also understand indonesian, and therefore return the balinese language tag as well. const locales = ['ban', 'id-u-co-pinyin', 'de-id']; const options = { localematcher: 'lookup' }; console.log(intl.relativetimeformat.supportedlocalesof(locales, options).join(', ')); // → "id-u-co-pinyin, de-id" specifications specification status comment e
cmascript internationalization api (e
cma-402)the definition of 'relativetimeformat.supportedlocalesof()' in that specification. stage 4 ...
Intl.RelativeTimeFormat - JavaScript
meformat("en", { numeric: "auto" }); // format relative time using the day unit. rtf.formattoparts(-1, "day"); // > [{ type: "literal", value: "yesterday"}] rtf.formattoparts(100, "day"); // > [{ type: "literal", value: "in " }, // > { type: "integer", value: "100", unit: "day" }, // > { type: "literal", value: " days" }] specifications specification status comment e
cmascript internationalization api (e
cma-402)the definition of 'relativetimeformat' in that specification. ...
Intl.getCanonicalLocales() - JavaScript
ch to get the canonical locale names. return value an array containing the canonical locale names. examples using getcanonicallocales intl.getcanonicallocales('en-us'); // ["en-us"] intl.getcanonicallocales(['en-us', 'fr']); // ["en-us", "fr"] intl.getcanonicallocales('en_us'); // rangeerror:'en_us' is not a structurally valid language tag specifications specification e
cmascript internationalization api (e
cma-402)the definition of 'intl.getcanonicallocales' in that specification. ...
JSON.parse() - JavaScript
s "". return value; // return the unchanged property value. }); // 1 // 2 // 4 // 6 // 5 // 3 // "" json.parse() does not allow trailing commas // both will throw a syntaxerror json.parse('[1, 2, 3, 4, ]'); json.parse('{"foo" : 1, }'); json.parse() does not allow single quotes // will throw a syntaxerror json.parse("{'foo': 1}"); specifications specification e
cmascript (e
cma-262)the definition of 'json.parse' in that specification. ...
get Map[@@species] - JavaScript
a derived collection object (e.g. your custom map mymap), the mymap species is the mymap constructor. however, you might want to overwrite this, in order to return parent map objects in your derived class methods: class mymap extends map { // overwrite mymap species to the parent map constructor static get [symbol.species]() { return map; } } specifications specification e
cmascript (e
cma-262)the definition of 'get map [ @@species ]' in that specification. ...
Map.prototype[@@toStringTag] - JavaScript
s and send us a pull request. property attributes of map.prototype[@@tostringtag] writable no enumerable no configurable yes syntax map[symbol.tostringtag] examples using tostringtag object.prototype.tostring.call(new map()) // "[object map]" specifications specification e
cmascript (e
cma-262)the definition of 'map.prototype[@@tostringtag]' in that specification. ...
Map.prototype.clear() - JavaScript
please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax mymap.clear(); return value undefined. examples using clear() var mymap = new map(); mymap.set('bar', 'baz'); mymap.set(1, 'foo'); mymap.size; // 2 mymap.has('bar'); // true mymap.clear(); mymap.size; // 0 mymap.has('bar') // false specifications specification e
cmascript (e
cma-262)the definition of 'map.prototype.clear' in that specification. ...
Map.prototype.delete() - JavaScript
bject. return value true if an element in the map object existed and has been removed, or false if the element does not exist. examples using delete() var mymap = new map(); mymap.set('bar', 'foo'); mymap.delete('bar'); // returns true. successfully removed. mymap.has('bar'); // returns false. the "bar" element is no longer present. specifications specification e
cmascript (e
cma-262)the definition of 'map.prototype.delete' in that specification. e
cmascript 2015 (6th edition, e
cma-262)the definition of 'map.prototype.delete' in that specification. ...
Map.prototype.entries() - JavaScript
s() return value a new map iterator object. examples using entries() let mymap = new map() mymap.set('0', 'foo') mymap.set(1, 'bar') mymap.set({}, 'baz') let mapiter = mymap.entries() console.log(mapiter.next().value) // ["0", "foo"] console.log(mapiter.next().value) // [1, "bar"] console.log(mapiter.next().value) // [object, "baz"] specifications specification e
cmascript (e
cma-262)the definition of 'map.prototype.entries' in that specification. ...
Map.prototype.get() - JavaScript
y) parameters key the key of the element to return from the map object. return value the element associated with the specified key, or undefined if the key can't be found in the map object. examples using get() let mymap = new map(); mymap.set('bar', 'foo'); mymap.get('bar'); // returns "foo" mymap.get('baz'); // returns undefined specifications specification e
cmascript (e
cma-262)the definition of 'map.prototype.get' in that specification. ...
Map.prototype.keys() - JavaScript
pull request. syntax mymap.keys() return value a new map iterator object. examples using keys() var mymap = new map(); mymap.set('0', 'foo'); mymap.set(1, 'bar'); mymap.set({}, 'baz'); var mapiter = mymap.keys(); console.log(mapiter.next().value); // "0" console.log(mapiter.next().value); // 1 console.log(mapiter.next().value); // object specifications specification e
cmascript (e
cma-262)the definition of 'map.prototype.keys' in that specification. ...
Map.prototype.size - JavaScript
amples and send us a pull request. description the value of size is an integer representing how many entries the map object has. a set accessor function for size is undefined; you can not change this property. examples using size var mymap = new map(); mymap.set('a', 'alpha'); mymap.set('b', 'beta'); mymap.set('g', 'gamma'); mymap.size // 3 specifications specification e
cmascript (e
cma-262)the definition of 'map.prototype.size' in that specification. ...
Map.prototype.values() - JavaScript
st. syntax mymap.values() return value a new map iterator object. examples using values() var mymap = new map(); mymap.set('0', 'foo'); mymap.set(1, 'bar'); mymap.set({}, 'baz'); var mapiter = mymap.values(); console.log(mapiter.next().value); // "foo" console.log(mapiter.next().value); // "bar" console.log(mapiter.next().value); // "baz" specifications specification e
cmascript (e
cma-262)the definition of 'map.prototype.values' in that specification. ...
Math.abs() - JavaScript
ed/empty variable returns nan. passing null, an empty string or an empty array returns 0. math.abs('-1'); // 1 math.abs(-2); // 2 math.abs(null); // 0 math.abs(''); // 0 math.abs([]); // 0 math.abs([2]); // 2 math.abs([1,2]); // nan math.abs({}); // nan math.abs('string'); // nan math.abs(); // nan specifications specification e
cmascript (e
cma-262)the definition of 'math.abs' in that specification. ...
Math.acos() - JavaScript
as a method of a math object you created (math is not a constructor). examples using math.acos() math.acos(-2); // nan math.acos(-1); // 3.141592653589793 math.acos(0); // 1.5707963267948966 math.acos(0.5); // 1.0471975511965979 math.acos(1); // 0 math.acos(2); // nan for values less than -1 or greater than 1, math.acos() returns nan. specifications specification e
cmascript (e
cma-262)the definition of 'math.acos' in that specification. ...
Math.asin() - JavaScript
object you created (math is not a constructor). examples using math.asin() math.asin(-2); // nan math.asin(-1); // -1.5707963267948966 (-pi/2) math.asin(0); // 0 math.asin(0.5); // 0.5235987755982989 math.asin(1); // 1.5707963267948966 (pi/2) math.asin(2); // nan for values less than -1 or greater than 1, math.asin() returns nan. specifications specification e
cmascript (e
cma-262)the definition of 'math.asin' in that specification. ...
Math.atan2() - JavaScript
// -pi/2 for y > 0. math.atan2(y, ±0); // pi/2 for y > 0. math.atan2(±y, -infinity); // ±pi for finite y > 0. math.atan2(±y, +infinity); // ±0 for finite y > 0. math.atan2(±infinity, x); // ±pi/2 for finite x. math.atan2(±infinity, -infinity); // ±3*pi/4. math.atan2(±infinity, +infinity); // ±pi/4. specifications specification e
cmascript (e
cma-262)the definition of 'math.atan2' in that specification. ...
Math.cos() - JavaScript
sents the cosine of the angle. because cos() is a static method of math, you always use it as math.cos(), rather than as a method of a math object you created (math is not a constructor). examples using math.cos() math.cos(0); // 1 math.cos(1); // 0.5403023058681398 math.cos(math.pi); // -1 math.cos(2 * math.pi); // 1 specifications specification e
cmascript (e
cma-262)the definition of 'math.cos' in that specification. ...
Math.exp() - JavaScript
ting ex, where e is euler's number and x is the argument. description because exp() is a static method of math, you always use it as math.exp(), rather than as a method of a math object you created (math is not a constructor). examples using math.exp() math.exp(-1); // 0.36787944117144233 math.exp(0); // 1 math.exp(1); // 2.718281828459045 specifications specification e
cmascript (e
cma-262)the definition of 'math.exp' in that specification. ...
Math.expm1() - JavaScript
an as a method of a math object you created (math is not a constructor). polyfill this can be emulated with the help of the math.exp() function: math.expm1 = math.expm1 || function(x) { return math.exp(x) - 1; }; examples using math.expm1() math.expm1(-1); // -0.6321205588285577 math.expm1(0); // 0 math.expm1(1); // 1.718281828459045 specifications specification e
cmascript (e
cma-262)the definition of 'math.expm1' in that specification. ...
Math.log10() - JavaScript
ch is 1 / math.ln10. examples using math.log10() math.log10(2); // 0.3010299956639812 math.log10(1); // 0 math.log10(0); // -infinity math.log10(-2); // nan math.log10(100000); // 5 polyfill this can be emulated with the following function: math.log10 = math.log10 || function(x) { return math.log(x) * math.log10e; }; specifications specification e
cmascript (e
cma-262)the definition of 'math.log10' in that specification. ...
Math.log2() - JavaScript
me inputs (like 1 << 29), wrap into math.round() if working with bit masks. if (!math.log2) math.log2 = function(x) { return math.log(x) * math.log2e; }; examples using math.log2() math.log2(3); // 1.584962500721156 math.log2(2); // 1 math.log2(1); // 0 math.log2(0); // -infinity math.log2(-2); // nan math.log2(1024); // 10 specifications specification e
cmascript (e
cma-262)the definition of 'math.log2' in that specification. ...
Math.round() - JavaScript
ractional part of exactly 0.5. because round() is a static method of math, you always use it as math.round(), rather than as a method of a math object you created (math has no constructor). examples using round math.round( 20.49); // 20 math.round( 20.5 ); // 21 math.round( 42 ); // 42 math.round(-20.5 ); // -20 math.round(-20.51); // -21 specifications specification e
cmascript (e
cma-262)the definition of 'math.round' in that specification. ...
Math.sin() - JavaScript
1, which represents the sine of the angle given in radians. because sin() is a static method of math, you always use it as math.sin(), rather than as a method of a math object you created (math is not a constructor). examples using math.sin() math.sin(0); // 0 math.sin(1); // 0.8414709848078965 math.sin(math.pi / 2); // 1 specifications specification e
cmascript (e
cma-262)the definition of 'math.sin' in that specification. ...
Math.sqrt() - JavaScript
.sqrt() returns nan. because sqrt() is a static method of math, you always use it as math.sqrt(), rather than as a method of a math object you created (math is not a constructor). examples using math.sqrt() math.sqrt(9); // 3 math.sqrt(2); // 1.414213562373095 math.sqrt(1); // 1 math.sqrt(0); // 0 math.sqrt(-1); // nan math.sqrt(-0); // -0 specifications specification e
cmascript (e
cma-262)the definition of 'math.sqrt' in that specification. ...
Math.tan() - JavaScript
tor). examples using math.tan() math.tan(1); // 1.5574077246549023 because the math.tan() function accepts radians, but it is often easier to work with degrees, the following function accepts a value in degrees, converts it to radians and returns the tangent. function gettandeg(deg) { var rad = deg * math.pi/180; return math.tan(rad); } specifications specification e
cmascript (e
cma-262)the definition of 'math.tan' in that specification. ...
Number.MAX_VALUE - JavaScript
number.max_value, rather than as a property of a number object you created. examples using max_value the following code multiplies two numeric values. if the result is less than or equal to max_value, the func1 function is called; otherwise, the func2 function is called. if (num1 * num2 <= number.max_value) { func1(); } else { func2(); } specifications specification e
cmascript (e
cma-262)the definition of 'number.max_value' in that specification. ...
Number.MIN_SAFE_INTEGER - JavaScript
53 - 1. see number.issafeinteger() for more information. because min_safe_integer is a static property of number, you always use it as number.min_safe_integer, rather than as a property of a number object you created. examples using min_safe_integer number.min_safe_integer // -9007199254740991 -(math.pow(2, 53) - 1) // -9007199254740991 specifications specification e
cmascript (e
cma-262)the definition of 'number.min_safe_integer' in that specification. ...
Number.MIN_VALUE - JavaScript
ber.min_value, rather than as a property of a number object you created. examples using min_value the following code divides two numeric values. if the result is greater than or equal to min_value, the func1 function is called; otherwise, the func2 function is called. if (num1 / num2 >= number.min_value) { func1(); } else { func2(); } specifications specification e
cmascript (e
cma-262)the definition of 'number.min_value' in that specification. ...
Number.NEGATIVE_INFINITY - JavaScript
the variable smallnumber is assigned a value that is smaller than the minimum value. when the if statement executes, smallnumber has the value -infinity, so smallnumber is set to a more manageable value before continuing. var smallnumber = (-number.max_value) * 2; if (smallnumber === number.negative_infinity) { smallnumber = returnfinite(); } specifications specification e
cmascript (e
cma-262)the definition of 'number.negative_infinity' in that specification. ...
Number() constructor - JavaScript
ctor creates a number object. syntax new number(value) parameters value the numeric value of the object being created. examples creating number objects const a = new number('123'); // a === 123 is false const b = number('123'); // b === 123 is true a instanceof number; // is true b instanceof number; // is false specifications specification e
cmascript (e
cma-262)the definition of 'number constructor' in that specification. ...
Number.parseFloat() - JavaScript
number parsed from the given string. or nan when the first non-whitespace character cannot be converted to a number. polyfill if (number.parsefloat === undefined) { number.parsefloat = parsefloat; } examples number.parsefloat vs parsefloat this method has the same functionality as the global parsefloat() function: number.parsefloat === parsefloat; // true this method is also part of e
cmascript 2015. (its purpose is modularization of globals.) see parsefloat() for more detail and examples. specifications specification e
cmascript (e
cma-262)the definition of 'number.parsefloat' in that specification. ...
Number.parseInt() - JavaScript
. if the radix is smaller than 2 or bigger than 36, and the first non-whitespace character cannot be converted to a number, nan is returned. polyfill if (number.parseint === undefined) { number.parseint = window.parseint } examples number.parseint vs parseint this method has the same functionality as the global parseint() function: number.parseint === parseint // true and is part of e
cmascript 2015 (its purpose is modularization of globals). please see parseint() for more detail and examples. specifications specification e
cmascript (e
cma-262)the definition of 'number.parseint' in that specification. ...
Number.prototype.toExponential() - JavaScript
toexponential(). examples using toexponential var numobj = 77.1234; console.log(numobj.toexponential()); // logs 7.71234e+1 console.log(numobj.toexponential(4)); // logs 7.7123e+1 console.log(numobj.toexponential(2)); // logs 7.71e+1 console.log(77.1234.toexponential()); // logs 7.71234e+1 console.log(77 .toexponential()); // logs 7.7e+1 specifications specification e
cmascript (e
cma-262)the definition of 'number.prototype.toexponential' in that specification. ...
Number.prototype.toFixed() - JavaScript
s '0.00' 2.34.tofixed(1) // returns '2.3' 2.35.tofixed(1) // returns '2.4'. note it rounds up 2.55.tofixed(1) // returns '2.5'. note it rounds down - see warning above -2.34.tofixed(1) // returns -2.3 (due to operator precedence, negative number literals don't return a string...) (-2.34).tofixed(1) // returns '-2.3' specifications specification e
cmascript (e
cma-262)the definition of 'number.prototype.tofixed' in that specification. ...
Number.prototype.valueOf() - JavaScript
ing the primitive value of the specified number object. description this method is usually called internally by javascript and not explicitly in web code. examples using valueof let numobj = new number(10) console.log(typeof numobj) // object let num = numobj.valueof() console.log(num) // 10 console.log(typeof num) // number specifications specification e
cmascript (e
cma-262)the definition of 'number.prototype.valueof' in that specification. ...
Object() constructor - JavaScript
ct() new object(value) parameters value any value. examples creating a new object let o = new object() o.foo = 42 console.log(o) // object { foo: 42 } using object given undefined and null types the following examples store an empty object object in o: let o = new object() let o = new object(undefined) let o = new object(null) specifications specification e
cmascript (e
cma-262)the definition of 'object constructor' in that specification. ...
Object.prototype.constructor - JavaScript
position = this.constructor.parentconstructor.getstartposition() ... summary: manually updating or setting the constructor can lead to differrent and sometimes confusing consequences. to prevent this, just define the role of constructor in each specific case. in most cases, constructor is not used and reassignment of it is not necessary. specifications specification e
cmascript (e
cma-262)the definition of 'object.prototype.constructor' in that specification. ...
Object.defineProperty() - JavaScript
the object. function myclass() { } myclass.prototype.x = 1; object.defineproperty(myclass.prototype, "y", { writable: false, value: 1 }); var a = new myclass(); a.x = 2; console.log(a.x); // 2 console.log(myclass.prototype.x); // 1 a.y = 2; // ignored, throws in strict mode console.log(a.y); // 1 console.log(myclass.prototype.y); // 1 specifications specification e
cmascript (e
cma-262)the definition of 'object.defineproperty' in that specification. ...
Object.getOwnPropertyDescriptor() - JavaScript
in es2015, a non-object first argument will be coerced to an object at first. object.getownpropertydescriptor('foo', 0); // typeerror: "foo" is not an object // es5 code object.getownpropertydescriptor('foo', 0); // object returned by es2015 code: { // configurable: false, // enumerable: true, // value: "f", // writable: false // } specifications specification e
cmascript (e
cma-262)the definition of 'object.getownpropertydescriptor' in that specification. ...
Object.getOwnPropertyDescriptors() - JavaScript
his can get awkward especially for getters and setters. instead, you can use this code to set the prototype: function superclass() {} superclass.prototype = { // define your methods and properties here }; function subclass() {} subclass.prototype = object.create( superclass.prototype, { // define your methods and properties here } ); specifications specification e
cmascript (e
cma-262)the definition of 'object.getownpropertydescriptors' in that specification. ...
Object.isExtensible() - JavaScript
he argument to this method is not an object (a primitive), then it will cause a typeerror. in es2015, a non-object argument will be treated as if it was a non-extensible ordinary object, simply return false. object.isextensible(1); // typeerror: 1 is not an object (es5 code) object.isextensible(1); // false (es2015 code) specifications specification e
cmascript (e
cma-262)the definition of 'object.isextensible' in that specification. ...
Object.keys() - JavaScript
etownpropertynames(). non-object coercion in es5, if the argument to this method is not an object (a primitive), then it will cause a typeerror. from es2015 onwards, a non-object argument will be coerced to an object. // in es5 object.keys('foo'); // typeerror: "foo" is not an object // in es2015+ object.keys('foo'); // ["0", "1", "2"] specifications specification e
cmascript (e
cma-262)the definition of 'object.keys' in that specification. ...
Object.preventExtensions() - JavaScript
ment to this method is not an object (a primitive), then it will cause a typeerror. in es2015, a non-object argument will be treated as if it was a non-extensible ordinary object, simply return it. object.preventextensions(1); // typeerror: 1 is not an object (es5 code) object.preventextensions(1); // 1 (es2015 code) specifications specification e
cmascript (e
cma-262)the definition of 'object.preventextensions' in that specification. ...
Promise.reject() - JavaScript
tic promise.reject function returns a promise that is rejected. for debugging purposes and selective error catching, it is useful to make reason an instanceof error. examples using the static promise.reject() method promise.reject(new error('fail')).then(function() { // not called }, function(error) { console.error(error); // stacktrace }); specifications specification e
cmascript (e
cma-262)the definition of 'promise.reject' in that specification. ...
Promise - JavaScript
'll even see the different promises being fulfilled one after another. loading an image with xhr another simple example using promise and xmlhttprequest to load an image is available at the mdn github js-examples repository. you can also see it in action. each step is commented and allows you to follow the promise and xhr architecture closely. specifications specification e
cmascript (e
cma-262)the definition of 'promise' in that specification. ...
handler.apply() - JavaScript
all the following code traps a function call. const p = new proxy(function() {}, { apply: function(target, thisarg, argumentslist) { console.log('called: ' + argumentslist.join(', ')); return argumentslist[0] + argumentslist[1] + argumentslist[2]; } }); console.log(p(1, 2, 3)); // "called: 1, 2, 3" // 6 specifications specification e
cmascript (e
cma-262)the definition of '[[call]]' in that specification. ...
handler.construct() - JavaScript
ew p(); // typeerror is thrown the following code improperly initializes the proxy. the target in proxy initialization must itself be a valid constructor for the new operator. const p = new proxy({}, { construct: function(target, argumentslist, newtarget) { return {}; } }); new p(); // typeerror is thrown, "p" is not a constructor specifications specification e
cmascript (e
cma-262)the definition of '[[construct]]' in that specification. ...
handler.set() - JavaScript
operty value. const p = new proxy({}, { set: function(target, prop, value, receiver) { target[prop] = value; console.log('property set: ' + prop + ' = ' + value); return true; } }) console.log('a' in p); // false p.a = 10; // "property set: a = 10" console.log('a' in p); // true console.log(p.a); // 10 specifications specification e
cmascript (e
cma-262)the definition of '[[set]]' in that specification. ...
handler.setPrototypeOf() - JavaScript
e. const handlerthrows = { setprototypeof(target, newproto) { throw new error('custom error'); } }; const newproto = {}, target = {}; const p2 = new proxy(target, handlerthrows); object.setprototypeof(p2, newproto); // throws new error("custom error") reflect.setprototypeof(p2, newproto); // throws new error("custom error") specifications specification e
cmascript (e
cma-262)the definition of '[[setprototypeof]]' in that specification. ...
Reflect.apply() - JavaScript
y() this becomes less verbose and easier to understand. examples using reflect.apply() reflect.apply(math.floor, undefined, [1.75]); // 1; reflect.apply(string.fromcharcode, undefined, [104, 101, 108, 108, 111]) // "hello" reflect.apply(regexp.prototype.exec, /ab/, ['confabulation']).index // 4 reflect.apply(''.charat, 'ponies', [3]) // "i" specifications specification e
cmascript (e
cma-262)the definition of 'reflect.apply' in that specification. ...
Reflect.construct() - JavaScript
lass, args, otherclass) // output: // oneclass // function otherclass { ... } let obj3 = object.create(otherclass.prototype); oneclass.apply(obj3, args) // output: // oneclass // undefined examples using reflect.construct() let d = reflect.construct(date, [1776, 6, 4]) d instanceof date // true d.getfullyear() // 1776 specifications specification e
cmascript (e
cma-262)the definition of 'reflect.construct' in that specification. ...
Reflect.getOwnPropertyDescriptor() - JavaScript
mitive), then it will cause a typeerror. with object.getownpropertydescriptor, a non-object first argument will be coerced to an object at first. reflect.getownpropertydescriptor('foo', 0) // typeerror: "foo" is not non-null object object.getownpropertydescriptor('foo', 0) // { value: "f", writable: false, enumerable: true, configurable: false } specifications specification e
cmascript (e
cma-262)the definition of 'reflect.getownpropertydescriptor' in that specification. ...
Reflect.set() - JavaScript
// true arr[2] // "goose" // it can truncate an array. reflect.set(arr, 'length', 1) // true arr // ["duck"] // with just one argument, propertykey and value are "undefined". let obj = {} reflect.set(obj) // true reflect.getownpropertydescriptor(obj, 'undefined') // { value: undefined, writable: true, enumerable: true, configurable: true } specifications specification e
cmascript (e
cma-262)the definition of 'reflect.set' in that specification. ...
Reflect.setPrototypeOf() - JavaScript
it can change an object's [[prototype]] to null. reflect.setprototypeof({}, null) // true // returns false if target is not extensible. reflect.setprototypeof(object.freeze({}), null) // false // returns false if it cause a prototype chain cycle. let target = {} let proto = object.create(target) reflect.setprototypeof(target, proto) // false specifications specification e
cmascript (e
cma-262)the definition of 'reflect.setprototypeof' in that specification. ...
RegExp.prototype[@@search]() - JavaScript
ethod to modify the behavior. class myregexp extends regexp { constructor(str) { super(str) this.pattern = str; } [symbol.search](str) { return str.indexof(this.pattern); } } var re = new myregexp('a+b'); var str = 'ab a+b'; var result = str.search(re); // string.prototype.search calls re[@@search]. console.log(result); // 3 specifications specification e
cmascript (e
cma-262)the definition of 'regexp.prototype[@@search]' in that specification. ...
get RegExp[@@species] - JavaScript
.g. your custom regexp myregexp), the myregexp species is the myregexp constructor. however, you might want to overwrite this, in order to return parent regexp objects in your derived class methods: class myregexp extends regexp { // overwrite myregexp species to the parent regexp constructor static get [symbol.species]() { return regexp; } } specifications specification e
cmascript (e
cma-262)the definition of 'get regexp [ @@species ]' in that specification. ...
RegExp() constructor - JavaScript
on each iteration. the constructor of the regular expression object—for example, new regexp('ab+c')—results in runtime compilation of the regular expression. use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and are getting it from another source, such as user input. specifications specification e
cmascript (e
cma-262)the definition of 'regexp constructor' in that specification. ...
RegExp.prototype.compile() - JavaScript
om any later indexes). description the compile method is deprecated. you can just use the regexp constructor to achieve the same effect. examples using compile() the following example shows how to recompile a regular expression with a new pattern and a new flag. var regexobj = new regexp('foo', 'gi'); regexobj.compile('new foo', 'g'); specifications specification e
cmascript (e
cma-262)the definition of 'regexp.prototype.compile' in that specification. ...
RegExp.prototype.exec() - JavaScript
iteration. also, be sure that the global flag ("g") is set, or it will also cause an infinite loop. using exec() with regexp literals you can also use exec() without creating a regexp object explicitly: let matches = /(hello \s+)/.exec('this is a hello world!'); console.log(matches[1]); this will log a message containing 'hello world!'. specifications specification e
cmascript (e
cma-262)the definition of 'regexp.exec' in that specification. ...
RegExp.prototype.flags - JavaScript
etically (from left to right, e.g. "gimsuy"). polyfill if (regexp.prototype.flags === undefined) { object.defineproperty(regexp.prototype, 'flags', { configurable: true, get: function() { return this.tostring().match(/[gimsuy]*$/)[0]; } }); } examples using flags /foo/ig.flags; // "gi" /bar/myu.flags; // "muy" specifications specification e
cmascript (e
cma-262)the definition of 'regexp.prototype.flags' in that specification. ...
RegExp.prototype.global - JavaScript
not change this property directly. examples using global var regex = new regexp('foo', 'g'); console.log(regex.global); // true var str = 'fooexamplefoo'; var str1 = str.replace(regex, ''); console.log(str1); // output: example var regex1 = new regexp('foo'); var str2 = str.replace(regex1, ''); console.log(str2); // output: examplefoo specifications specification e
cmascript (e
cma-262)the definition of 'regexp.prototype.global' in that specification. ...
RegExpInstance.lastIndex - JavaScript
tring. console.log(re.exec('hi')); console.log(re.lastindex); returns ["hi", "hi"] with lastindex equal to 2. console.log(re.exec('hi')); console.log(re.lastindex); returns ["", undefined], an empty array whose zeroth element is the match string. in this case, the empty string because lastindex was 2 (and still is 2) and hi has length 2. specifications specification e
cmascript (e
cma-262)the definition of 'regexp.lastindex' in that specification. ...
RegExp.prototype.multiline - JavaScript
string should be treated as multiple lines. for example, if "m" is used, "^" and "$" change from matching at only the start or end of the entire string to the start or end of any line within the string. you cannot change this property directly. examples using multiline var regex = new regexp('foo', 'm'); console.log(regex.multiline); // true specifications specification e
cmascript (e
cma-262)the definition of 'regexp.prototype.multiline' in that specification. ...
RegExp.prototype.unicode - JavaScript
was used; otherwise false. the "u" flag enables various unicode-related features. with the "u" flag, any unicode code point escapes will be interpreted as such, for example. you cannot change this property directly. it is read-only. examples using the unicode property var regex = new regexp('\u{61}', 'u'); console.log(regex.unicode); // true specifications specification e
cmascript (e
cma-262)the definition of 'regexp.prototype.unicode' in that specification. ...
get Set[@@species] - JavaScript
rived collection object (e.g. your custom set myset), the myset species is the myset constructor. however, you might want to overwrite this, in order to return parent set objects in your derived class methods: class myset extends set { // overwrite myset species to the parent set constructor static get [symbol.species]() { return set; } } specifications specification e
cmascript (e
cma-262)the definition of 'get set [ @@species ]' in that specification. ...
Set() constructor - JavaScript
arameter, or its value is null, the new set is empty. return value a new set object. examples using the set object let myset = new set() myset.add(1) // set [ 1 ] myset.add(5) // set [ 1, 5 ] myset.add(5) // set [ 1, 5 ] myset.add('some text') // set [ 1, 5, 'some text' ] let o = {a: 1, b: 2} myset.add(o) specifications specification e
cmascript (e
cma-262)the definition of 'set constructor' in that specification. ...
Set.prototype.add() - JavaScript
/mdn/interactive-examples and send us a pull request. syntax myset.add(value); parameters value the value of the element to add to the set object. return value the set object. examples using the add method var myset = new set(); myset.add(1); myset.add(5).add('some text'); // chainable console.log(myset); // set [1, 5, "some text"] specifications specification e
cmascript (e
cma-262)the definition of 'set.prototype.add' in that specification. ...
Set.prototype.clear() - JavaScript
oject, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax myset.clear(); return value undefined. examples using the clear method var myset = new set(); myset.add(1); myset.add('foo'); myset.size; // 2 myset.has('foo'); // true myset.clear(); myset.size; // 0 myset.has('bar') // false specifications specification e
cmascript (e
cma-262)the definition of 'set.prototype.clear' in that specification. ...
Set.prototype.delete() - JavaScript
ent. let's checkout below how to delete an object from a set. const setobj = new set(); // create a new set. setobj.add({x: 10, y: 20}); // add object in the set. setobj.add({x: 20, y: 30}); // add object in the set. // delete any point with `x > 10`. setobj.foreach(function(point){ if (point.x > 10){ setobj.delete(point) } }) specifications specification e
cmascript (e
cma-262)the definition of 'set.prototype.delete' in that specification. ...
Set.prototype.entries() - JavaScript
each element in the given set, in insertion order. examples using entries() var myset = new set(); myset.add('foobar'); myset.add(1); myset.add('baz'); var setiter = myset.entries(); console.log(setiter.next().value); // ["foobar", "foobar"] console.log(setiter.next().value); // [1, 1] console.log(setiter.next().value); // ["baz", "baz"] specifications specification e
cmascript (e
cma-262)the definition of 'set.prototype.entries' in that specification. ...
Set.prototype.size - JavaScript
.com/mdn/interactive-examples and send us a pull request. description the value of size is an integer representing how many entries the set object has. a set accessor function for size is undefined; you cannot change this property. examples using size var myset = new set(); myset.add(1); myset.add(5); myset.add('some text') myset.size; // 3 specifications specification e
cmascript (e
cma-262)the definition of 'set.prototype.size' in that specification. ...
Set.prototype.values() - JavaScript
ject containing the values for each element in the given set, in insertion order. examples using values() var myset = new set(); myset.add('foo'); myset.add('bar'); myset.add('baz'); var setiter = myset.values(); console.log(setiter.next().value); // "foo" console.log(setiter.next().value); // "bar" console.log(setiter.next().value); // "baz" specifications specification e
cmascript (e
cma-262)the definition of 'set.prototype.values' in that specification. ...
SharedArrayBuffer() constructor - JavaScript
raybuffer sharedarraybuffer constructors are required to be constructed with a new operator. calling a sharedarraybuffer constructor as a function without new will throw a typeerror. var sab = sharedarraybuffer(1024); // typeerror: calling a builtin sharedarraybuffer constructor // without new is forbidden var sab = new sharedarraybuffer(1024); specifications specification e
cmascript (e
cma-262)the definition of 'sharedarraybuffer constructor' in that specification. ...
SharedArrayBuffer.prototype.byteLength - JavaScript
nd us a pull request. description the bytelength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. the value is established when the shared array is constructed and cannot be changed. examples using bytelength var sab = new sharedarraybuffer(1024); sab.bytelength; // 1024 specifications specification e
cmascript (e
cma-262)the definition of 'sharedarraybuffer.prototype.bytelength' in that specification. ...
SharedArrayBuffer.prototype.slice() - JavaScript
a new sharedarraybuffer containing the extracted elements. examples using slice var sab = new sharedarraybuffer(1024); sab.slice(); // sharedarraybuffer { bytelength: 1024 } sab.slice(2); // sharedarraybuffer { bytelength: 1022 } sab.slice(-2); // sharedarraybuffer { bytelength: 2 } sab.slice(0, 1); // sharedarraybuffer { bytelength: 1 } specifications specification e
cmascript (e
cma-262)the definition of 'sharedarraybuffer.prototype.slice' in that specification. ...
String.prototype.anchor() - JavaScript
d. also, the html specification no longer allows the <a> element to have a name attribute, so this method doesn't even create valid markup. examples using anchor() var mystring = 'table of contents'; document.body.innerhtml = mystring.anchor('contents_anchor'); will output the following html: <a name="contents_anchor">table of contents</a> specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.anchor' in that specification. ...
String.prototype.concat() - JavaScript
let hello = 'hello, ' console.log(hello.concat('kevin', '. have a nice day.')) // hello, kevin. have a nice day. let greetlist = ['hello', ' ', 'venkat', '!'] "".concat(...greetlist) // "hello venkat!" "".concat({}) // [object object] "".concat([]) // "" "".concat(null) // "null" "".concat(true) // "true" "".concat(4, 5) // "45" specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.concat' in that specification. ...
String.prototype.fixed() - JavaScript
ixed() return value a string representing a <tt> html element. description the fixed() method embeds a string in a <tt> tag: "<tt>str</tt>". examples using fixed() the following example uses the fixed method to change the formatting of a string: var worldstring = 'hello, world'; console.log(worldstring.fixed()); // "<tt>hello, world</tt>" specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.fixed' in that specification. ...
String.fromCharCode() - JavaScript
of 0x2014 complete utf 16 table. supplementary characters, in utf-16, require two code units (i.e. a surrogate pair): string.fromcharcode(0xd83c, 0xdf03); // code point u+1f303 "night with string.fromcharcode(55356, 57091); // stars" == "\ud83c\udf03" string.fromcharcode(0xd834, 0xdf06, 0x61, 0xd834, 0xdf07); // "\ud834\udf06a\ud834\udf07" specifications specification e
cmascript (e
cma-262)the definition of 'string.fromcharcode' in that specification. ...
String.prototype.link() - JavaScript
.links. examples using link() the following example displays the word "mdn" as a hypertext link that returns the user to the mozilla developer network. var hottext = 'mdn'; var url = 'https://developer.mozilla.org/'; console.log('click to return to ' + hottext.link(url)); // click to return to <a href="https://developer.mozilla.org/">mdn</a> specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.link' in that specification. ...
String.prototype.match() - JavaScript
nan"] str1.match(infinity); // the type of infinity is the number. returns ["infinity"] str1.match(+infinity); // returns ["infinity"] str1.match(-infinity); // returns ["-infinity"] str2.match(65); // returns ["65"] str2.match(+65); // a number with a positive sign. returns ["65"] str3.match(null); // returns ["null"] specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.match' in that specification. ...
String.prototype.padEnd() - JavaScript
ault value for this parameter is " " (u+0020). return value a string of the specified targetlength with the padstring applied at the end of the current str. examples using padend 'abc'.padend(10); // "abc " 'abc'.padend(10, "foo"); // "abcfoofoof" 'abc'.padend(6, "123456"); // "abc123" 'abc'.padend(1); // "abc" specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.padend' in that specification. ...
String.raw() - JavaScript
the separated strings // in the template literal. // the rest of the arguments are the substitutions. // the first argument’s 'raw' value can be any iterable, even a string! // for example, 'test' is treated as ['t', 'e', 's', 't']. // the following is equivalent to // `t${0}e${1}s${2}t`: string.raw({ raw: 'test' }, 0, 1, 2); // 't0e1s2t' specifications specification e
cmascript (e
cma-262)the definition of 'string.raw' in that specification. ...
String.prototype.replace() - JavaScript
the fahrenheit degree passed in a string to the f2c() function. f2c() then returns the celsius number. this function approximates perl's s///e flag. function f2c(x) { function convert(str, p1, offset, s) { return ((p1 - 32) * 5/9) + 'c'; } let s = string(x); let test = /(-?\d+(?:\.\d*)?)f\b/g; return s.replace(test, convert); } specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.replace' in that specification. ...
String.prototype.search() - JavaScript
string with two different regex objects to show a successful search (positive value) vs. an unsuccessful search (-1) let str = "hey jude" let re = /[a-z]/g let redot = /[.]/g console.log(str.search(re)) // returns 4, which is the index of the first capital letter "j" console.log(str.search(redot)) // returns -1 cannot find '.' dot punctuation specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.search' in that specification. ...
String.prototype.toLocaleLowerCase() - JavaScript
here may be a different result. examples using tolocalelowercase() 'alphabet'.tolocalelowercase(); // 'alphabet' '\u0130'.tolocalelowercase('tr') === 'i'; // true '\u0130'.tolocalelowercase('en-us') === 'i'; // false let locales = ['tr', 'tr', 'tr-tr', 'tr-u-co-search', 'tr-x-turkish']; '\u0130'.tolocalelowercase(locales) === 'i'; // true specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.tolocalelowercase' in that specification. e
cmascript internationalization api (e
cma-402)the definition of 'string.prototype.tolocalelowercase' in that specification. ...
String.prototype.toLowerCase() - JavaScript
olowercase() return value a new string representing the calling string converted to lower case. description the tolowercase() method returns the value of the string converted to lower case. tolowercase() does not affect the value of the string str itself. examples using tolowercase() console.log('alphabet'.tolowercase()); // 'alphabet' specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.tolowercase' in that specification. ...
String.prototype.toString() - JavaScript
ototype.tostring(). for string objects, the tostring() method returns a string representation of the object and is the same as the string.prototype.valueof() method. examples using tostring() the following example displays the string value of a string object: var x = new string('hello world'); console.log(x.tostring()); // logs 'hello world' specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.tostring' in that specification. ...
String.prototype.trimEnd() - JavaScript
ght remains as an alias to trimend. in some engines this means: string.prototype.trimright.name === "trimend"; examples using trimend() the following example displays the lowercase string ' foo': var str = ' foo '; console.log(str.length); // 8 str = str.trimend(); console.log(str.length); // 6 console.log(str); // ' foo' specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.trimend' in that specification. ...
String.prototype.valueOf() - JavaScript
eof() method of string returns the primitive value of a string object as a string data type. this value is equivalent to string.prototype.tostring(). this method is usually called internally by javascript and not explicitly in code. examples using valueof() var x = new string('hello world'); console.log(x.valueof()); // displays 'hello world' specifications specification e
cmascript (e
cma-262)the definition of 'string.prototype.valueof' in that specification. ...
Symbol.prototype[@@toPrimitive] - JavaScript
alls the [@@toprimitive]() method to convert an object to a primitive value. you rarely need to invoke the [@@toprimitive]() method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected. examples using @@toprimitive const sym = symbol("example"); sym === sym[symbol.toprimitive](); // true specifications specification e
cmascript (e
cma-262)the definition of 'symbol.prototype.@@toprimitive' in that specification. ...
Symbol.asyncIterator - JavaScript
not to completely replace callbacks and events in most situations. built-in async iterables there are currently no built-in javascript objects that have the [symbol.asynciterator] key set by default. however, whatwg streams are set to be the first built-in object to be async iterable, with [symbol.asynciterator] recently landing in the spec. specifications specification e
cmascript (e
cma-262)the definition of 'symbol.asynciterator' in that specification. ...
Symbol.keyFor() - JavaScript
registry; otherwise, undefined. examples using keyfor var globalsym = symbol.for('foo'); // create a new global symbol symbol.keyfor(globalsym); // "foo" var localsym = symbol(); symbol.keyfor(localsym); // undefined // well-known symbols are not symbols registered // in the global symbol registry symbol.keyfor(symbol.iterator) // undefined specifications specification e
cmascript (e
cma-262)the definition of 'symbol.keyfor' in that specification. ...
Symbol.match - JavaScript
d. however, if you set symbol.match to false, the isregexp check (that uses the match property) will indicate that the object is not a regular expression object. the methods startswith and endswith won't throw a typeerror as a consequence. var re = /foo/; re[symbol.match] = false; '/foo/'.startswith(re); // true '/baz/'.endswith(re); // false specifications specification e
cmascript (e
cma-262)the definition of 'symbol.match' in that specification. ...
Symbol.species - JavaScript
ray object. the species symbol lets you do this: class myarray extends array { // overwrite species to the parent array constructor static get [symbol.species]() { return array; } } let a = new myarray(1,2,3); let mapped = a.map(x => x * x); console.log(mapped instanceof myarray); // false console.log(mapped instanceof array); // true specifications specification e
cmascript (e
cma-262)the definition of 'symbol.species' in that specification. ...
Symbol.toPrimitive - JavaScript
. var obj2 = { [symbol.toprimitive](hint) { if (hint == 'number') { return 10; } if (hint == 'string') { return 'hello'; } return true; } }; console.log(+obj2); // 10 -- hint is "number" console.log(`${obj2}`); // "hello" -- hint is "string" console.log(obj2 + ''); // "true" -- hint is "default" specifications specification e
cmascript (e
cma-262)the definition of 'symbol.toprimitive' in that specification. ...
Symbol.prototype.valueOf() - JavaScript
t as a symbol data type. javascript calls the valueof method to convert an object to a primitive value. you rarely need to invoke the valueof method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected. examples using valueof const sym = symbol("example"); sym === sym.valueof(); // true specifications specification e
cmascript (e
cma-262)the definition of 'symbol.prototype.valueof' in that specification. ...
get TypedArray[@@species] - JavaScript
the mytypedarray species is the mytypedarray constructor. however, you might want to overwrite this, in order to return a parent typed array object in your derived class methods: class mytypedarray extends uint8array { // overwrite mytypedarray species to the parent uint8array constructor static get [symbol.species]() { return uint8array; } } specifications specification e
cmascript (e
cma-262)the definition of 'get %typedarray% [ @@species ]' in that specification. ...
TypedArray.prototype.buffer - JavaScript
ion is undefined, meaning that you can only read this property. the value is established when the typedarray is constructed and cannot be changed. typedarray is one of the typedarray objects. examples using the buffer property var buffer = new arraybuffer(8); var uint16 = new uint16array(buffer); uint16.buffer; // arraybuffer { bytelength: 8 } specifications specification e
cmascript (e
cma-262)the definition of 'typedarray.prototype.buffer' in that specification. ...
TypedArray.prototype.byteOffset - JavaScript
y is constructed and cannot be changed. typedarray is one of the typedarray objects. examples using the byteoffset property var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.byteoffset; // 0 (no offset specified) var uint8 = new uint8array(buffer, 3); uint8.byteoffset; // 3 (as specified when constructing uint8array) specifications specification e
cmascript (e
cma-262)the definition of 'typedarray.prototype.byteoffset' in that specification. ...
TypedArray.prototype.copyWithin() - JavaScript
modified array. description see array.prototype.copywithin for more details. examples using copywithin var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.set([1,2,3]); console.log(uint8); // uint8array [ 1, 2, 3, 0, 0, 0, 0, 0 ] uint8.copywithin(3,0,3); console.log(uint8); // uint8array [ 1, 2, 3, 1, 2, 3, 0, 0 ] specifications specification e
cmascript (e
cma-262)the definition of 'typedarray.prototype.copywithin' in that specification. ...
TypedArray.prototype.find() - JavaScript
rray that is a prime number (or returns undefined if there is no prime number). function isprime(element, index, array) { var start = 2; while (start <= math.sqrt(element)) { if (element % start++ < 1) { return false; } } return element > 1; } var uint8 = new uint8array([4, 5, 8, 12]); console.log(uint8.find(isprime)); // 5 specifications specification e
cmascript (e
cma-262)the definition of '%typedarray%.prototype.find' in that specification. ...
TypedArray.prototype.forEach() - JavaScript
value undefined. examples logging the contents of a typed array the following code logs a line for each element in a typed array: function logarrayelements(element, index, array) { console.log('a[' + index + '] = ' + element); } new uint8array([0, 1, 2, 3]).foreach(logarrayelements); // logs: // a[0] = 0 // a[1] = 1 // a[2] = 2 // a[3] = 3 specifications specification e
cmascript (e
cma-262)the definition of '%typedarray%.prototype.foreach' in that specification. ...
TypedArray.prototype.lastIndexOf() - JavaScript
using strict equality (the same method used by the ===, or triple-equals, operator). examples using lastindexof var uint8 = new uint8array([2, 5, 9, 2]); uint8.lastindexof(2); // 3 uint8.lastindexof(7); // -1 uint8.lastindexof(2, 3); // 3 uint8.lastindexof(2, 2); // 0 uint8.lastindexof(2, -2); // 0 uint8.lastindexof(2, -1); // 3 specifications specification e
cmascript (e
cma-262)the definition of 'typedarray.prototype.lastindexof' in that specification. ...
TypedArray.prototype.map() - JavaScript
e argument is used with it. the argument will automatically be assigned to each element of the typed array as map loops through the original typed array. const numbers = new uint8array([1, 4, 9]); const doubles = numbers.map(function(num) { return num * 2; }); // doubles is now uint8array [2, 8, 18] // numbers is still uint8array [1, 4, 9] specifications specification e
cmascript (e
cma-262)the definition of 'typedarray.prototype.map' in that specification. ...
TypedArray.prototype.reduce() - JavaScript
alling callback. polyfill this method uses the same algorithm as array.prototype.reduce(), so the same polyfill can be used here: simply replace array.prototype.reduce with typedarray.prototype.reduce. examples sum up all values within an array var total = new uint8array([0, 1, 2, 3]).reduce(function(a, b) { return a + b; }); // total == 6 specifications specification e
cmascript (e
cma-262)the definition of '%typedarray%.prototype.reduce' in that specification. ...
TypedArray.prototype.reverse() - JavaScript
. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.reverse(); return value the reversed array. examples using reverse var uint8 = new uint8array([1, 2, 3]); uint8.reverse(); console.log(uint8); // uint8array [3, 2, 1] specifications specification e
cmascript (e
cma-262)the definition of 'typedarray.prototype.reverse' in that specification. ...
TypedArray.prototype.set() - JavaScript
erwrite values in the target array starting at index 0). exceptions a rangeerror, if the offset is set such as it would store beyond the end of the typed array. examples using set() var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.set([1, 2, 3], 3); console.log(uint8); // uint8array [ 0, 0, 0, 1, 2, 3, 0, 0 ] specifications specification e
cmascript (e
cma-262)the definition of 'typedarray.prototype.set' in that specification. ...
TypedArray.prototype.slice() - JavaScript
s best not to polyfill array.prototype methods at all, as you can't make them non-enumerable. examples return a portion of an existing typed array const uint8 = new uint8array([1,2,3]); uint8.slice(1); // uint8array [ 2, 3 ] uint8.slice(2); // uint8array [ 3 ] uint8.slice(-2); // uint8array [ 2, 3 ] uint8.slice(0,1); // uint8array [ 1 ] specifications specification e
cmascript (e
cma-262)the definition of '%typedarray%.prototype.slice' in that specification. ...
TypedArray.prototype.subarray() - JavaScript
to the new object's contents will impact the original object and vice versa. examples using the subarray method var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.set([1,2,3]); console.log(uint8); // uint8array [ 1, 2, 3, 0, 0, 0, 0, 0 ] var sub = uint8.subarray(0,4); console.log(sub); // uint8array [ 1, 2, 3, 0 ] specifications specification e
cmascript (e
cma-262)the definition of 'typedarray.prototype.subarray' in that specification. ...
WeakMap.prototype.clear() - JavaScript
the clear() method used to remove all elements from a weakmap object, but is no longer part of e
cmascript and its implementations. syntax wm.clear(); examples using the clear method var wm = new weakmap(); var obj = {}; wm.set(obj, 'foo'); wm.set(window, 'bar'); wm.has(obj); // true wm.has(window); // true wm.clear(); wm.has(obj) // false wm.has(window) // false specifications not part of any standard. ...
WeakMap.prototype.delete() - JavaScript
eakmap object has been removed successfully. false if the key is not found in the weakmap or if the key is not an object. examples using the delete method var wm = new weakmap(); wm.set(window, 'foo'); wm.delete(window); // returns true. successfully removed. wm.has(window); // returns false. the window object is no longer in the weakmap. specifications specification e
cmascript (e
cma-262)the definition of 'weakmap.prototype.delete' in that specification. ...
WeakMap.prototype.get() - JavaScript
d. the key of the element to return from the weakmap object. return value the element associated with the specified key in the weakmap object. if the key can't be found, undefined is returned. examples using the get method var wm = new weakmap(); wm.set(window, 'foo'); wm.get(window); // returns "foo". wm.get('baz'); // returns undefined. specifications specification e
cmascript (e
cma-262)the definition of 'weakmap.prototype.get' in that specification. ...
WeakMap.prototype.has() - JavaScript
required. the key of the element to test for presence in the weakmap object. return value boolean returns true if an element with the specified key exists in the weakmap object; otherwise false. examples using the has method var wm = new weakmap(); wm.set(window, 'foo'); wm.has(window); // returns true wm.has('baz'); // returns false specifications specification e
cmascript (e
cma-262)the definition of 'weakmap.prototype.has' in that specification. ...
WeakMap.prototype.set() - JavaScript
kmap object. value required. any value. the value of the element to add to the weakmap object. return value the weakmap object. examples using the set method var wm = new weakmap(); var obj = {}; // add new elements to the weakmap wm.set(obj, 'foo').set(window, 'bar'); // chainable // update an element in the weakmap wm.set(obj, 'baz'); specifications specification e
cmascript (e
cma-262)the definition of 'weakmap.prototype.set' in that specification. ...
WeakSet.prototype.add() - JavaScript
ion. return value the weakset object. examples using add var ws = new weakset(); ws.add(window); // add the window object to the weakset ws.has(window); // true // weakset only takes objects as arguments ws.add(1); // results in "typeerror: invalid value used in weak set" in chrome // and "typeerror: 1 is not a non-null object" in firefox specifications specification e
cmascript (e
cma-262)the definition of 'weakset.prototype.add' in that specification. ...
WeakSet.prototype.clear() - JavaScript
the clear() method used to remove all elements from a weakset object, but is no longer part of e
cmascript and its implementations. syntax ws.clear(); examples using the clear method var ws = new weakset(); ws.add(window); ws.has(window); // true ws.clear(); ws.has(window); // false specifications not part of any standard. ...
WeakSet.prototype.delete() - JavaScript
in the weakmap or if the key is not an object. examples using the delete method var ws = new weakset(); var obj = {}; ws.add(window); ws.delete(obj); // returns false. no obj found to be deleted. ws.delete(window); // returns true. successfully removed. ws.has(window); // returns false. the window is no longer present in the weakset. specifications specification e
cmascript (e
cma-262)the definition of 'weakset.prototype.delete' in that specification. ...
WeakSet.prototype.has() - JavaScript
e required. the object to test for presence in the weakset. return value boolean returns true if an element with the specified value exists in the weakset object; otherwise false. examples using the has method var ws = new weakset(); var obj = {}; ws.add(window); myset.has(window); // returns true myset.has(obj); // returns false specifications specification e
cmascript (e
cma-262)the definition of 'weakset.prototype.has' in that specification. ...
WebAssembly.CompileError() constructor - JavaScript
sole.log(e.filename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly javascript interfacethe definition of 'webassembly constructors' in that specification. e
cmascript (e
cma-262)the definition of 'nativeerror constructor' in that specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchr...
WebAssembly.LinkError() constructor - JavaScript
inkerror" console.log(e.filename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly javascript interfacethe definition of 'linkerror' in that specification. e
cmascript (e
cma-262)the definition of 'nativeerror constructors' in that specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewch...
WebAssembly.RuntimeError() constructor - JavaScript
ilename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly javascript interfacethe definition of 'webassembly.runtimeerror constructor' in that specification. e
cmascript (e
cma-262)the definition of 'nativeerror constructor' in that specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchr...
decodeURI() - JavaScript
om escape sequences. examples decoding a cyrillic url decodeuri('https://developer.mozilla.org/ru/docs/javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b'); // "https://developer.mozilla.org/ru/docs/javascript_шеллы" catching errors try { var a = decodeuri('%e0%a4%a'); } catch(e) { console.error(e); } // urierror: malformed uri sequence specifications specification e
cmascript (e
cma-262)the definition of 'decodeuri' in that specification. ...
null - JavaScript
s, as the former performs type-conversion. typeof null // "object" (not "null" for legacy reasons) typeof undefined // "undefined" null === undefined // false null == undefined // true null === null // true null == null // true !null // true isnan(1 + null) // false isnan(1 + undefined) // true specifications specification e
cmascript (e
cma-262)the definition of 'null value' in that specification. ...
Standard built-in objects - JavaScript
d data coded using javascript object notation (json). arraybuffer sharedarraybuffer atomics dataview json control abstraction objects control abstractions can help to structure code, especially async code (without using deeply nested callbacks, for example). promise generator generatorfunction asyncfunction reflection reflect proxy internationalization additions to the e
cmascript core for language-sensitive functionalities. intl intl.collator intl.datetimeformat intl.listformat intl.numberformat intl.pluralrules intl.relativetimeformat intl.locale webassembly webassembly webassembly.module webassembly.instance webassembly.memory webassembly.table webassembly.compileerror webassembly.linkerror webassembly.runtimeerror other argum...
Assignment (=) - JavaScript
tory. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x = y examples simple assignment and chaining // assuming the following variables // x = 5 // y = 10 // z = 25 x = y // x is 10 x = y = z // x, y and z are all 25 specifications specification e
cmascript (e
cma-262)the definition of 'assignment operators' in that specification. ...
Bitwise OR assignment (|=) - JavaScript
clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x |= y meaning: x = x | y examples using bitwise or assignment let a = 5; a |= 2; // 7 // 5: 00000000000000000000000000000101 // 2: 00000000000000000000000000000010 // ----------------------------------- // 7: 00000000000000000000000000000111 specifications specification e
cmascript (e
cma-262)the definition of 'assignment operators' in that specification. ...
Decrement (--) - JavaScript
, the decrement operator decrements and returns the value before decrementing. if used prefix, with operator before operand (for example, --x), the decrement operator decrements and returns the value after decrementing. examples postfix decrement let x = 3; y = x--; // y = 3 // x = 2 prefix decrement let a = 2; b = --a; // a = 1 // b = 1 specifications specification e
cmascript (e
cma-262)the definition of 'decrement operator' in that specification. ...
Division assignment (/=) - JavaScript
. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x /= y meaning: x = x / y examples using division assignment // assuming the following variable // bar = 5 bar /= 2 // 2.5 bar /= 'foo' // nan bar /= 0 // infinity specifications specification e
cmascript (e
cma-262)the definition of 'assignment operators' in that specification. ...
Exponentiation assignment (**=) - JavaScript
ithub repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x **= y meaning: x = x ** y examples using exponentiation assignment // assuming the following variable // bar = 5 bar **= 2 // 25 bar **= 'foo' // nan specifications specification e
cmascript (e
cma-262)the definition of 'assignment operators' in that specification. ...
Grouping operator ( ) - JavaScript
ltiplication and division first, then addition and subtraction to evaluate addition first. var a = 1; var b = 2; var c = 3; // default precedence a + b * c // 7 // evaluated by default like this a + (b * c) // 7 // now overriding precedence // addition before multiplication (a + b) * c // 9 // which is equivalent to a * c + b * c // 9 specifications specification e
cmascript (e
cma-262)the definition of 'the grouping operator' in that specification. ...
Increment (++) - JavaScript
, the increment operator increments and returns the value before incrementing. if used prefix, with operator before operand (for example, ++x), the increment operator increments and returns the value after incrementing. examples postfix increment let x = 3; y = x++; // y = 3 // x = 4 prefix increment let a = 2; b = ++a; // a = 3 // b = 3 specifications specification e
cmascript (e
cma-262)the definition of 'increment operator' in that specification. ...
Left shift assignment (<<=) - JavaScript
ository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x <<= y meaning: x = x << y examples using left shift assignment let a = 5; // 00000000000000000000000000000101 bar <<= 2; // 20 // 00000000000000000000000000010100 specifications specification e
cmascript (e
cma-262)the definition of 'assignment operators' in that specification. ...
Multiplication assignment (*=) - JavaScript
a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x *= y meaning: x = x * y examples using multiplication assignment // assuming the following variable // bar = 5 bar *= 2 // 10 bar *= 'foo' // nan specifications specification e
cmascript (e
cma-262)the definition of 'assignment operators' in that specification. ...
Remainder (%) - JavaScript
, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: var1 % var2 examples remainder with positive dividend 12 % 5 // 2 1 % -2 // 1 1 % 2 // 1 2 % 3 // 2 5.5 % 2 // 1.5 remainder with negative dividend -12 % 5 // -2 -1 % 2 // -1 -4 % 2 // -0 remainder with nan nan % 2 // nan specifications specification e
cmascript (e
cma-262)the definition of 'remainder operator' in that specification. ...
Remainder assignment (%=) - JavaScript
sitory. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x %= y meaning: x = x % y examples using remainder assignment // assuming the following variable // bar = 5 bar %= 2 // 1 bar %= 'foo' // nan bar %= 0 // nan specifications specification e
cmascript (e
cma-262)the definition of 'assignment operators' in that specification. ...
Right shift assignment (>>=) - JavaScript
dn/interactive-examples and send us a pull request. syntax operator: x >>= y meaning: x = x >> y examples using right shift assignment let a = 5; // (00000000000000000000000000000101) a >>= 2; // 1 (00000000000000000000000000000001) let b = -5; // (-00000000000000000000000000000101) b >>= 2; // -2 (-00000000000000000000000000000010) specifications specification e
cmascript (e
cma-262)the definition of 'assignment operators' in that specification. ...
Subtraction (-) - JavaScript
his interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x - y examples subtraction with numbers 5 - 3 // 2 3 - 5 // -2 subtraction with non-numbers 'foo' - 3 // nan specifications specification e
cmascript (e
cma-262)the definition of 'subtraction operator' in that specification. ...
Subtraction assignment (-=) - JavaScript
d in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax operator: x -= y meaning: x = x - y examples using subtraction assignment // assuming the following variable // bar = 5 bar -= 2 // 3 bar -= 'foo' // nan specifications specification e
cmascript (e
cma-262)the definition of 'assignment operators' in that specification. ...
Unary plus (+) - JavaScript
rows a typeerror. if it cannot parse a particular value, it will evaluate to nan. examples usage with numbers const x = 1; const y = -1; console.log(+x); // 1 console.log(+y); // -1 usage with non-numbers +true // 1 +false // 0 +null // 0 +function(val){ return val } // nan +1n // throws typeerror: cannot convert bigint value to number specifications specification e
cmascript (e
cma-262)the definition of 'unary plus operator' in that specification. ...
Unsigned right shift (>>>) - JavaScript
s 1073741821, which is different than -9 >> 2 (which yields -3): . -9 (base 10): 11111111111111111111111111110111 (base 2) -------------------------------- -9 >>> 2 (base 10): 00111111111111111111111111111101 (base 2) = 1073741821 (base 10) examples using unsigned right shift 9 >>> 2; // 2 -9 >>> 2; // 1073741821 specifications specification e
cmascript (e
cma-262)the definition of 'bitwise shift operators' in that specification. ...
Unsigned right shift assignment (>>>=) - JavaScript
les and send us a pull request. syntax operator: x >>>= y meaning: x = x >>> y examples using unsigned right shift assignment let a = 5; // (00000000000000000000000000000101) a >>>= 2; // 1 (00000000000000000000000000000001) let b = -5; // (-00000000000000000000000000000101) b >>>= 2; // 1073741822 (00111111111111111111111111111110) specifications specification e
cmascript (e
cma-262)the definition of 'assignment operators' in that specification. ...
await - JavaScript
thrown. async function f4() { try { var z = await promise.reject(30); } catch(e) { console.error(e); // 30 } } f4(); handling rejected promises handle rejected promise without try block. var response = await promisedfunction().catch((err) => { console.error(err); }); // response will be undefined if the promise is rejected specifications specification e
cmascript (e
cma-262)the definition of 'async functions' in that specification. ...
in operator - JavaScript
ot write to indexes past the end of array. let empties = new array(3).fill(undefined) 2 in empties // returns true inherited properties the in operator returns true for properties in the prototype chain. (if you want to check for only non-inherited properties, use object.prototype.hasownproperty() instead.) 'tostring' in {} // returns true specifications specification e
cmascript (e
cma-262)the definition of 'relational operators' in that specification. ...
empty - JavaScript
in the next example, an if...else statement without curly braces ({}) is used. if three is true, nothing will happen, four does not matter, and also the launchrocket() function in the else case will not be executed. if (one) doone(); else if (two) dotwo(); else if (three) ; // nothing here else if (four) dofour(); else launchrocket(); specifications specification e
cmascript (e
cma-262)the definition of 'empty statement' in that specification. ...
async function - JavaScript
olving to null if processdatainworker(v) rejects. this highlights the subtle difference between return foo; and return await foo; — return foo immediately returns foo and never throws, even if foo is a promise that rejects. return await foo will wait for foo to resolve or reject if it's a promise, and throws before returning if it rejects. specifications specification e
cmascript (e
cma-262)the definition of 'async function' in that specification. ...
block - JavaScript
throw syntaxerror... note that the block-scoped const c = 2 does not throw a syntaxerror: identifier 'c' has already been declared because it can be declared uniquely within the block. in strict mode, starting with es2015, functions inside blocks are scoped to that block. prior to es2015, block-level functions were forbidden in strict mode. specifications specification e
cmascript (e
cma-262)the definition of 'block statement' in that specification. ...
break - JavaScript
eak out of. function testbreak(x) { var i = 0; while (i < 6) { if (i == 3) { (function() { break; })(); } i += 1; } return i * x; } testbreak(1); // syntaxerror: illegal break statement block_1: { console.log('1'); ( function() { break block_1; // syntaxerror: undefined label 'block_1' })(); } specifications specification e
cmascript (e
cma-262)the definition of 'break statement' in that specification. ...
class - JavaScript
ss using the class declaration throws a syntaxerror. class foo {}; class foo {}; // uncaught syntaxerror: identifier 'foo' has already been declared the same error is thrown when a class has been defined before using the class expression. let foo = class {}; class foo {}; // uncaught syntaxerror: identifier 'foo' has already been declared specifications specification e
cmascript (e
cma-262)the definition of 'class definitions' in that specification. ...
do...while - JavaScript
...while. examples using do...while in the following example, the do...while loop iterates at least once and reiterates until i is no longer less than 5. var result = ''; var i = 0; do { i += 1; result += i + ' '; } while (i > 0 && i < 5); // despite i == 0 this will still loop as it starts off without the test console.log(result); specifications specification e
cmascript (e
cma-262)the definition of 'do-while statement' in that specification. ...
for await...of - JavaScript
r the async generator and for...of for the sync one and await yielded promises explicitly inside the loop. (async function() { try { for (let numorpromise of generatorwithrejectedpromises()) { console.log(await numorpromise); } } catch (e) { console.log('catched', e) } })() // 0 // 1 // 2 // catched 3 // called finally specifications specification e
cmascript (e
cma-262)the definition of 'e
cmascript language: the for-in, for-of, and for-await-of statements' in that specification. ...
for...in - JavaScript
nherited properties are not displayed. var triangle = {a: 1, b: 2, c: 3}; function coloredtriangle() { this.color = 'red'; } coloredtriangle.prototype = triangle; var obj = new coloredtriangle(); for (const prop in obj) { if (obj.hasownproperty(prop)) { console.log(`obj.${prop} = ${obj[prop]}`); } } // output: // "obj.color = red" specifications specification e
cmascript (e
cma-262)the definition of 'for...in statement' in that specification. ...
for...of - JavaScript
ties (not inherited). properties arrcustom and objcustom are not logged because they are inherited. for (const i of iterable) { console.log(i); // logs 3, 5, 7 } this loop iterates and logs values that iterable, as an iterable object, defines to be iterated over. the object's elements 3, 5, 7 are shown, but none of the object's properties. specifications specification e
cmascript (e
cma-262)the definition of 'for...of statement' in that specification. ...
if...else - JavaScript
the assignment can be confused with equality when glancing over the code. for example, do not use the following code: if (x = y) { /* do something */ } if you need to use an assignment in a conditional expression, a common practice is to put additional parentheses around the assignment. for example: if ((x = y)) { /* do something */ } specifications specification e
cmascript (e
cma-262)the definition of 'if statement' in that specification. ...
import.meta - JavaScript
ontext-specific metadata to a javascript module. it contains information about the module, like the module's url. syntax import.meta description the syntax consists of the keyword import, a dot, and the identifier meta. normally the left-hand side of the dot is the object on which property access is performed, but here import is not really an object. the import.meta object is created by the e
cmascript implementation, with a null prototype. the object is extensible, and its properties are writable, configurable, and enumerable. examples using import.meta given a module my-module.js <script type="module" src="my-module.js"></script> you can access meta information about the module using the import.meta object. console.log(import.meta); // { url: "file:///home/user/my-module.js" } ...
throw - JavaScript
s over 50. the rethrown exception propagates up to the enclosing function or to the top level so that the user sees it. try { throw n; // throws an exception with a numeric value } catch (e) { if (e <= 50) { // statements to handle exceptions 1-50 } else { // cannot handle this exception, so rethrow throw e; } } specifications specification e
cmascript (e
cma-262)the definition of 'throw statement' in that specification. ...
while - JavaScript
{ n++; x += n; } each iteration, the loop increments n and adds it to x. therefore, x and n take on the following values: after the first pass: n = 1 and x = 1 after the second pass: n = 2 and x = 3 after the third pass: n = 3 and x = 6 after completing the third pass, the condition n < 3 is no longer true, so the loop terminates. specifications specification e
cmascript (e
cma-262)the definition of 'while statement' in that specification. ...
Statements and declarations - JavaScript
es, and other scripts. import used to import functions exported from an external module, another script. import.meta an object exposing context-specific metadata to a javascript module. label provides a statement with an identifier that you can refer to using a break or continue statement. with extends the scope chain for a statement. specifications specification e
cmascript (e
cma-262)the definition of 'e
cmascript language: statements and declarations' in that specification. ...
JavaScript shells - JavaScript
ipt shells work with mozilla. firefox has a built-in javascript console, which support multi-line editing. javascript shell (js) - a command line interpreter for javascript xpcshell is an xpconnect - enabled shell, sometimes useful for mozilla development. babel repl - a browser-based repl for experimenting with future javascript. es6console.com - an open-source javascript console to test e
cmascript 2015 code inside the browser. jsconsole.com -- an open-source javascript console with the ability to easily link to particular expressions javascript shell (web page) - also available as part of the extension developer's extension jash: javascript shell - a dhtml based shell that gives you command line access to a web page. mozrepl - connect to firefox and other mozilla apps, explore a...
JavaScript typed arrays - JavaScript
nvert it back to a normal array in order to benefit from the array prototype. this can be done using array.from(), or using the following code where array.from() is unsupported. let typedarray = new uint8array([1, 2, 3, 4]), normalarray = array.prototype.slice.call(typedarray); normalarray.length === 4; normalarray.constructor === array; specifications specification e
cmascript (e
cma-262)the definition of 'typedarray objects' in that specification. ...
Values - MathML
n elements have attributes that accept length values used for size or spacing. mathml accepts different units and constants for specifying lengths. units unit description em font-relative unit ex font-relative unit. (the "x"-height of the element, 1ex ≈ 0.5em in many fonts) px pixels in inches (1 inch = 2.54 centimeters)
cm centimeters mm millimeters pt points (1 point = 1/72 inch) pc picas (1 pica = 12 points) % percentage of the default value. constants a replacement for the deprecated constants below is: veryverythinmathspace => 0.05555555555555555em verythinmathspace => 0.1111111111111111em thinmathspace => 0.16666666666666666em medium...
Image file type and format guide - Web media technologies
(long) 0x00000001 (1 entry) 0x00000280 (640 pixels) a single tiff file can contain multiple images; this may be used to represent multi-page documents, for example (such as a multi-page scanned document, or a received fax). however, software reading tiff files is only required to support the first image. tiff supports a variety of color spaces, not just rgb. these include
cmyk, ycbcr, and others, making tiff a good choice for storing images intended for print, film, or television media. long ago, some browsers supported tiff images in web content; today, however, you need to use special libraries or browser add-ons to do so. as such, tiff files are not useful within the context of web content, but it's common to provide downloadable tiff files when distributing phot...
Media - Progressive web apps (PWAs)
play property in a later page in this tutorial: xml data. printing css has specific support for printing and for paged media in general. a @page rule can set the page margins. for double-sided printing, you can specify the margins separately for @page:left and @page:right. for print media, you normally use appropriate length units like inches (in) and points (pt = 1/72 inch), or centimeters (
cm) and millimeters (mm). it is equally appropriate to use ems (em) to match the font size, and percentages (%). you can control how the content of the document breaks across page boundaries, by using the page-break-before, page-break-after and page-break-inside properties. example this rule sets the page margins to one inch on all four sides: @page {margin: 1in;} this rule ensures that every...
contentScriptType - SVG: Scalable Vector Graphics
te sets the default scripting language used to process the value strings in event attributes. this language must be used for all instances of script that do not specify their own scripting language. the value specifies a media type, per mime part two: media types [rfc2046]. usage notes value one of the content types specified in the media types default value application/e
cmascript animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'contentscripttype' in that specification. recommendation initial definition ...
keyPoints - SVG: Scalable Vector Graphics
default value none animatable no <number> [; <number>] ;? this value defines a semicolon-separated list of floating point values between 0 and 1 and indicates how far along the motion path the object shall move ...
keyTimes - SVG: Scalable Vector Graphics
be 0, and the last time value in the list must be 1. the key time associated with each value defines when the value is set; values are interpolated between the key times. for discrete animation, the first time value in the list must be 0. the time associated with each value defines when the value is set; the animation function uses that value until the next time defined in the list. if the cal
cmode attribute is set to paced, the keytimes attribute is ignored. if the duration of the animation is indefinite, any keytimes specification will be ignored. specifications specification status comment svg animations level 2the definition of 'keytimes' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)th...
textLength - SVG: Scalable Vector Graphics
s a length referring to the units of the current coordinate system. example let's create a simple example that presents text you can resize using an <input> element of type "range". css .controls { font: 16px "open sans", "arial", sans-serif; } svg let's start with the svg. it's pretty basic, with a 1000-by-300 pixel space mapped into a 10 centimeter by 3 centimeter box. <svg width="10
cm" height="3
cm" viewbox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg"> <rect x="1" y="1" width="998" height="298" fill="none" stroke="green" stroke-width="2"/> <text id="hello" x="10" y="150" font-family="sans-serif" font-size="60" fill="green"> hello world! </text> </svg> first, a <rect> element is used to create and stroke a rectangle to contain the text. then <te...
<animate> - SVG: Scalable Vector Graphics
height:100%; margin:0; padding:0; } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <rect width="10" height="10"> <animate attributename="rx" values="0;5;0" dur="10s" repeatcount="indefinite" /> </rect> </svg> attributes animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes cal
cmode, values, keytimes, keysplines, from, to, by other animation attributes most notably: attributename, additive, accumulate animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes this element implemen...
<svg> - SVG: Scalable Vector Graphics
x="200" width="100"> <circle cx="5" cy="5" r="4" /> </svg> </svg> attributes baseprofile deprecated since svg 2 the minimum svg language profile that the document requires. value type: <string> ; default value: none; animatable: no contentscripttype deprecated since svg 2 the default scripting language used by the svg fragment. value type: <string> ; default value: application/e
cmascript; animatable: no contentstyletype deprecated since svg 2 the default style sheet language used by the svg fragment. value type: <string> ; default value: text/css; animatable: no height the displayed height of the rectangular viewport. (not the height of its coordinate system.) value type: <length>|<percentage> ; default value: auto; animatable: yes preserveaspectratio how the svg f...